]> git.lizzy.rs Git - rust.git/commit
rustc: Use realpath() for sysroot/rpath
authorAlex Crichton <alex@alexcrichton.com>
Tue, 8 Apr 2014 17:15:46 +0000 (10:15 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 10 Apr 2014 22:22:00 +0000 (15:22 -0700)
commit3f2c55f7d5b5c7717dd12eef4572c52a4e8ff550
tree5d33313d67b78e779affbc42ce0b988226242209
parent25a6b6ef8b4a2852c98585496146ca9d3da37b1b
rustc: Use realpath() for sysroot/rpath

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 #11734
cc #11857
src/librustc/back/rpath.rs
src/librustc/metadata/filesearch.rs