Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash -e | 1 #!/bin/bash -e |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Script to install everything needed to build chromium (well, ideally, anyway) | 7 # Script to install everything needed to build chromium (well, ideally, anyway) |
| 8 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions | 8 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions |
| 9 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit | 9 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit |
| 10 | 10 |
| 11 install_gold() { | 11 install_gold() { |
| 12 # Gold is optional; it's a faster replacement for ld, | 12 # Gold is optional; it's a faster replacement for ld, |
| 13 # and makes life on 2GB machines much more pleasant. | 13 # and makes life on 2GB machines much more pleasant. |
| 14 | 14 |
| 15 # First make sure root can access this directory, as that's tripped up some fo lks. | 15 # First make sure root can access this directory, as that's tripped up some fo lks. |
| 16 if sudo touch xyz.$$ | 16 if sudo touch xyz.$$ |
| 17 then | 17 then |
| 18 sudo rm xyz.$$ | 18 sudo rm xyz.$$ |
| 19 else | 19 else |
| 20 echo root cannot write to the current directory, not installing gold | 20 echo root cannot write to the current directory, not installing gold |
| 21 return | 21 return |
| 22 fi | 22 fi |
| 23 | 23 |
| 24 BINUTILS=binutils-2.19.1 | 24 BINUTILS=binutils-2.20 |
| 25 BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2 | 25 BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2 |
| 26 BINUTILS_SHA1=88c91e36cde93433e4c4c2b2e3417777aad84526 | 26 BINUTILS_SHA1=747e7b4d94bce46587236dc5f428e5b412a590dc |
| 27 | 27 |
| 28 test -f $BINUTILS.tar.bz2 || wget $BINUTILS_URL | 28 test -f $BINUTILS.tar.bz2 || wget $BINUTILS_URL |
| 29 if `sha1sum $BINUTILS.tar.bz2` != $BINUTILS_SHA1 | 29 if test "`sha1sum $BINUTILS.tar.bz2|cut -d' ' -f1`" != "$BINUTILS_SHA1" |
| 30 then | 30 then |
| 31 echo Bad sha1sum for $BINUTILS.tar.bz2 | 31 echo Bad sha1sum for $BINUTILS.tar.bz2 |
| 32 exit 1 | 32 exit 1 |
| 33 fi | 33 fi |
| 34 | 34 |
| 35 cat > binutils-fix.patch <<__EOF__ | 35 cat > binutils-fix.patch <<__EOF__ |
| 36 --- binutils-2.19.1/gold/reduced_debug_output.h.orig» 2009-05-10 14:44:52.0000 00000 -0700 | 36 --- binutils-2.20/gold/output.cc.orig» 2009-11-17 17:40:49.000000000 -0800 |
| 37 +++ binutils-2.19.1/gold/reduced_debug_output.h»2009-05-10 14:46:51.000000000 -0 700 | 37 +++ binutils-2.20/gold/output.cc» 2009-11-17 18:27:21.000000000 -0800 |
| 38 @@ -64,7 +64,7 @@ | 38 @@ -22,6 +22,10 @@ |
| 39 void | |
| 40 failed(std::string reason) | |
| 41 { | |
| 42 - gold_warning(reason.c_str()); | |
| 43 + gold_warning("%s", reason.c_str()); | |
| 44 failed_ = true; | |
| 45 } | |
| 46 | 39 |
| 47 @@ -110,7 +110,7 @@ | 40 #include "gold.h" |
| 48 void | |
| 49 failed(std::string reason) | |
| 50 { | |
| 51 - gold_warning(reason.c_str()); | |
| 52 + gold_warning("%s", reason.c_str()); | |
| 53 this->failed_ = true; | |
| 54 } | |
| 55 | 41 |
| 56 diff -u -r1.3 -r1.4 | 42 +#if !defined(__STDC_FORMAT_MACROS) |
| 57 --- binutils-2.19.1/gold/descriptors.h» 2009/01/15 01:29:25» 1.3 | 43 +#define __STDC_FORMAT_MACROS |
| 58 +++ binutils-2.19.1/gold/descriptors.h» 2009/02/28 03:05:08» 1.4 | 44 +#endif |
| 59 @@ -69,6 +69,8 @@ | 45 + |
| 60 bool inuse; | 46 #include <cstdlib> |
| 61 // Whether this is a write descriptor. | 47 #include <cstring> |
| 62 bool is_write; | 48 #include <cerrno> |
| 63 + // Whether the descriptor is on the stack. | 49 @@ -29,6 +33,7 @@ |
| 64 + bool is_on_stack; | 50 #include <unistd.h> |
| 65 }; | 51 #include <sys/mman.h> |
| 52 #include <sys/stat.h> | |
| 53 +#include <inttypes.h> | |
| 54 #include <algorithm> | |
| 55 #include "libiberty.h" | |
| 66 | 56 |
| 67 bool | 57 @@ -3505,11 +3510,11 @@ |
| 68 --- binutils-2.19.1/gold/descriptors.cc»2009/01/15 01:29:25» 1.3 | 58 » » Output_section* os = (*p)->output_section(); |
| 69 +++ binutils-2.19.1/gold/descriptors.cc»2009/02/28 03:05:08» 1.4 | 59 » » if (os == NULL) |
| 70 @@ -75,6 +75,12 @@ | 60 » » gold_error(_("dot moves backward in linker script " |
| 71 » { | 61 -» » » » "from 0x%llx to 0x%llx"), |
| 72 » gold_assert(!pod->inuse); | 62 +» » » » "from 0x%"PRIx64" to 0x%"PRIx64), |
| 73 » pod->inuse = true; | 63 » » » addr + (off - startoff), (*p)->address()); |
| 74 +» if (descriptor == this->stack_top_) | 64 » » else |
| 75 +» { | 65 » » gold_error(_("address of section '%s' moves backward " |
| 76 +» this->stack_top_ = pod->stack_next; | 66 -» » » » "from 0x%llx to 0x%llx"), |
| 77 +» pod->stack_next = -1; | 67 +» » » » "from 0x%"PRIx64" to 0x%"PRIx64), |
|
Evan Martin
2009/11/18 02:42:23
Can you upstream this patch?
http://sourceware.or
| |
| 78 +» pod->is_on_stack = false; | 68 » » » os->name(), addr + (off - startoff), |
| 79 +» } | 69 » » » (*p)->address()); |
| 80 » return descriptor; | 70 » » } |
| 81 » } | |
| 82 } | |
| 83 @@ -114,6 +120,7 @@ | |
| 84 » pod->stack_next = -1; | |
| 85 » pod->inuse = true; | |
| 86 » pod->is_write = (flags & O_ACCMODE) != O_RDONLY; | |
| 87 +» pod->is_on_stack = false; | |
| 88 | |
| 89 » ++this->current_; | |
| 90 » if (this->current_ >= this->limit_) | |
| 91 @@ -158,10 +165,11 @@ | |
| 92 else | |
| 93 { | |
| 94 pod->inuse = false; | |
| 95 - if (!pod->is_write) | |
| 96 + if (!pod->is_write && !pod->is_on_stack) | |
| 97 » { | |
| 98 » pod->stack_next = this->stack_top_; | |
| 99 » this->stack_top_ = descriptor; | |
| 100 +» pod->is_on_stack = true; | |
| 101 » } | |
| 102 } | |
| 103 } | |
| 104 @@ -193,6 +201,8 @@ | |
| 105 » this->stack_top_ = pod->stack_next; | |
| 106 » else | |
| 107 » this->open_descriptors_[last].stack_next = pod->stack_next; | |
| 108 +» pod->stack_next = -1; | |
| 109 +» pod->is_on_stack = false; | |
| 110 » return true; | |
| 111 » } | |
| 112 last = i; | |
| 113 __EOF__ | 71 __EOF__ |
| 114 | 72 |
| 115 tar -xjvf $BINUTILS.tar.bz2 | 73 tar -xjvf $BINUTILS.tar.bz2 |
| 116 cd $BINUTILS | 74 cd $BINUTILS |
| 117 patch -p1 < ../binutils-fix.patch | 75 patch -p1 < ../binutils-fix.patch |
| 118 ./configure --prefix=/usr/local/gold --enable-gold | 76 ./configure --prefix=/usr/local/gold --enable-gold |
| 119 make -j3 | 77 make -j3 |
| 120 if sudo make install | 78 if sudo make install |
| 121 then | 79 then |
| 122 # Still need to figure out graceful way of pointing gyp to use | 80 # Still need to figure out graceful way of pointing gyp to use |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 sed -e 's/[.]so[.][0-9].*/.so/' | | 384 sed -e 's/[.]so[.][0-9].*/.so/' | |
| 427 sort -u); do | 385 sort -u); do |
| 428 [ "x${i##*/}" = "xld-linux.so" ] && continue | 386 [ "x${i##*/}" = "xld-linux.so" ] && continue |
| 429 [ -r "$i" ] && continue | 387 [ -r "$i" ] && continue |
| 430 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 388 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
| 431 sort -n | tail -n 1)" | 389 sort -n | tail -n 1)" |
| 432 [ -r "$i.$j" ] || continue | 390 [ -r "$i.$j" ] || continue |
| 433 sudo ln -s "${i##*/}.$j" "$i" | 391 sudo ln -s "${i##*/}.$j" "$i" |
| 434 done | 392 done |
| 435 fi | 393 fi |
| OLD | NEW |