From 8a594d098c72e576fc35ba26198ed7f5e6ffb75e Mon Sep 17 00:00:00 2001 From: leo60228 Date: Wed, 29 May 2024 19:20:07 -0400 Subject: [PATCH 1/5] Don't assume bash is at /bin/bash --- libc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/Makefile b/libc/Makefile index d9de489..25e47c0 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -15,7 +15,7 @@ export AR := $(PREFIX)ar export AS := $(PREFIX)as endif -SHELL := /bin/bash -o pipefail +SHELL := bash -o pipefail ASFLAGS := -mcpu=arm7tdmi From c9f7b9ae1ba50f161aa06af55565a34c1811931f Mon Sep 17 00:00:00 2001 From: leo60228 Date: Wed, 29 May 2024 19:31:08 -0400 Subject: [PATCH 2/5] Fix format-security warnings --- gcc/c-typeck.c | 2 +- gcc/real.c | 5 +---- gcc/toplev.c | 2 +- gcc_arm/c-common.c | 6 +++--- gcc_arm/c-typeck.c | 2 +- gcc_arm/cccp.c | 2 +- gcc_arm/real.c | 5 +---- gcc_arm/toplev.c | 2 +- 8 files changed, 10 insertions(+), 16 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 807dfcf..b0bfd9c 100755 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3133,7 +3133,7 @@ build_unary_op (code, xarg, noconvert) return fold (build1 (code, argtype, arg)); } - error (errstring); + error ("%s", errstring); return error_mark_node; } diff --git a/gcc/real.c b/gcc/real.c index 456edda..7943b63 100755 --- a/gcc/real.c +++ b/gcc/real.c @@ -4042,8 +4042,6 @@ mtherr (name, code) char *name; int code; { - char errstr[80]; - /* The string passed by the calling program is supposed to be the name of the function in which the error occurred. The code argument selects which error message string will be printed. */ @@ -4066,9 +4064,8 @@ mtherr (name, code) name = "modulus"; else if (strcmp (name, "esqrt") == 0) name = "square root"; - sprintf (errstr, "%s during real %s", ermsg[code], name); if (extra_warnings) - warning (errstr); + warning ("%s during real %s", ermsg[code], name); /* Set global error message word */ merror = code + 1; } diff --git a/gcc/toplev.c b/gcc/toplev.c index f707c28..ac8e21b 100755 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1061,7 +1061,7 @@ fatal_io_error(char *name) void fatal_insn(char *message, rtx insn) { - error(message); + error("%s", message); debug_rtx(insn); if (asm_out_file) fflush(asm_out_file); diff --git a/gcc_arm/c-common.c b/gcc_arm/c-common.c index 936b609..861b194 100755 --- a/gcc_arm/c-common.c +++ b/gcc_arm/c-common.c @@ -1587,7 +1587,7 @@ check_format_info (info, params) ++format_chars; if (params == 0) { - warning (tfaff); + warning ("%s", tfaff); return; } if (info->first_arg_num != 0) @@ -1630,7 +1630,7 @@ check_format_info (info, params) ++format_chars; if (params == 0) { - warning (tfaff); + warning ("%s", tfaff); return; } cur_param = TREE_VALUE (params); @@ -1825,7 +1825,7 @@ check_format_info (info, params) continue; if (params == 0) { - warning (tfaff); + warning ("%s", tfaff); return; } cur_param = TREE_VALUE (params); diff --git a/gcc_arm/c-typeck.c b/gcc_arm/c-typeck.c index ab3ede7..583793a 100755 --- a/gcc_arm/c-typeck.c +++ b/gcc_arm/c-typeck.c @@ -3147,7 +3147,7 @@ build_unary_op (code, xarg, noconvert) return fold (build1 (code, argtype, arg)); } - error (errstring); + error ("%s", errstring); return error_mark_node; } diff --git a/gcc_arm/cccp.c b/gcc_arm/cccp.c index 76ae613..d95a67c 100755 --- a/gcc_arm/cccp.c +++ b/gcc_arm/cccp.c @@ -8676,7 +8676,7 @@ macroexpand (hp, op) else parse_error = macarg (NULL_PTR, 0); if (parse_error) { - error_with_line (line_for_error (start_line), parse_error); + error_with_line (line_for_error (start_line), "%s", parse_error); break; } i++; diff --git a/gcc_arm/real.c b/gcc_arm/real.c index 7c67f4e..1a187ef 100755 --- a/gcc_arm/real.c +++ b/gcc_arm/real.c @@ -5703,8 +5703,6 @@ mtherr (name, code) char *name; int code; { - char errstr[80]; - /* The string passed by the calling program is supposed to be the name of the function in which the error occurred. The code argument selects which error message string will be printed. */ @@ -5727,9 +5725,8 @@ mtherr (name, code) name = "modulus"; else if (strcmp (name, "esqrt") == 0) name = "square root"; - sprintf (errstr, "%s during real %s", ermsg[code], name); if (extra_warnings) - warning (errstr); + warning ("%s during real %s", ermsg[code], name); /* Set global error message word */ merror = code + 1; } diff --git a/gcc_arm/toplev.c b/gcc_arm/toplev.c index 29833da..c16480e 100755 --- a/gcc_arm/toplev.c +++ b/gcc_arm/toplev.c @@ -1393,7 +1393,7 @@ fatal_insn (message, insn) char *message; rtx insn; { - error (message); + error ("%s", message); debug_rtx (insn); if (asm_out_file) fflush (asm_out_file); From fb68c101fb08022922ebd7206ee9221e65d4c874 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 4 Dec 2024 19:20:06 -0500 Subject: [PATCH 3/5] Add macOS build to workflow --- .github/workflows/build.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index daec929..6ee25b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ env: IS_DEPLOY: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} jobs: - build: + build-linux: runs-on: ubuntu-latest steps: @@ -47,9 +47,24 @@ jobs: name: agbcc.tar.gz path: agbcc.tar.gz + build-macos: + runs-on: macos-latest + steps: + + - name: Checkout + uses: actions/checkout@main + + - name: Install deps + run: | + brew install arm-none-eabi-binutils + brew install arm-none-eabi-gcc + + - name: Compile + run: sh build.sh + deploy: runs-on: ubuntu-latest - needs: build + needs: build-linux if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} permissions: contents: write From 522e2c647c679d8a0558c4b6997aef20f26edd64 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 4 Dec 2024 19:20:14 -0500 Subject: [PATCH 4/5] Fix macOS build --- gcc/Makefile | 2 +- gcc_arm/Makefile.in | 2 +- gcc_arm/configure | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/Makefile b/gcc/Makefile index 9756e90..c34b354 100644 --- a/gcc/Makefile +++ b/gcc/Makefile @@ -24,7 +24,7 @@ VPATH = $(srcdir) CC = gcc -BASE_CFLAGS = -g -std=gnu11 -Werror-implicit-function-declaration +BASE_CFLAGS = -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types INCLUDES = -I. -I$(srcdir) diff --git a/gcc_arm/Makefile.in b/gcc_arm/Makefile.in index 09a8711..10641b8 100755 --- a/gcc_arm/Makefile.in +++ b/gcc_arm/Makefile.in @@ -64,7 +64,7 @@ ALLOCA_FINISH = true XCFLAGS = TCFLAGS = # CYGNUS LOCAL nowarnings/law -CFLAGS = -g -Werror-implicit-function-declaration +CFLAGS = -g -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types BOOT_CFLAGS = -O2 $(CFLAGS) WARN_CFLAGS = # END CYGNUS LOCAL diff --git a/gcc_arm/configure b/gcc_arm/configure index 05c0782..0b7738d 100755 --- a/gcc_arm/configure +++ b/gcc_arm/configure @@ -1138,7 +1138,7 @@ cat > conftest.$ac_ext << EOF #line 1139 "configure" #include "confdefs.h" -main(){return(0);} +int main(){return(0);} EOF if { (eval echo configure:1144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes From 84d56fc8eb9621afca441e38a1d1ff5afe94be84 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 23 May 2025 12:23:04 -0400 Subject: [PATCH 5/5] fix compilation on gcc 14 and 15 --- gcc_arm/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc_arm/Makefile.in b/gcc_arm/Makefile.in index 10641b8..bce80a7 100755 --- a/gcc_arm/Makefile.in +++ b/gcc_arm/Makefile.in @@ -64,7 +64,7 @@ ALLOCA_FINISH = true XCFLAGS = TCFLAGS = # CYGNUS LOCAL nowarnings/law -CFLAGS = -g -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types +CFLAGS = -g -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types -std=gnu11 BOOT_CFLAGS = -O2 $(CFLAGS) WARN_CFLAGS = # END CYGNUS LOCAL