From 31569bcc1b0762636d704baad0b35fc37aedb386 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Mon, 5 May 2025 21:08:32 +0200 Subject: [PATCH] package/gmp: add patch to fix build with gcc-15 When using host gcc 15, host-gmp fails at configure time with error message: configure: error: could not find a working compiler, see config.log for details The error is due to the macro GMP_PROG_CC_WORKS in the file acinclude.m4 containing C-code declaring functions without declaring its parameters. This construct is now an error in C23, which is the new default in gcc 15. See: https://gcc.gnu.org/gcc-15/porting_to.html#c23 This commit fixes the issue by adding a package patch from upstream changesets, not yet published in a release. Even if gcc 15 is not yet included in Buildroot, this commit also sets _AUTORECONF = YES for the target package in order to have this package already fixed. Fixes: https://autobuild.buildroot.org/results/623634fa7bbeceeb6d90b15ce0abb1b9b4b24045/ Tested-by: Brigham Campbell Signed-off-by: Julien Olivain --- ...n-prototype-in-acinclude.m4-for-C23-.patch | 51 +++++++++++++++++++ package/gmp/gmp.mk | 4 ++ 2 files changed, 55 insertions(+) create mode 100644 package/gmp/0001-Complete-function-prototype-in-acinclude.m4-for-C23-.patch diff --git a/package/gmp/0001-Complete-function-prototype-in-acinclude.m4-for-C23-.patch b/package/gmp/0001-Complete-function-prototype-in-acinclude.m4-for-C23-.patch new file mode 100644 index 0000000000..129a4a88e0 --- /dev/null +++ b/package/gmp/0001-Complete-function-prototype-in-acinclude.m4-for-C23-.patch @@ -0,0 +1,51 @@ +From 9cd0c36d0110191a5f42e268d7bd21a95a2aa883 Mon Sep 17 00:00:00 2001 +From: Marc Glisse +Date: Wed, 29 Jan 2025 22:38:02 +0100 +Subject: [PATCH] Complete function prototype in acinclude.m4 for C23 + compatibility + +Add parameter names to function prototype + +Upstream: https://gmplib.org/repo/gmp/rev/d66d66d82dbb +Upstream: https://gmplib.org/repo/gmp/rev/8e7bb4ae7a18 +Signed-off-by: Marc Glisse +[Julien: git patch adapted from two upstream mercurial changesets] +Signed-off-by: Julien Olivain +--- + ChangeLog | 9 +++++++++ + acinclude.m4 | 2 +- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 2902cd2..d808a8b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,12 @@ ++2025-03-15 Khem Raj ++ ++ * acinclude.m4: Add parameter names to function prototype. ++ ++2025-01-29 Rudi Heitbaum ++ Marc Glisse ++ ++ * acinclude.m4: Complete function prototype. ++ + 2023-07-29 Torbjörn Granlund + + * Version 6.3.0 released. +diff --git a/acinclude.m4 b/acinclude.m4 +index 9cf9483..b79a431 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1], + + #if defined (__GNUC__) && ! defined (__cplusplus) + typedef unsigned long long t1;typedef t1*t2; +-void g(){} ++void g(int a,t1 const*b,t1 c,t2 d,t1 const*e,int f){} + 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