commit 0d36f05505208e8c46ece532c9cb455cde31c417 Author: Georg Koppen gk@torproject.org Date: Wed Sep 17 10:43:13 2014 +0000
Bug 12461: New compiler for Tor Browser ESR 31.
Tor Browser based on Firefox ESR 31 needs a newer compiler. GCC 4.4 is not supported anymore. We chose the latest GCC (4.9.1) as we don't want to bump the version again when we start deploying hardened builds. --- RelativeLink/RelativeLink.sh | 2 +- gitian/descriptors/linux/gitian-firefox.yml | 22 +++++++++++++++++++--- gitian/descriptors/linux/gitian-utils.yml | 21 +++++++++++++++++++-- gitian/gpg/GCC.gpg | Bin 9931 -> 2635 bytes gitian/mkbundle-linux.sh | 6 ++++++ gitian/versions.nightly | 2 +- 6 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/RelativeLink/RelativeLink.sh b/RelativeLink/RelativeLink.sh index e75482a..88f9f8e 100755 --- a/RelativeLink/RelativeLink.sh +++ b/RelativeLink/RelativeLink.sh @@ -215,7 +215,7 @@ if [ $SYSARCHITECTURE -ne $TORARCHITECTURE ]; then exit 1 fi
-LD_LIBRARY_PATH="${HOME}/TorBrowser/Tor/" +LD_LIBRARY_PATH="${HOME}:${HOME}/TorBrowser/Tor/" export LD_LIBRARY_PATH
function setControlPortPasswd() { diff --git a/gitian/descriptors/linux/gitian-firefox.yml b/gitian/descriptors/linux/gitian-firefox.yml index 4284a5d..633444d 100644 --- a/gitian/descriptors/linux/gitian-firefox.yml +++ b/gitian/descriptors/linux/gitian-firefox.yml @@ -26,6 +26,8 @@ packages: - "libgstreamer-plugins-base0.10-dev" # To pass configure since ESR 31. - "libpulse-dev" +# We built GCC but not the libmpc2, thus we need to install it. +- "libmpc2" reference_datetime: "2000-01-01 00:00:00" remotes: - "url": "https://git.torproject.org/tor-browser.git" @@ -33,6 +35,8 @@ remotes: files: - "binutils-linux32-utils.zip" - "binutils-linux64-utils.zip" +- "gcc-linux32-utils.zip" +- "gcc-linux64-utils.zip" - "python-linux32-utils.zip" - "python-linux64-utils.zip" - "re-dzip.sh" @@ -60,12 +64,12 @@ script: | mkdir -p $INSTDIR/build/bin/ ln -s /usr/bin/yasm-1 $INSTDIR/build/bin/yasm export PATH=$PATH:$INSTDIR/build/bin - # Preparing Python for Firefox + # Preparing Python for Tor Browser unzip -d $INSTDIR python-linux$GBUILD_BITS-utils.zip # TODO: We might want to have a smarter solution than hard-coding the version. ln -sf $INSTDIR/python/bin/python2.7 $INSTDIR/python/bin/python export PATH=$INSTDIR/python/bin:$PATH - # + # Preparing Binutils and GCC for Tor Browser unzip -d $INSTDIR binutils-linux$GBUILD_BITS-utils.zip # Make sure gold is used with the hardening wrapper for full RELRO, see # #13031. @@ -76,7 +80,16 @@ script: | ln -sf hardened-ld ld.gold ln -sf ld.gold ld cd ~/build - export PATH=$INSTDIR/binutils/bin:$PATH + unzip -d $INSTDIR gcc-linux$GBUILD_BITS-utils.zip + export PATH=$INSTDIR/gcc/bin:$INSTDIR/binutils/bin:$PATH + ARCH="" + if [ $GBUILD_BITS == "64" ]; + then + ARCH="64" + fi + # Make sure our GCC gets properly used. + export LD_LIBRARY_PATH=$INSTDIR/gcc/lib$ARCH + # mkdir -p $INSTDIR/Browser/ mkdir -p $INSTDIR/Debug/Browser/components # @@ -119,6 +132,9 @@ script: | strip $LIB objcopy --add-gnu-debuglink=./Debug/$LIB $LIB done + # We need to copy the libstdc++.so.6 for older Linux distros. + cp $INSTDIR/gcc/lib$ARCH/libstdc++.so.6 Browser + # ~/build/re-dzip.sh Browser/omni.ja ~/build/re-dzip.sh Browser/webapprt/omni.ja ~/build/re-dzip.sh Browser/browser/omni.ja diff --git a/gitian/descriptors/linux/gitian-utils.yml b/gitian/descriptors/linux/gitian-utils.yml index 35fb67b..59ef707 100644 --- a/gitian/descriptors/linux/gitian-utils.yml +++ b/gitian/descriptors/linux/gitian-utils.yml @@ -17,6 +17,8 @@ packages: - "hardening-wrapper" # Needed for compiling gold. - "bison" +# Needed for compiling GCC. +- "libmpc-dev" # These packages are needed for Python due to HTTPS-Everywhere >= 3.5. - "libsqlite3-dev" - "zlib1g-dev" @@ -30,6 +32,7 @@ remotes: "dir": "libevent" files: - "binutils.tar.bz2" +- "gcc.tar.bz2" - "openssl.tar.gz" - "python.tar.bz2" - "lxml.tar.gz" @@ -39,8 +42,6 @@ files: script: | INSTDIR="$HOME/install" source versions - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME export TZ=UTC export LC_ALL=C umask 0022 @@ -64,6 +65,21 @@ script: | make install cd ..
+ # Building GCC + tar xjf gcc.tar.bz2 + cd gcc-* + ./configure --prefix=$INSTDIR/gcc --disable-multilib --enable-languages=c,c++ + make $MAKEOPTS + make install + cd .. + + # libfaketime gets into our way when building GCC 4.9.x. See: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61314 for details. Thus, we + # avoid it for the toolchain and cross our fingers. + # TODO: Test a newer libfaketime than 0.8. + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + # Building Libevent cd libevent ./autogen.sh @@ -122,6 +138,7 @@ script: | # Grabbing the remaining results cd $INSTDIR ~/build/dzip.sh binutils-$BINUTILS_VER-linux$GBUILD_BITS-utils.zip binutils + ~/build/dzip.sh gcc-$GCC_VER-linux$GBUILD_BITS-utils.zip gcc ~/build/dzip.sh openssl-$OPENSSL_VER-linux$GBUILD_BITS-utils.zip openssl ~/build/dzip.sh libevent-${LIBEVENT_TAG#release-}-linux$GBUILD_BITS-utils.zip libevent ~/build/dzip.sh python-$PYTHON_VER-linux$GBUILD_BITS-utils.zip python diff --git a/gitian/gpg/GCC.gpg b/gitian/gpg/GCC.gpg index d94d692..e62de27 100644 Binary files a/gitian/gpg/GCC.gpg and b/gitian/gpg/GCC.gpg differ diff --git a/gitian/mkbundle-linux.sh b/gitian/mkbundle-linux.sh index c4938d0..8a4e55f 100755 --- a/gitian/mkbundle-linux.sh +++ b/gitian/mkbundle-linux.sh @@ -100,6 +100,8 @@ cd $GITIAN_DIR
if [ ! -f inputs/binutils-$BINUTILS_VER-linux32-utils.zip -o \ ! -f inputs/binutils-$BINUTILS_VER-linux64-utils.zip -o \ + ! -f inputs/gcc-$GCC_VER-linux32-utils.zip -o \ + ! -f inputs/gcc-$GCC_VER-linux64-utils.zip -o \ ! -f inputs/openssl-$OPENSSL_VER-linux32-utils.zip -o \ ! -f inputs/openssl-$OPENSSL_VER-linux64-utils.zip -o \ ! -f inputs/libevent-${LIBEVENT_TAG_ORIG#release-}-linux32-utils.zip -o \ @@ -126,6 +128,8 @@ then cp -a ../build/out/*-utils.zip . ln -sf binutils-$BINUTILS_VER-linux32-utils.zip binutils-linux32-utils.zip ln -sf binutils-$BINUTILS_VER-linux64-utils.zip binutils-linux64-utils.zip + ln -sf gcc-$GCC_VER-linux32-utils.zip gcc-linux32-utils.zip + ln -sf gcc-$GCC_VER-linux64-utils.zip gcc-linux64-utils.zip ln -sf openssl-$OPENSSL_VER-linux32-utils.zip openssl-linux32-utils.zip ln -sf openssl-$OPENSSL_VER-linux64-utils.zip openssl-linux64-utils.zip ln -sf libevent-${LIBEVENT_TAG_ORIG#release-}-linux32-utils.zip libevent-linux32-utils.zip @@ -147,6 +151,8 @@ else cd inputs ln -sf binutils-$BINUTILS_VER-linux32-utils.zip binutils-linux32-utils.zip ln -sf binutils-$BINUTILS_VER-linux64-utils.zip binutils-linux64-utils.zip + ln -sf gcc-$GCC_VER-linux32-utils.zip gcc-linux32-utils.zip + ln -sf gcc-$GCC_VER-linux64-utils.zip gcc-linux64-utils.zip ln -sf openssl-$OPENSSL_VER-linux32-utils.zip openssl-linux32-utils.zip ln -sf openssl-$OPENSSL_VER-linux64-utils.zip openssl-linux64-utils.zip ln -sf libevent-${LIBEVENT_TAG_ORIG#release-}-linux32-utils.zip libevent-linux32-utils.zip diff --git a/gitian/versions.nightly b/gitian/versions.nightly index 4d4c4f5..5032058 100755 --- a/gitian/versions.nightly +++ b/gitian/versions.nightly @@ -34,7 +34,7 @@ GMP_VER=5.1.3 FIREFOX_LANG_VER=$FIREFOX_VERSION FIREFOX_LANG_BUILD=build1 BINUTILS_VER=2.24 -GCC_VER=4.8.3 +GCC_VER=4.9.1 PYTHON_VER=2.7.5 PYCRYPTO_VER=2.6.1 ARGPARSE_VER=1.2.1
tor-commits@lists.torproject.org