changeset 0:710c1d3c6036

import
author jeffpc@hvfdev
date Sun, 30 Oct 2011 11:56:06 -0400
parents
children 3b0540107588
files .hgignore binutils.diff build.sh
diffstat 3 files changed, 146 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Sun Oct 30 11:56:06 2011 -0400
@@ -0,0 +1,5 @@
+^binutils-
+^gcc-
+^gmp-
+^mpc-
+^mpfr-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/binutils.diff	Sun Oct 30 11:56:06 2011 -0400
@@ -0,0 +1,19 @@
+diff -ru binutils-2.21.1.orig//gas/config/tc-s390.c binutils-2.21.1/gas/config/tc-s390.c
+--- binutils-2.21.1.orig//gas/config/tc-s390.c	Sat Oct 29 16:02:41 2011
++++ binutils-2.21.1/gas/config/tc-s390.c	Sat Oct 29 16:14:48 2011
+@@ -527,7 +527,6 @@
+ {
+   register const struct s390_opcode *op;
+   const struct s390_opcode *op_end;
+-  bfd_boolean dup_insn = FALSE;
+   const char *retval;
+ 
+   /* Give a warning if the combination -m64-bit and -Aesa is used.  */
+@@ -551,7 +550,6 @@
+ 	{
+ 	  as_bad (_("Internal assembler error for instruction format %s"),
+ 		  op->name);
+-	  dup_insn = TRUE;
+ 	}
+     }
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.sh	Sun Oct 30 11:56:06 2011 -0400
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+GCC_DIR="gcc-4.6.2"
+BINUTILS_DIR="binutils-2.21.1"
+GMP_DIR="gmp-5.0.2"
+MPFR_DIR="mpfr-3.1.0"
+MPC_DIR="mpc-0.9"
+
+GCC_TAR="${GCC_DIR}.tar.bz2"
+BINUTILS_TAR="${BINUTILS_DIR}.tar.bz2"
+GMP_TAR="${GMP_DIR}.tar.bz2"
+MPFR_TAR="${MPFR_DIR}.tar.bz2"
+MPC_TAR="${MPC_DIR}.tar.gz"
+
+GCC_URL="http://mirrors-us.seosue.com/gcc/releases/gcc-4.6.2/${GCC_TAR}"
+BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/${BINUTILS_TAR}"
+GMP_URL="ftp://ftp.gnu.org/gnu/gmp/${GMP_TAR}"
+MPFR_URL="http://www.mpfr.org/mpfr-current/${MPFR_TAR}"
+MPC_URL="http://www.multiprecision.org/mpc/download/${MPC_TAR}"
+
+PREFIX=$HOME/bin/cross
+MAKEOPTS=-j6
+TARGET=s390x-linux
+CHECKING=release
+#CHECKING=yes,rtl
+
+BUILD_BINUTILS=true
+BUILD_GMP=true
+BUILD_MPFR=true
+BUILD_MPC=true
+BUILD_GCC=true
+
+for x in wget tar patch rm mkdir gmake ; do
+	which $x 2> /dev/null && continue
+
+	echo "Error: cannot find '$x'"
+	exit 1
+done
+
+set -e
+set -x
+
+if $BUILD_BINUTILS ; then
+	[ ! -e "$BINUTILS_TAR" ] && wget "$BINUTILS_URL"
+	if [ ! -e "$BINUTILS_DIR" ]; then
+		tar xjvf "$BINUTILS_TAR"
+
+		cd "$BINUTILS_DIR"
+		patch -p1 < ../binutils.diff
+		cd ..
+	fi
+
+	rm -rf binutils-objs
+	mkdir binutils-objs
+	cd binutils-objs
+	../${BINUTILS_DIR}/configure --target=$TARGET --prefix=$PREFIX
+	gmake $MAKEOPTS
+	gmake install
+	cd ..
+fi
+
+if $BUILD_GMP ; then
+	[ ! -e "$GMP_TAR" ] && wget "$GMP_URL"
+	[ ! -e "$GMP_DIR" ] && tar xjvf "$GMP_TAR"
+
+	rm -rf gmp-objs
+	mkdir gmp-objs
+	cd gmp-objs
+	../${GMP_DIR}/configure --prefix=$PREFIX
+	gmake $MAKEOPTS
+	gmake install
+	cd ..
+fi
+
+if $BUILD_MPFR ; then
+	[ ! -e "$MPFR_TAR" ] && wget "$MPFR_URL"
+	[ ! -e "$MPFR_DIR" ] && tar xjvf "$MPFR_TAR"
+
+	rm -rf mpfr-objs
+	mkdir mpfr-objs
+	cd mpfr-objs
+	../${MPFR_DIR}/configure --prefix=$PREFIX --with-gmp=$PREFIX
+	gmake $MAKEOPTS
+	gmake install
+	cd ..
+fi
+
+if $BUILD_MPC ; then
+	[ ! -e "$MPC_TAR" ] && wget "$MPC_URL"
+	[ ! -e "$MPC_DIR" ] && tar xjvf "$MPC_TAR"
+
+	rm -rf mpc-objs
+	mkdir mpc-objs
+	cd mpc-objs
+	../${MPC_DIR}/configure --prefix=$PREFIX --with-gmp=$PREFIX
+	gmake $MAKEOPTS
+	gmake install
+	cd ..
+fi
+
+if $BUILD_GCC ; then
+	[ ! -e "$GCC_TAR" ] && wget "$GCC_URL"
+	[ ! -e "$GCC_DIR" ] && tar xjvf "$GCC_TAR"
+
+	rm -rf gcc-objs
+	mkdir gcc-objs
+	cd gcc-objs
+	../${GCC_DIR}/configure \
+		--target=$TARGET --enable-targets=all --prefix=$PREFIX \
+		--with-gmp=$PREFIX \
+		--with-mpfr=$PREFIX \
+		--with-mpc=$PREFIX \
+		--enable-languages=c,c++ --without-headers \
+		--enable-sjlj-exceptions --with-system-libunwind \
+		--disable-nls --disable-threads --disable-shared \
+		--disable-libmudflap --disable-libssp --disable-libgomp \
+		--disable-decimal-float \
+		--enable-checking=$CHECKING 
+	LD_LIBRARY_PATH=$PREFIX/lib gmake all-gcc all-target-libgcc $MAKEOPTS
+	gmake install-gcc install-target-libgcc
+	cd ..
+fi