From 3a31b19fadd53288872abfb8cace2bbd1996e2e3 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 24 Jun 2022 13:14:50 -0300 Subject: [PATCH 1/5] Fix parallel builds --- build.sh | 19 +++++++------------ gcc/Makefile | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/build.sh b/build.sh index a1671fd..04f579b 100755 --- a/build.sh +++ b/build.sh @@ -3,27 +3,22 @@ set -e CCOPT= CXXOPT= -# error if devkitarm is not installed and binutils-arm-none-eabi is not installed -if ! ([ -n "$DEVKITARM" ] && [ -d "$DEVKITARM/bin" ]) && ! (command -v arm-none-eabi-as &> /dev/null && command -v arm-none-eabi-ar &> /dev/null) ; then - echo "Could not find a binutils installation! Re-read the instructions and make sure you've installed either devkitARM or binutils-arm-none-eabi, depending on your system." - exit 1 -fi - if [ ! -z "$CC" ]; then CCOPT=CC=$CC; fi if [ ! -z "$CXX" ]; then CXXOPT=CXX=$CXX; fi make -C gcc clean -make -C gcc old $CCOPT $CXXOPT +make -C gcc -j$(nproc) old $CCOPT $CXXOPT mv gcc/old_agbcc . make -C gcc clean -make -C gcc $CCOPT $CXXOPT +make -C gcc -j$(nproc) normal $CCOPT $CXXOPT mv gcc/agbcc . # not sure if the ARM compiler is the old one or the new one (-DOLD_COMPILER) -rm -f gcc_arm/config.status gcc_arm/config.cache -cd gcc_arm && ./configure --target=arm-elf --host=i386-linux-gnu && make cc1 && cd .. +make -C gcc_arm distclean +cd gcc_arm && ./configure --target=arm-elf --host=i386-linux-gnu && cd .. +make -C gcc_arm -j$(nproc) cc1 mv gcc_arm/cc1 agbcc_arm make -C libgcc clean -make -C libgcc $CCOPT $CXXOPT +make -C libgcc -j$(nproc) $CCOPT $CXXOPT mv libgcc/libgcc.a . make -C libc clean -make -C libc $CCOPT $CXXOPT +make -C libc -j$(nproc) $CCOPT $CXXOPT mv libc/libc.a . diff --git a/gcc/Makefile b/gcc/Makefile index 9756e90..bcafcc4 100644 --- a/gcc/Makefile +++ b/gcc/Makefile @@ -81,7 +81,7 @@ $(OBJS): %.o: %.c $(DEPDIR)/%.d | $(GENERATED) $(COMPILE) $< $(POSTCOMPILE) -$(RTL_OBJS) $(RTLANAL_OBJS) $(PRINT_OBJS): %.o: %.c $(DEPDIR)/%.d +$(RTL_OBJS) $(RTLANAL_OBJS) $(PRINT_OBJS): %.o: %.c $(DEPDIR)/%.d genrtl.h $(COMPILE) $< $(POSTCOMPILE) From adf4f287744bcc48cbc25bf3eb2a553f6cf08623 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 24 Jun 2022 13:15:56 -0300 Subject: [PATCH 2/5] restore devkitarm warning --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index 04f579b..84ddc74 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,12 @@ set -e CCOPT= CXXOPT= +# error if devkitarm is not installed and binutils-arm-none-eabi is not installed +if ! ([ -n "$DEVKITARM" ] && [ -d "$DEVKITARM/bin" ]) && ! (command -v arm-none-eabi-as &> /dev/null && command -v arm-none-eabi-ar &> /dev/null) ; then + echo "Could not find a binutils installation! Re-read the instructions and make sure you've installed either devkitARM or binutils-arm-none-eabi, depending on your system." + exit 1 +fi + if [ ! -z "$CC" ]; then CCOPT=CC=$CC; fi if [ ! -z "$CXX" ]; then CXXOPT=CXX=$CXX; fi make -C gcc clean From 497536cf5ac3f08446aae180b4bd9e653bf85b62 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 24 Jun 2022 14:09:02 -0300 Subject: [PATCH 3/5] Update build.sh --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 84ddc74..2c11fe3 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,8 @@ make -C gcc clean make -C gcc -j$(nproc) normal $CCOPT $CXXOPT mv gcc/agbcc . # not sure if the ARM compiler is the old one or the new one (-DOLD_COMPILER) -make -C gcc_arm distclean +# || true is needed to keep going if the distclean fails, such as when no configure has been done before +make -C gcc_arm distclean || true cd gcc_arm && ./configure --target=arm-elf --host=i386-linux-gnu && cd .. make -C gcc_arm -j$(nproc) cc1 mv gcc_arm/cc1 agbcc_arm From 06974527f28a9d8ac2b4dd85b155c4a850cfd914 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 24 Jun 2022 22:37:50 -0300 Subject: [PATCH 4/5] remove nproc to preserve compat with Mac --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 2c11fe3..b6755fe 100755 --- a/build.sh +++ b/build.sh @@ -21,7 +21,7 @@ mv gcc/agbcc . # || true is needed to keep going if the distclean fails, such as when no configure has been done before make -C gcc_arm distclean || true cd gcc_arm && ./configure --target=arm-elf --host=i386-linux-gnu && cd .. -make -C gcc_arm -j$(nproc) cc1 +make -C gcc_arm cc1 mv gcc_arm/cc1 agbcc_arm make -C libgcc clean make -C libgcc -j$(nproc) $CCOPT $CXXOPT From fbd5d88e46c8883f474f6fa0acf14fae9fb0ea86 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 1 Jul 2022 15:21:01 -0300 Subject: [PATCH 5/5] Remove nproc Because nproc can cause builds to stop entirely under operating systems that don't have it --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index b6755fe..5703287 100755 --- a/build.sh +++ b/build.sh @@ -12,10 +12,10 @@ fi if [ ! -z "$CC" ]; then CCOPT=CC=$CC; fi if [ ! -z "$CXX" ]; then CXXOPT=CXX=$CXX; fi make -C gcc clean -make -C gcc -j$(nproc) old $CCOPT $CXXOPT +make -C gcc old $CCOPT $CXXOPT mv gcc/old_agbcc . make -C gcc clean -make -C gcc -j$(nproc) normal $CCOPT $CXXOPT +make -C gcc normal $CCOPT $CXXOPT mv gcc/agbcc . # not sure if the ARM compiler is the old one or the new one (-DOLD_COMPILER) # || true is needed to keep going if the distclean fails, such as when no configure has been done before @@ -24,8 +24,8 @@ cd gcc_arm && ./configure --target=arm-elf --host=i386-linux-gnu && cd .. make -C gcc_arm cc1 mv gcc_arm/cc1 agbcc_arm make -C libgcc clean -make -C libgcc -j$(nproc) $CCOPT $CXXOPT +make -C libgcc $CCOPT $CXXOPT mv libgcc/libgcc.a . make -C libc clean -make -C libc -j$(nproc) $CCOPT $CXXOPT +make -C libc $CCOPT $CXXOPT mv libc/libc.a .