diff options
Diffstat (limited to 'build/unix/build-gcc')
-rw-r--r-- | build/unix/build-gcc/PR64905.patch | 11 | ||||
-rwxr-xr-x | build/unix/build-gcc/build-gcc.sh | 52 |
2 files changed, 63 insertions, 0 deletions
diff --git a/build/unix/build-gcc/PR64905.patch b/build/unix/build-gcc/PR64905.patch new file mode 100644 index 000000000..b86c99b9f --- /dev/null +++ b/build/unix/build-gcc/PR64905.patch @@ -0,0 +1,11 @@ +--- trunk/gcc/lra-eliminations.c 2015/02/04 20:00:48 220415 ++++ trunk/gcc/lra-eliminations.c 2015/02/04 20:02:21 220416 +@@ -182,6 +182,8 @@ + if (! value + && ep->from == FRAME_POINTER_REGNUM && ep->to == STACK_POINTER_REGNUM) + frame_pointer_needed = 1; ++ if (!frame_pointer_needed) ++ REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = 0; + } + + /* Map: eliminable "from" register -> its current elimination, diff --git a/build/unix/build-gcc/build-gcc.sh b/build/unix/build-gcc/build-gcc.sh new file mode 100755 index 000000000..df3bc5dfd --- /dev/null +++ b/build/unix/build-gcc/build-gcc.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +gcc_version=4.8.5 +binutils_version=2.25.1 +this_path=$(readlink -f $(dirname $0)) +make_flags='-j12' + +root_dir="$1" +if [ -z "$root_dir" -o ! -d "$root_dir" ]; then + root_dir=$(mktemp -d) +fi +cd $root_dir + +if test -z $TMPDIR; then + TMPDIR=/tmp/ +fi + +wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2 || exit 1 +tar xjf $TMPDIR/binutils-$binutils_version.tar.bz2 +mkdir binutils-objdir +cd binutils-objdir +# gold is disabled because we don't use it on automation, and also we ran into +# some issues with it using this script in build-clang.py. +../binutils-$binutils_version/configure --prefix /tools/gcc/ --disable-gold --enable-plugins --disable-nls || exit 1 +make $make_flags || exit 1 +make install $make_flags DESTDIR=$root_dir || exit 1 +cd .. + +case "$gcc_version" in +*-*) + wget -c -P $TMPDIR ftp://gcc.gnu.org/pub/gcc/snapshots/$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1 + ;; +*) + wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1 + ;; +esac +tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2 +cd gcc-$gcc_version + +./contrib/download_prerequisites + +patch -p1 < "${this_path}/PR64905.patch" || exit 1 + +cd .. +mkdir gcc-objdir +cd gcc-objdir +../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 +make $make_flags || exit 1 +make $make_flags install DESTDIR=$root_dir || exit 1 + +cd $root_dir/tools +tar caf $root_dir/gcc.tar.xz gcc/ |