-
Notifications
You must be signed in to change notification settings - Fork 13.3k
librustc_llvm: call llvm-config with correct linking mode #36854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report! Sounds like it should be a relatively easy bug to tackle as well! |
In Void, we work around it by just adding |
Oh we basically always want to link LLVM statically, so we can probably just always pass it. |
Run llvm-config with "--link-static" if available, to force static linking of LLVM. This option was added in LLVM 3.8. Fixes rust-lang#36854 See also: rust-lang#36996
We emphatically don't want that in distro builds. Would you accept a patch to make this conditional? |
@cuviper certainly! |
In 1.12,
src/librustc_llvm/build.rs
figures out which libraries it needs for external LLVM usingllvm-config --libs
which breaks if you have LLVM with-DLLVM_BUILD_LLVM_DYLIB=ON
and-DLLVM_LINK_LLVM_DYLIB=OFF
(which is needed for clang 3.9 these days), since then there is a dynamiclibLLVM3.9.so
and lots oflibLLVM*.a
, but the code sees thelibLLVM
and decides it has to link statically, which fails.The code should decide whether to link static or dynamic first, and then call
llvm-config --libs --link-shared
resp--link-static
, to get the correct library name.The text was updated successfully, but these errors were encountered: