Closed
Description
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 like LD_LIBRARY_PATH
need to be specified manually.
This is a pretty tricky bug to fix as it will involve something like:
- Glorious hacks in the
src/bootstrap/rustc.rs
script to manually pass rpath directives - Modifying the
-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. - Use some sort of tool to modify this metadata in the executable after it's generated
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.