#!/bin/bash source ../versions.sh export CFLAGS="-g -O2" export CPPFLAGS="-D_FORTIFY_SOURCE=2" export CXXFLAGS="-g -O2" export FFLAGS="-g -O2" export LDFLAGS= export CFLAGS_FOR_TARGET="-g -O2 --param=ssp-buffer-size=4 -Wformat -Wformat-security" # BUG: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164 # so we just disable it export CPPFLAGS_FOR_TARGET= export CXXFLAGS_FOR_TARGET="-g -O2 --param=ssp-buffer-size=4 -Wformat -Wformat-security" export FFLAGS_FOR_TARGET="-g -O2" export LDFLAGS_FOR_TARGET="-Wl,-Bsymbolic-functions -Wl,-z,relro" echo "Please comment out the following two lines in /usr/arm-frc-linux-gnueabi/usr/include/sys/types.h temporarily:" echo "//typedef __daddr_t daddr_t;" echo "//typedef __caddr_t caddr_t;" echo "Extracting GCC..." tar xf ../gcc-${V_GCC}.tar.bz2 echo "Extracting MPFR..." tar xf ../mpfr-${V_MPFR}.tar.bz2 echo "Extracting MPC..." tar xf ../mpc-${V_MPC}.tar.gz echo "Extracting GMP..." tar xf ../gmp-${V_GMP}.tar.bz2 echo "Extracting CLOOG..." tar xf ../cloog-${V_CLOOG}.tar.gz echo "Extracting ISL..." tar xf ../isl-${V_ISL}.tar.bz2 echo "Extracting GDB..." mv cloog-${V_CLOOG} gcc-${V_GCC}/cloog mv isl-${V_ISL} gcc-${V_GCC}/isl mv mpfr-${V_MPFR} gcc-${V_GCC}/mpfr mv mpc-${V_MPC} gcc-${V_GCC}/mpc mv gmp-${V_GMPf} gcc-${V_GCC}/gmp pushd gcc-${V_GCC} # apply the debian so patch patch -p1 < ../../deb/debians/gcc/patches/minorSOname popd mkdir gcc-build mkdir gcc-install cd gcc-build ../gcc-${V_GCC}/configure --host=i686-w64-mingw32 --enable-threads=posix --target=arm-frc-linux-gnueabi --with-arch=armv7-a --with-cpu=cortex-a9 --with-float=softfp --with-fpu=vfpv3 --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' --enable-languages=c,c++ --enable-shared --enable-lto --disable-nls --with-pkgversion='GCC for FRC' --with-cloog --disable-multilib --disable-multiarch --prefix=/frc --with-sysroot=/frc --enable-poison-system-directories --disable-libmudflap --with-build-sysroot=/usr/arm-frc-linux-gnueabi || exit $? make -j3 || exit $? DESTDIR=$PWD/../gcc-install make install cd ../gcc-install