diff --git a/build.sh b/build.sh index 40e865e..69dccaa 100755 --- a/build.sh +++ b/build.sh @@ -544,6 +544,46 @@ toolchain_binutils() { cd "$SOURCES" && rm -rf binutils-$BINUTILS_VERSION } +toolchain_gcc() { + cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION + + tar xf ../gmp-$GMP_VERSION.tar.xz && mv gmp-$GMP_VERSION gmp + tar xf ../isl-$ISL_VERSION.tar.xz && mv isl-$ISL_VERSION isl + tar xf ../mpc-$MPC_VERSION.tar.gz && mv mpc-$MPC_VERSION mpc + tar xf ../mpfr-$MPFR_VERSION.tar.xz && mv mpfr-$MPFR_VERSION mpfr + + sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 + + sed '/thread_header =/s/@.*@/gthr-posix.h/' -i libgcc/Makefile.in libstdc++-v3/include/Makefile.in + + mkdir -p build && cd build + + ../configure \ + --build=$(../config.guess) \ + --host=$TARGET \ + --target=$TARGET \ + --prefix=/usr \ + --with-build-sysroot="$SYSROOT" \ + --enable-default-pie \ + --enable-default-ssp \ + --disable-nls \ + --disable-multilib \ + --disable-libatomic \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-libsanitizer \ + --disable-libssp \ + --disable-libvtv \ + --enable-languages=c,c++ \ + LDFLAGS_FOR_TARGET=-L"$PWD/$TARGET/libgcc" + + make && make DESTDIR="$SYSROOT" install + + ln -s gcc "$SYSROOT"/usr/bin/cc + + cd "$SOURCES" && rm -rf gcc-$GCC_VERSION +} + #bootstrap_binutils #bootstap_gcc #bootstap_linux @@ -564,4 +604,5 @@ toolchain_binutils() { #toolchain_sed #toolchain_tar #toolchain_xz -toolchain_binutils \ No newline at end of file +#toolchain_binutils +toolchain_gcc \ No newline at end of file