diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 3d570e009c..66fdf91c07 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -662,9 +662,7 @@ build_GMP() { fi # shellcheck disable=SC2086 - # Bug: GMP currently does not support being build by GCC 15 (--std=gnu23) - # Remove CFLAGS once it works again. - CC="$(hostcc host)" CXX="$(hostcxx host)" CFLAGS="-std=gnu17" \ + CC="$(hostcc host)" CXX="$(hostcxx host)" \ ../${GMP_DIR}/configure \ --disable-shared \ --enable-fat \ diff --git a/util/crossgcc/patches/gmp-6.3.0_fix-c23-prototypes.patch b/util/crossgcc/patches/gmp-6.3.0_fix-c23-prototypes.patch new file mode 100644 index 0000000000..4d8105bcfb --- /dev/null +++ b/util/crossgcc/patches/gmp-6.3.0_fix-c23-prototypes.patch @@ -0,0 +1,100 @@ +Resolves compilation errors with GCC 15+ in C23 mode by: +. Adding explicit function prototypes for `g()` +. Modernizing K&R-style function declarations +. Fixing void parameter signatures +--- gmp-6.3.0/configure ++++ gmp-6.3.0/configure +@@ -6567,13 +6567,39 @@ + 1666 to segfault with e.g., -O2 -mpowerpc64. */ + + #if defined (__GNUC__) && ! defined (__cplusplus) +-typedef unsigned long long t1;typedef t1*t2; +-void g(){} +-void h(){} +-static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) +-{t1 c,x,r;int i;if(v0){c=1;for(i=1;i