-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Set -Wl,-rpath,'$ORIGIN/../lib' when building rust toolchain #29941
Comments
Note in particular I'm having trouble getting the LD_LIBRARY_PATH thing to work in gecko automation. Fragile build systems. |
@rillian have you tried passing In short, We used to do this, and we explicitly stopped doing it, for various reasons. See in particular the discussion at #14832 update: see also discussion at old weekly mtg: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-07-08.md#rpath |
For docs, if like me, you'd never heard of $ORIGIN, see http://man7.org/linux/man-pages/man8/ld.so.8.html#DESCRIPTION and https://developer.apple.com/library/prerelease/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html glandium adds that Firefox uses @executable_path. https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html |
@rillian (if you have a counter-argument to the claims that "There are also bad things with rpaths. [Linux] distros will reject binaries that have rpaths" from the notes above, I would be curious to hear them. I had tried to push back against this change back when it was put forward, but I am ignorant of distros' processes and thus decided that I could not argue effectively on that front.) |
@pnkfelix Thanks. I didn't know about The bug discussion mostly seems to be about rpath in rustc's output. I'm just asking for it in rustc itself. Changing the default of the configure switch, not of |
What is the rationale for the rustc builds one can download are not using --enable-rpath? They are the builds that would benefit from it the most... |
The past motivations for this change are outlined in the many linked issues here (I'll also throw in #11747). It seems fine, however, to enable this sort of setting by default when building the compiler itself (but not for the executables the compiler itself then generates). I don't think we can "just use" the |
Not sure I agree that it's fine for the rustc case. The main argument seems the same to me there - it's different than windows. |
I guess you can view this from two angles:
I'd probably lean more towards consistency on the latter point for the compiler itself at least. |
I would love a variant of this for OSX (using Also I believe this change would help integration with package systems for open-source OSes. |
This commit changes our distribution and in-tree sources to pass the `-C rpath` flag by default during compiles. This means that from-source builds, including our release channels, will have this option enabled as well. Motivated by rust-lang#29941, this change means that the compiler should be usable as-is on all platforms just after extraction or installation. This experience is already true on Windows but on Unixes you still need to set up LD_LIBRARY_PATH or the equivalent, which can often be unfortunate. This option was originally turned off by default for Linux distributions who tend to take care of these sorts of details themselves, so it is expected that all those builds of Rust will want to pass `--disable-rpath` to the configure script to preserve that behavior. Closes rust-lang#29941
This commit changes our distribution and in-tree sources to pass the `-C rpath` flag by default during compiles. This means that from-source builds, including our release channels, will have this option enabled as well. Motivated by #29941, this change means that the compiler should be usable as-is on all platforms just after extraction or installation. This experience is already true on Windows but on Unixes you still need to set up LD_LIBRARY_PATH or the equivalent, which can often be unfortunate. This option was originally turned off by default for Linux distributions who tend to take care of these sorts of details themselves, so it is expected that all those builds of Rust will want to pass `--disable-rpath` to the configure script to preserve that behavior. Closes #29941
This commit changes our distribution and in-tree sources to pass the `-C rpath` flag by default during compiles. This means that from-source builds, including our release channels, will have this option enabled as well. Motivated by rust-lang#29941, this change means that the compiler should be usable as-is on all platforms just after extraction or installation. This experience is already true on Windows but on Unixes you still need to set up LD_LIBRARY_PATH or the equivalent, which can often be unfortunate. This option was originally turned off by default for Linux distributions who tend to take care of these sorts of details themselves, so it is expected that all those builds of Rust will want to pass `--disable-rpath` to the configure script to preserve that behavior. Closes rust-lang#29941
For building rust code in automation, it would be convenient if the official builds of rustc, rustdoc, cargo, etc. set an rpath relative to the executable, so they can be invoked without having to add to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac).
The text was updated successfully, but these errors were encountered: