diff options
author | pcc <pcc@chromium.org> | 2015-09-11 13:19:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-11 20:19:49 +0000 |
commit | 2b4b72b16d655c497dcc4693d3577bf01b71e992 (patch) | |
tree | 359480590d4cad1894d7e6b91f6b9c4327f551cd /third_party/binutils | |
parent | 314880aa20d7e71bc01515afa7b9c82e763f4218 (diff) | |
download | chromium_src-2b4b72b16d655c497dcc4693d3577bf01b71e992.zip chromium_src-2b4b72b16d655c497dcc4693d3577bf01b71e992.tar.gz chromium_src-2b4b72b16d655c497dcc4693d3577bf01b71e992.tar.bz2 |
binutils: Embed a relative path to the LLVM lib directory in binaries' rpaths.
This ensures that the correct version of libstdc++ is loaded by gold
before it loads the LLVM LTO plugin. See bug for details.
BUG=521143
R=thestig@chromium.org,thakis@chromium.org,krasin@google.com
Review URL: https://codereview.chromium.org/1330433002
Cr-Commit-Position: refs/heads/master@{#348478}
Diffstat (limited to 'third_party/binutils')
-rw-r--r-- | third_party/binutils/Linux_ia32/binutils.tar.bz2.sha1 | 2 | ||||
-rw-r--r-- | third_party/binutils/Linux_x64/binutils.tar.bz2.sha1 | 2 | ||||
-rwxr-xr-x | third_party/binutils/build-one.sh | 24 |
3 files changed, 26 insertions, 2 deletions
diff --git a/third_party/binutils/Linux_ia32/binutils.tar.bz2.sha1 b/third_party/binutils/Linux_ia32/binutils.tar.bz2.sha1 index 94c02d2..f675c4a 100644 --- a/third_party/binutils/Linux_ia32/binutils.tar.bz2.sha1 +++ b/third_party/binutils/Linux_ia32/binutils.tar.bz2.sha1 @@ -1 +1 @@ -e73c227c9cfacfc5fecaa22ee3555b90925f96c2
\ No newline at end of file +27e33f55580447b20eac71849a04168274aab7e8
\ No newline at end of file diff --git a/third_party/binutils/Linux_x64/binutils.tar.bz2.sha1 b/third_party/binutils/Linux_x64/binutils.tar.bz2.sha1 index b415234..f4c6084 100644 --- a/third_party/binutils/Linux_x64/binutils.tar.bz2.sha1 +++ b/third_party/binutils/Linux_x64/binutils.tar.bz2.sha1 @@ -1 +1 @@ -05497e34b29c01dd82df76d2fbdf017d4a2c4214
\ No newline at end of file +733c355177167e11c45f7bf49f144153fda335cc
\ No newline at end of file diff --git a/third_party/binutils/build-one.sh b/third_party/binutils/build-one.sh index 1ae62d1..1a45638a0 100755 --- a/third_party/binutils/build-one.sh +++ b/third_party/binutils/build-one.sh @@ -14,7 +14,31 @@ if [ -z "$1" ]; then fi cd "$1" + +# Ask the dynamic loader to load libstdc++ from the LLVM build directory if +# available. That copy of libstdc++ is required by the gold plugin in the same +# directory. The dynamic loader expects the relative path to start with $ORIGIN, +# but because of escaping issues +# (https://sourceware.org/ml/binutils/2009-05/msg00252.html) +# we embed a dummy path with $ replaced with z and fix it up later. +export LDFLAGS='-Wl,-rpath,zORIGIN/../../../../llvm-build/Release+Asserts/lib' + ./configure --enable-gold=default --enable-threads --enable-plugins \ --prefix=/build/output make -j8 all make install + +# Save the list of binaries. The sed -i command will leave .orig files behind. +# We don't want them to appear in the for loop below. +bins="$(echo /build/output/*/bin/*)" + +# Fix up zORIGIN -> $ORIGIN. +sed -i.orig 's,zORIGIN,$ORIGIN,g' $bins + +# Verify that we changed only one byte per executable. +for bin in $bins; do + test "`cmp -l $bin.orig $bin | wc -l`" = 1 || \ + (echo "$bin: verification failed" && exit 1) +done + +rm /build/output/*/bin/*.orig |