Chromium Code Reviews| Index: third_party/binutils/build-one.sh |
| diff --git a/third_party/binutils/build-one.sh b/third_party/binutils/build-one.sh |
| index 1a45638a059e7d6144116452fc4ad623146975d0..a50198334e1c51f92770712b75b7fb12f1c67090 100755 |
| --- a/third_party/binutils/build-one.sh |
| +++ b/third_party/binutils/build-one.sh |
| @@ -15,19 +15,35 @@ fi |
| cd "$1" |
| +# First, we need to build libtcmalloc_minimal |
| + |
| +cd ../gperftools/ |
| +./autogen.sh |
| +./configure --disable-static --enable-minimal --disable-heap-checker \ |
| + --disable-heap-profiler --disable-cpu-profiler |
| +make -j8 |
| + |
| +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' |
| + |
| +export LDFLAGS="-Wl,-rpath,zORIGIN/../../../../llvm-build/Release+Asserts/lib:zORIGIN/../lib -L$(pwd)/../gperftools/.libs/" |
|
Lei Zhang
2016/02/05 21:21:00
Can you update the comment above to mention the ad
Lei Zhang
2016/02/05 21:21:00
It would be nice to keep this at 80 chars / line.
krasin1
2016/02/05 21:51:53
Done.
krasin1
2016/02/05 21:51:53
Done.
|
| +export LIBS='-ltcmalloc_minimal' |
| ./configure --enable-gold=default --enable-threads --enable-plugins \ |
| --prefix=/build/output |
| + |
| make -j8 all |
| make install |
| +# Copy libtcmalloc_minimal library and symlinks to the install lib dir. |
| +cp -a ../gperftools/.libs/libtcmalloc_minimal.so* /build/output/*/lib/ |
| + |
| # 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/*)" |
| @@ -35,9 +51,9 @@ 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. |
| +# Verify that we changed only two bytes per executable. |
| for bin in $bins; do |
| - test "`cmp -l $bin.orig $bin | wc -l`" = 1 || \ |
| + test "`cmp -l $bin.orig $bin | wc -l`" = 2 || \ |
| (echo "$bin: verification failed" && exit 1) |
| done |