Skip to content

Commit

Permalink
Toolchain: GCC and binutils are now configure correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax authored and awesomekling committed Apr 29, 2019
1 parent 4b05ec9 commit be11004
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
Root
Toolchain/Tarballs
Toolchain/Build
.vscode
31 changes: 24 additions & 7 deletions Toolchain/BuildIt.sh
Original file line number Diff line number Diff line change
@@ -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:https://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:https://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
Expand Down

0 comments on commit be11004

Please sign in to comment.