aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-01-24 11:04:47 -0600
committerJoseph Huber <jhuber6@vols.utk.edu>2023-01-24 17:01:33 -0600
commit1964c334782e7c5961772fbdcdcc0029cba3a7fa (patch)
tree1202ed1a352fb4616025472b76e386efca469d14 /clang/lib/CodeGen/CodeGenFunction.cpp
parent4b88bf5c70c351c9b6758da7026b5673c0dcc8d9 (diff)
downloadllvm-1964c334782e7c5961772fbdcdcc0029cba3a7fa.zip
llvm-1964c334782e7c5961772fbdcdcc0029cba3a7fa.tar.gz
llvm-1964c334782e7c5961772fbdcdcc0029cba3a7fa.tar.bz2
[LinkerWrapper] Only import static libraries with needed symbols
Currently, we pull in every single static archive member as long as we have an offloading architecture that requires it. This goes against the standard sematnics of static libraries that only pull in symbols that define currently undefined symbols. In order to support this we roll some custom symbol resolution logic to check if a static library is needed. Because of offloading semantics, this requires an extra check for externally visibile symbols. E.g. if a static member defines a kernel we should import it. The main benefit to this is that we can now link against the `libomptarget.devicertl.a` library unconditionally. This removes the requirement for users to specify LTO on the link command. This will also allow us to stop using the `amdgcn` bitcode versions of the libraries. ``` clang foo.c -fopenmp --offload-arch=gfx1030 -foffload-lto -c clang foo.o -fopenmp --offload-arch=gfx1030 -foffload-lto ``` Reviewed By: tra Differential Revision: https://reviews.llvm.org/D142484
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions