[Openmp-commits] [openmp] [Libomptarget] Unify and simplify plugin CMake (PR #86191)

Michał Górny via Openmp-commits openmp-commits at lists.llvm.org
Sat Mar 23 07:13:49 PDT 2024


mgorny wrote:

This also broke linking against LLVM dylib (i.e. single `libLLVM*.so`). It insists on linking to static libraries that don't exist on Gentoo:

```
FAILED: libomptarget/libomptarget.rtl.amdgpu.so.19.0git51268a57 
: && /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -fPIC -march=znver2 --param=l1-cache-size=32 --param=l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches -Wall -Wcast-qual -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -Wno-maybe-uninitialized -fno-semantic-interposition -fdata-sections  -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0   -Wl,--gc-sections -shared -Wl,-soname,libomptarget.rtl.amdgpu.so.19.0git51268a57 -o libomptarget/libomptarget.rtl.amdgpu.so.19.0git51268a57 libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/PluginInterface.cpp.o libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/GlobalHandler.cpp.o libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/JIT.cpp.o libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/RPC.cpp.o libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/Utils/ELF.cpp.o libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/OMPT/OmptCallback.cpp.o libomptarget/plugins-nextgen/amdgpu/CMakeFiles/omptarget.rtl.amdgpu.dir/src/rtl.cpp.o  -Wl,-rpath,"\$ORIGIN:/tmp/portage/sys-libs/libomp-19.0.0_pre20240322/work/openmp_build-abi_x86_64.amd64/libomptarget/plugins-nextgen/amdgpu/..:/usr/lib/llvm/19/lib64:"  /usr/lib/llvm/19/lib64/libLLVM.so.19.0git51268a57  -lLLVMAArch64CodeGen […]
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lLLVMAArch64CodeGen: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lLLVMAArch64AsmParser: No such file or directory
[…]
```

`add_llvm_library`'s `LINK_COMPONENTS` takes care of doing this correctly. I don't really understand why `add_target_library` attempts to reinvent the wheel.

https://github.com/llvm/llvm-project/pull/86191


More information about the Openmp-commits mailing list