-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustbuild: rustc's -Crpath does not work #32886
Comments
Why relative rpaths are not enough? The libraries can still be found at |
The problem is that we generate relative rpaths with the expectation that the directory structure at compile time is the same as that at runtime. With the makefiles we do that but with rustbuild we just take whatever Cargo outputs and massage it into the directory structure we later ship. For example:
When compared to a normal build:
Namely, the compiler relies on |
Maybe a new -Z flag? Hacks also fine. |
This commit fixes the `--enable-rpath` configure flag in rustbuild to work despite the compile-time directories being different than the runtime directories. This unfortunately means that we can't use `-C rpath` out of the box but hopefully the portability story here isn't too bad as `src/librustc_back/rpath.rs` isn't *too* complicated. Closes rust-lang#32886
rustbuild: Fix --enable-rpath usage This commit fixes the `--enable-rpath` configure flag in rustbuild to work despite the compile-time directories being different than the runtime directories. This unfortunately means that we can't use `-C rpath` out of the box but hopefully the portability story here isn't too bad as `src/librustc_back/rpath.rs` isn't *too* complicated. Closes #32886
The way the compiler emits rpath directives is relative to the output directory structure, but with rustbuild we output in one structure and then copy over into another. This means that
-Crpath
basically doesn't work, and things likeLD_LIBRARY_PATH
need to be specified manually.This is a pretty tricky bug to fix as it will involve something like:
src/bootstrap/rustc.rs
script to manually pass rpath directives-C rpath
argument to take some sort of value indicating what should be passed to the linker, this is an API change to the compiler, however.I'm somewhat leaning towards the "glorious hacks" method for now to get something working and avoid changing the compiler, but there are other reasons why we would want to modify the
-C rpath
argument to the compiler as well perhaps.The text was updated successfully, but these errors were encountered: