Update V8 to version 4.7.52.
[chromium-blink-merge.git] / third_party / binutils / build-one.sh
blob1a45638a059e7d6144116452fc4ad623146975d0
1 #!/bin/sh
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 # Script to build binutils found in /build/binutils-XXXX when inside a chroot.
7 # Don't call this script yourself, instead use the build-all.sh script.
9 set -e
11 if [ -z "$1" ]; then
12 echo "Directory of binutils not given."
13 exit 1
16 cd "$1"
18 # Ask the dynamic loader to load libstdc++ from the LLVM build directory if
19 # available. That copy of libstdc++ is required by the gold plugin in the same
20 # directory. The dynamic loader expects the relative path to start with $ORIGIN,
21 # but because of escaping issues
22 # (https://sourceware.org/ml/binutils/2009-05/msg00252.html)
23 # we embed a dummy path with $ replaced with z and fix it up later.
24 export LDFLAGS='-Wl,-rpath,zORIGIN/../../../../llvm-build/Release+Asserts/lib'
26 ./configure --enable-gold=default --enable-threads --enable-plugins \
27 --prefix=/build/output
28 make -j8 all
29 make install
31 # Save the list of binaries. The sed -i command will leave .orig files behind.
32 # We don't want them to appear in the for loop below.
33 bins="$(echo /build/output/*/bin/*)"
35 # Fix up zORIGIN -> $ORIGIN.
36 sed -i.orig 's,zORIGIN,$ORIGIN,g' $bins
38 # Verify that we changed only one byte per executable.
39 for bin in $bins; do
40 test "`cmp -l $bin.orig $bin | wc -l`" = 1 || \
41 (echo "$bin: verification failed" && exit 1)
42 done
44 rm /build/output/*/bin/*.orig