From bbd88e85671f77bae8734d1870da24019dfd2714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Fri, 2 Feb 2018 07:37:23 +0100 Subject: [PATCH] Some commenting and cleanup --- toolchain/build-toolchain.sh | 10 ++++++++++ toolchain/emul | 2 +- toolchain/gdb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/toolchain/build-toolchain.sh b/toolchain/build-toolchain.sh index 14fa0ab..6e5b898 100755 --- a/toolchain/build-toolchain.sh +++ b/toolchain/build-toolchain.sh @@ -1,19 +1,27 @@ #!/bin/sh -e +# Tools and libraries required to build binutils and gcc apk --update add build-base apk add gmp-dev mpfr-dev mpc1-dev +# For making a bootable iso apk add grub-bios xorriso +# For debugging apk add gdb valgrind +# We need a later version of qemu than included in the default repo +# due to a bug in the qemu gdb server apk --update add qemu-system-x86_64 --repository http://dl-cdn.alpinelinux.org/alpine/v3.7/main rm -rf /var/cache/apk/* +# For now we'll use the default x86_64-elf target target=x86_64-elf binutils=binutils-2.29 gcc=gcc-7.2.0 +# Configure, make and install binutils +# configured for our target cd /opt wget http://ftp.gnu.org/gnu/binutils/${binutils}.tar.gz tar -xf ${binutils}.tar.gz @@ -27,6 +35,7 @@ mkdir binutils-build && cd binutils-build make -j 4 make install +# Configure, make and install gcc and libgcc cd /opt wget http://ftp.gnu.org/gnu/gcc/${gcc}/${gcc}.tar.gz tar -xf ${gcc}.tar.gz @@ -41,4 +50,5 @@ make all-gcc all-target-libgcc -j 4 make install-gcc install-target-libgcc cd / +# Remove apk cache rm -rf /opt diff --git a/toolchain/emul b/toolchain/emul index 5932943..9ceefd6 100755 --- a/toolchain/emul +++ b/toolchain/emul @@ -6,4 +6,4 @@ iso=${BUILDROOT}mittos64.iso ${BUILDROOT}toolchain/mkiso -qemu-system-x86_64 -s -S -cdrom ${iso} -curses +qemu-system-x86_64 -s -S -cdrom ${iso} $@ diff --git a/toolchain/gdb b/toolchain/gdb index bc1b3e3..9548280 100755 --- a/toolchain/gdb +++ b/toolchain/gdb @@ -2,4 +2,4 @@ if [ -z ${MITTOS64+x} ]; then >&2 echo "Unsupported environment! See README"; exit 1; fi -/usr/bin/gdb -q -x ${BUILDROOT}toolchain/gdbinit -se ${BUILDROOT}sysroot/kernel +/usr/bin/gdb -q -x ${BUILDROOT}toolchain/gdbinit -se ${BUILDROOT}sysroot/kernel $@