[PATCH] D146326: [LinkerWrapper] Do not extract globals with no offloading language

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 17 13:17:46 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tra, yaxunl, tianshilei1992.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commits, jplehr, sstefan1.
Herald added a project: clang.

The linker wrapper needs to reinvent its own special static library
handling for static libraries containing fatbinaries. This is primarily
because offloading languages expect certain global symbols to be visible
to the host so we must consider them used symbols. However we should be
able to remove this requirement if we are linking in "freestanding" code
that was not created by an offloading language.

The motivation for this is to support the work-in-progress `libc` for
GPUs. It is provided as a static library with no offloading language
set. This logic will let us only import used `libc` symbols always.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146326

Files:
  clang/test/Driver/linker-wrapper-libs.c
  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146326.506185.patch
Type: text/x-patch
Size: 6380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230317/8aa53c69/attachment-0001.bin>


More information about the cfe-commits mailing list