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

Unified Diff: build/install-build-deps.sh

Issue 7355033: Linux: Stop installing the gold linker as /usr/bin/ld. Ask users to pass -B/usr/local/gold/bin in... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-build-deps.sh
===================================================================
--- build/install-build-deps.sh (revision 92189)
+++ build/install-build-deps.sh (working copy)
@@ -60,19 +60,16 @@
tar -xjvf $BINUTILS.tar.bz2
cd $BINUTILS
./configure --prefix=/usr/local/gold --enable-gold --enable-threads
- make maybe-all-binutils maybe-all-gold -j4
+ NCPU=`cat /proc/cpuinfo |grep ^processor|wc -l`
+ make maybe-all-binutils maybe-all-gold -j${NCPU}
if sudo make maybe-install-binutils maybe-install-gold
then
# Still need to figure out graceful way of pointing gyp to use
# /usr/local/gold/bin/ld without requiring him to set environment
# variables. That will go into bootstrap-linux.sh when it's ready.
Evan Martin 2011/07/13 20:37:38 FWIW, there is no bootstrap-linux.sh.
- echo "Installing gold as /usr/bin/ld."
- echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'"
- test -f /usr/bin/ld && test ! -f /usr/bin/ld.orig && \
- sudo mv /usr/bin/ld /usr/bin/ld.orig
+ test -f /usr/local/gold/bin/ld && test -f /usr/local/gold/bin/ld.gold && \
+ sudo mv /usr/local/gold/bin/ld.gold /usr/local/gold/bin/ld
sudo strip /usr/local/gold/bin/ld
- sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold
- sudo ln -fs /usr/bin/ld.gold /usr/bin/ld
else
echo "make install failed, not installing gold"
fi
@@ -249,13 +246,26 @@
# So install from source if we don't have a good version.
case `ld --version` in
+*gold*2.2[1-9].*)
+ echo "*** Warning ***"
+ echo "If the default linker is gold, linking may fail for:"
+ echo "the Linux kernel, kernel modules, Valgrind, and Wine."
+ echo "If you previously installed gold as the default linker,"
+ echo "you can restore the original linker by running:"
+ echo "'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'"
+ echo
+ ;;
+esac
+
+case `/usr/local/gold/bin/ld --version` in
*gold*2.2[1-9].*) ;;
* )
if test "$do_inst_gold" = ""
then
- echo "Gold is a new linker that links Chrome 5x faster than ld."
- echo "Don't use it if you need to link other apps (e.g. valgrind, wine)"
- echo -n "REPLACE SYSTEM LINKER ld with gold and back up ld? (y/N) "
+ echo "Gold is a new linker that links Chrome 5x faster than GNU ld."
+ echo -n "*** To use the gold linker, "
+ echo "you must pass -B/usr/local/gold/bin/ to g++ ***"
+ echo -n "Install the gold linker? (y/N) "
if yes_no 1; then
do_inst_gold=1
fi
@@ -267,8 +277,7 @@
echo "Installing binutils-gold. Backing up ld as ld.single."
sudo apt-get install binutils-gold
else
- # FIXME: avoid installing as /usr/bin/ld
- echo "Building binutils. Backing up ld as ld.orig."
+ echo "Building binutils with gold..."
install_gold || exit 99
fi
else
« 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