From de79473b91557d65dde4d96e0a73c46476f867bc Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 31 Aug 2022 11:37:23 +0200 Subject: update bootstrap.sh --- .gitignore | 1 + Makefile | 1 + bootstrap/bootstrap.sh | 19 ++++++++++++++++--- bootstrap/cff2 | Bin 0 -> 469728 bytes 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 bootstrap/cff2 diff --git a/.gitignore b/.gitignore index 00d79aa..c3d55cd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ a.out .cache/ src/host-target-triple.cff vgcore.* +cffc build/ diff --git a/Makefile b/Makefile index d6551b3..fd554ae 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ clean: $(RM) -r build/ src/host-target-triple.cff $(OUT): $(OBJ) + $(CC) -o$(OUT) $(OBJ) src/libc-.c src/host-target-triple.cff: echo "extern static host_target_triple const *const u8 = \"`clang -print-target-triple`\";" > $@ diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh index 64b7186..4a45470 100755 --- a/bootstrap/bootstrap.sh +++ b/bootstrap/bootstrap.sh @@ -10,6 +10,9 @@ if command -v ccache > /dev/null; then export CC="ccache $CC" fi +echo '==========================================' +echo '=== Building bootstrap compiler (cff0) ===' +echo '==========================================' ./build.sh || exit 1 export CFLAGS="-Wno-builtin-declaration-mismatch -Wno-discarded-qualifiers -g" @@ -18,6 +21,9 @@ set -euo pipefail echo "extern static host_target_triple const *const u8 = \"`clang -print-target-triple`\";" > ../src/host-target-triple.cff +echo '=====================================================================' +echo '=== Building self-hosted compiler using bootstrap compiler (cff1) ===' +echo '=====================================================================' mkdir -p obj1/ for f in $(find ../src/ -name '*.cff'); do out=obj1/$(basename "$f").o @@ -27,7 +33,14 @@ for f in $(find ../src/ -name '*.c'); do out=obj1/$(basename "$f").o (set -x ; $CC $CFLAGS "$f" -c -o $out) done -set -x -$CC $CFLAGS -ocff1 obj1/*.o +:$(set -x ; $CC $CFLAGS -ocff1 obj1/*.o) -CFFC=$(dirname "$0")/cff1 make -C ../ +echo '=======================================================================' +echo '=== Building self-hosted compiler using self-hosted compiler (cff2) ===' +echo '=======================================================================' +OUT=bootstrap/cff2 CFFC=$(dirname "$0")/cff1 make -C ../ + +echo '===============================================================================' +echo '=== Building self-hosted compiler using self-hosted compiler squared (cffc) ===' +echo '===============================================================================' +CFFC=$(dirname "$0")/cff2 make -C ../ clean all diff --git a/bootstrap/cff2 b/bootstrap/cff2 new file mode 100755 index 0000000..2de32e6 Binary files /dev/null and b/bootstrap/cff2 differ -- cgit v1.2.3