Distributed libLLVM conflicts with system libraries #55737
Labels
A-linkage
Area: linking into static, shared libraries and binaries
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Now that
libLLVM.so
is distributed with rust, we are unable to dynamically link a rust binary against a differentlibLLVM.so
library. The rustlib directory containinglibLLVM
is prepended to the linker search path, and I don't see a good way to ask cargo to add a search path earlier than the rustlib is added. It looks to me like the rustlib directory is added here:rust/src/librustc_codegen_llvm/back/link.rs
Line 1044 in 15d7704
I noticed that support for appending a suffix to the LLVM libs was added in #53987. Can we turn that on for CI so the prebuilt distributions have a suffix on the library?
Unfortunately, the suffix won't actually fix this issue on MacOS, since the LLVM build does not append the suffix (or any version info) to the name of the dynamic library when building on MacOS: (see https://github.com/rust-lang/llvm/blob/7051ead40a5f825878b59bf08d4e768be9e99a4a/cmake/modules/AddLLVM.cmake#L520)
The text was updated successfully, but these errors were encountered: