1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/unix/build-gcc/build-gcc.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +#!/bin/bash 1.5 + 1.6 +gcc_version=4.7.3 1.7 +binutils_version=2.23.1 1.8 +this_path=$(readlink -f $(dirname $0)) 1.9 +gcc_bt_patch=${this_path}/gcc-bt.patch 1.10 +gcc_pr55650_patch=${this_path}/gcc48-pr55650.patch 1.11 +make_flags='-j12' 1.12 + 1.13 +root_dir=$(mktemp -d) 1.14 +cd $root_dir 1.15 + 1.16 +if test -z $TMPDIR; then 1.17 + TMPDIR=/tmp/ 1.18 +fi 1.19 + 1.20 +wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2 || exit 1 1.21 +tar xjf $TMPDIR/binutils-$binutils_version.tar.bz2 1.22 +mkdir binutils-objdir 1.23 +cd binutils-objdir 1.24 +../binutils-$binutils_version/configure --prefix /tools/gcc/ --enable-gold --enable-plugins --disable-nls || exit 1 1.25 +make $make_flags || exit 1 1.26 +make install $make_flags DESTDIR=$root_dir || exit 1 1.27 +cd .. 1.28 + 1.29 + wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1 1.30 +tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2 1.31 +cd gcc-$gcc_version 1.32 + 1.33 +./contrib/download_prerequisites 1.34 + 1.35 +# gcc 4.7 doesn't dump a stack on ICE so hack that in 1.36 +patch -p1 < $gcc_bt_patch || exit 1 1.37 + 1.38 +patch -p0 < $gcc_pr55650_patch || exit 1 1.39 + 1.40 +cd .. 1.41 +mkdir gcc-objdir 1.42 +cd gcc-objdir 1.43 +../gcc-$gcc_version/configure --prefix=/tools/gcc --enable-languages=c,c++ --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro || exit 1 1.44 +make $make_flags || exit 1 1.45 +make $make_flags install DESTDIR=$root_dir || exit 1 1.46 + 1.47 +cd $root_dir/tools 1.48 +tar caf $root_dir/gcc.tar.xz gcc/