-
Notifications
You must be signed in to change notification settings - Fork 13.4k
tools cannot find -lLLVM
in a non-standard link path
#68714
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I would not be personally opposed to including LLVM's libdir during compile time, so long as that's not visible in our final artifacts (which I think is true?). |
Thank you @cuviper for the workaround, I'm able to compile Rust 1.41 now. Just another suggestion for improvement: after adding Maybe a "sanity-check" could be implemented when parsing environment variables so these kind of errors could be mitigated? |
I don't think anything in Rust parses |
I just discovered the giant comment in commit 8b9c539, which is describing nearly the same issue. Perhaps better propagation of the library path will help improve that too. |
In my build of Rust 1.41 on EPEL7, I see link failures first for
clippy
andrls
, which are allowed by rustbuild, and then a hard failure onrustdoc
.This seems to be a recurrence of #40717 (comment), where the
-l
link library for LLVM is passed on to dependent crates, but the-L
library path is not, so it fails to actually link the tools.I called out
librustc_driver
in the excerpted link line above, because in a normal build with dynamic LLVM, that's the only thing that actually uses LLVM symbols. Therustdoc
binary does not usually end up with a direct dependency on LLVM, so it doesn't really need that-lLLVM
at all.The problem in #40717 went away once we started loading codegen dynamically in #47671. However, #67077 started linking LLVM directly again, and this just reached stable 1.41.
My former workaround of setting
LIBRARY_PATH=$(llvm-config --libdir)
still works. This is specifically the compile-time link path, not the runtimeLD_LIBRARY_PATH
. Maybe we could kludge that into rustbuild somehow?The text was updated successfully, but these errors were encountered: