OLD | NEW |
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 for both i386 and AMD64 Linux architectures. | 6 # Script to build binutils for both i386 and AMD64 Linux architectures. |
7 # Must be run on an AMD64 supporting machine which has debootstrap and sudo | 7 # Must be run on an AMD64 supporting machine which has debootstrap and sudo |
8 # installed. | 8 # installed. |
9 # Uses Ubuntu Lucid chroots as build environment. | 9 # Uses Ubuntu Lucid chroots as build environment. |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 | 38 |
39 if [ ! -d binutils-$VERSION ]; then | 39 if [ ! -d binutils-$VERSION ]; then |
40 # Extract the source | 40 # Extract the source |
41 tar jxf binutils-$VERSION.tar.bz2 | 41 tar jxf binutils-$VERSION.tar.bz2 |
42 | 42 |
43 # Patch the source | 43 # Patch the source |
44 ( | 44 ( |
45 cd binutils-$VERSION | 45 cd binutils-$VERSION |
46 patch -p1 < ../ehframe-race.patch | 46 patch -p1 < ../ehframe-race.patch |
| 47 patch -p1 < ../unlock-thin.patch |
| 48 patch -p1 < ../plugin-dso-fix.patch |
47 ) | 49 ) |
48 fi | 50 fi |
49 | 51 |
50 for ARCH in i386 amd64; do | 52 for ARCH in i386 amd64; do |
51 if [ ! -d lucid-chroot-$ARCH ]; then | 53 if [ ! -d lucid-chroot-$ARCH ]; then |
52 # Refresh sudo credentials | 54 # Refresh sudo credentials |
53 sudo -v | 55 sudo -v |
54 | 56 |
55 # Create the chroot | 57 # Create the chroot |
56 echo "" | 58 echo "" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 sudo chown -R $(whoami) "$BUILDDIR/output/" | 101 sudo chown -R $(whoami) "$BUILDDIR/output/" |
100 | 102 |
101 # Strip the output binaries | 103 # Strip the output binaries |
102 for i in "$BUILDDIR/output/$ARCHNAME/bin/*"; do | 104 for i in "$BUILDDIR/output/$ARCHNAME/bin/*"; do |
103 strip $i | 105 strip $i |
104 done | 106 done |
105 | 107 |
106 # Copy them out of the chroot | 108 # Copy them out of the chroot |
107 cp -a "$BUILDDIR/output/$ARCHNAME" "$OUTPUTDIR" | 109 cp -a "$BUILDDIR/output/$ARCHNAME" "$OUTPUTDIR" |
108 | 110 |
| 111 # Copy plugin header out of the chroot |
| 112 mkdir "$OUTPUTDIR/$ARCHNAME/include" |
| 113 cp "$BUILDDIR/binutils-$VERSION/include/plugin-api.h" "$OUTPUTDIR/$ARCHNAME/in
clude/" |
| 114 |
109 # Clean up chroot | 115 # Clean up chroot |
110 sudo rm -rf "$BUILDDIR" | 116 sudo rm -rf "$BUILDDIR" |
111 done | 117 done |
112 | 118 |
113 echo "Check you are happy with the binaries in" | 119 echo "Check you are happy with the binaries in" |
114 echo " $OUTPUTDIR" | 120 echo " $OUTPUTDIR" |
115 echo "Then" | 121 echo "Then" |
116 echo " * upload to Google Storage using the upload.sh script" | 122 echo " * upload to Google Storage using the upload.sh script" |
117 echo " * roll dependencies" | 123 echo " * roll dependencies" |
OLD | NEW |