Skip to content
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

rustc: Remove absolute rpaths #13396

Closed
wants to merge 4 commits into from

Conversation

alexcrichton
Copy link
Member

Concerns have been raised about using absolute rpaths in #11746, and this is the
first step towards not relying on rpaths at all. The only current use case for
an absolute rpath is when a non-installed rust builds an executable that then
moves from is built location. The relative rpath back to libstd and absolute
rpath to the installation directory still remain (CFG_PREFIX).

Closes #11746
Rebasing of #12754

Concerns have been raised about using absolute rpaths in rust-lang#11746, and this is the
first step towards not relying on rpaths at all. The only current use case for
an absolute rpath is when a non-installed rust builds an executable that then
moves from is built location. The relative rpath back to libstd and absolute
rpath to the installation directory still remain (CFG_PREFIX).

Closes rust-lang#11746
Rebasing of rust-lang#12754
This library no longer exists, there's no reason for this rpath to exist any
more.
This is required in rustc to resolve symlinks for utilities such as the sysroot
and the rpath values which are encoded into binaries.
When calculating the sysroot, it's more accurate to use realpath() rather than
just one readlink() to account for any intermediate symlinks that the rustc
binary resolves itself to.

For rpath, realpath() is necessary because the rpath must dictate a relative
rpath from the destination back to the originally linked library, which works
more robustly if there are no symlinks involved.

Concretely, any binary generated on OSX into $TMPDIR requires an absolute rpath
because the temporary directory is behind a symlink with one layer of
indirection. This symlink causes all relative rpaths to fail to resolve.

cc rust-lang#11734
cc rust-lang#11857
@alexcrichton
Copy link
Member Author

re-r? Turns out relative rpaths didn't work at all when there were symlinks in the pathname, sadly (see the last commit)

@bors bors closed this in 0156af1 Apr 11, 2014
@alexcrichton alexcrichton deleted the abs-rpaths branch April 11, 2014 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using absolute rpaths
3 participants