The llvm libraries depend on the symbols in the system libaries, so
the system libraries need to be added after.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
No, I was hitting this when using the default build options for both LLVM and libclc.
that's weird. linker shouldn't really drop libraries unless as-needed is used. can you post the falling cmdline?
This is the failing cmdline (from here https://github.com/tstellar/llvm-project/runs/587088911):
/usr/bin/c++ CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o -o prepare_builtins -L/home/runner/work/llvm-project/llvm-project/build/lib -Wl,-rpath,/home/runner/work/llvm-project/llvm-project/build/lib -lz -lrt -ldl -ltinfo -lpthread -lm -lxml2 -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle
Looks like this is caused by Ubuntu enabling -Wl,--as-needed by default (since 11.10) [0]
[0] https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wl.2C--as-needed