Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: third_party/binutils/build-one.sh

Issue 1330433002: binutils: Embed a relative path to the LLVM lib directory in binaries' rpaths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 # Copyright 2014 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Script to build binutils found in /build/binutils-XXXX when inside a chroot. 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. 7 # Don't call this script yourself, instead use the build-all.sh script.
8 8
9 set -e 9 set -e
10 10
11 if [ -z "$1" ]; then 11 if [ -z "$1" ]; then
12 echo "Directory of binutils not given." 12 echo "Directory of binutils not given."
13 exit 1 13 exit 1
14 fi 14 fi
15 15
16 cd "$1" 16 cd "$1"
17
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'
25
17 ./configure --enable-gold=default --enable-threads --enable-plugins \ 26 ./configure --enable-gold=default --enable-threads --enable-plugins \
18 --prefix=/build/output 27 --prefix=/build/output
19 make -j8 all 28 make -j8 all
20 make install 29 make install
30
31 # Fix up zORIGIN -> $ORIGIN.
32 bins="`echo /build/output/*/bin/*`"
krasin 2015/09/02 03:09:53 I believe that generally "$(echo /build/output/*/b
pcc 2015/09/05 03:10:06 Done.
33 sed -i.orig 's,zORIGIN/\.\.,$ORIGIN/..,g' $bins
krasin 2015/09/02 03:09:53 1) why do we need this trick with echo?
pcc 2015/09/05 03:10:06 The sed -i command will leave .orig files behind.
34
krasin 2015/09/02 03:09:53 2) can you please explain how did you chose the se
pcc 2015/09/05 03:10:06 Yes it can be that instead. I wrote the longer sed
35 # Verify that we changed only one byte per executable.
36 for bin in $bins; do
37 test "`cmp -l $bin.orig $bin | wc -l`" = 1
krasin 2015/09/02 03:09:54 Can you please make this script to output some mes
pcc 2015/09/05 03:10:06 Done.
38 done
39
40 rm /build/output/*/bin/*.orig
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698