From be1100497d223481c0e4b1354c0c7737b8af2d23 Mon Sep 17 00:00:00 2001 From: VAN BOSSUYT Nicolas Date: Mon, 15 Apr 2019 16:34:41 +0200 Subject: [PATCH] Toolchain: GCC and binutils are now configure correctly --- .gitignore | 1 + Toolchain/BuildIt.sh | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1dc4fe798ba..9b638b61b6b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ Root Toolchain/Tarballs Toolchain/Build +.vscode diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh index 3b629a82808..48dca5f0465 100644 --- a/Toolchain/BuildIt.sh +++ b/Toolchain/BuildIt.sh @@ -1,56 +1,73 @@ #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo $DIR + TARGET=i686-pc-serenity PREFIX="$DIR/Local" +SYSROOT="$DIR/../Root" mkdir -p "$DIR/Tarballs" pushd "$DIR/Tarballs" if [ ! -e "binutils-2.32.tar.gz" ]; then wget "http://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz" + else + echo "Skipped downloading binutils" fi if [ ! -e "gcc-8.3.0.tar.gz" ]; then wget "http://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz" + else + echo "Skipped downloading gcc" fi if [ ! -d "binutils-2.32" ]; then + echo "Extracting binutils..." tar -xf "binutils-2.32.tar.gz" pushd "binutils-2.32" - patch -p1 < $DIR/Patches/binutils.patch + patch -p1 < $DIR/Patches/binutils.patch > /dev/null popd + else + echo "Skipped extracting binutils" fi if [ ! -d "gcc-8.3.0" ]; then + echo "Extracting gcc..." tar -xf "gcc-8.3.0.tar.gz" pushd "gcc-8.3.0" - patch -p1 < $DIR/Patches/gcc.patch + patch -p1 < $DIR/Patches/gcc.patch > /dev/null popd + else + echo "Skipped extracting gcc" fi popd -exit - mkdir -p $PREFIX mkdir -p "$DIR/Build/binutils" mkdir -p "$DIR/Build/gcc" pushd "$DIR/Build/" - unset PKG_CONFIG_LIBDIR # Just in case pushd binutils - $DIR/Tarballs/binutils-2.32/configure --target=$TARGET --prefix=$PREFIX --disable-werror || exit 1 + $DIR/Tarballs/binutils-2.32/configure --prefix=$PREFIX \ + --target=$TARGET \ + --with-sysroot=$SYSROOT \ + --disable-nls || exit 1 make -j $(nproc) make install popd pushd gcc - $DIR/Tarballs/gcc-8.3.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c --disable-libssp --without-headers || exit 1 + $DIR/Tarballs/gcc-8.3.0/configure --prefix=$PREFIX \ + --target=$TARGET \ + --with-sysroot=$SYSROOT \ + --enable-languages=c,c++ || exit 1 + make -j $(nproc) all-gcc all-target-libgcc make install-gcc install-target-libgcc popd