[Buildroot] [PATCH 1/1] package/mpir: fix build errors

Bernd Kuhls bernd at kuhls.net
Sun Oct 26 09:02:21 UTC 2025


Added upstream patch to fix configure with gcc-14.

Updated project URL and _SITE due to previous site not being available
anymore: https://github.com/wbhart/mpir/pull/298

The github helper could not be used, for details see
https://patchwork.ozlabs.org/project/buildroot/patch/20250203-repair_mpir-v1-1-db848d68b586@bootlin.com/
In contrast this commit does not bump the package version.

Removed doc build which fails due to missing automake.

Fixes:
https://autobuild.buildroot.net/results/d14/d144ec967b7db34de56eaf34bb436460b8c924ed/

Signed-off-by: Bernd Kuhls <bernd at kuhls.net>
---
 .../mpir/0003-fix-configure-with-gcc-14.patch | 32 +++++++++++++++++++
 package/mpir/Config.in                        |  2 +-
 package/mpir/mpir.hash                        |  2 +-
 package/mpir/mpir.mk                          | 13 ++++++--
 4 files changed, 45 insertions(+), 4 deletions(-)
 create mode 100644 package/mpir/0003-fix-configure-with-gcc-14.patch

diff --git a/package/mpir/0003-fix-configure-with-gcc-14.patch b/package/mpir/0003-fix-configure-with-gcc-14.patch
new file mode 100644
index 0000000000..d3d490750b
--- /dev/null
+++ b/package/mpir/0003-fix-configure-with-gcc-14.patch
@@ -0,0 +1,32 @@
+From 4ff3b770cbf86e29b75d12c13e8b854c74bccc5a Mon Sep 17 00:00:00 2001
+From: Reno Dakota <paparodeo at proton.me>
+Date: Wed, 4 Dec 2024 23:09:03 +0000
+Subject: [PATCH] fix configure with gcc-14
+
+move function definition above caller to fix compile error
+
+> configure:6438: gcc -m64  conftest.c >&5
+> conftest.c: In function 'f':
+> conftest.c:13:44: error: implicit declaration of function 'h' [-Wimplicit-function-declaration]
+
+Upstream: https://github.com/wbhart/mpir/commit/4ff3b770cbf86e29b75d12c13e8b854c74bccc5a
+
+Signed-off-by: Bernd Kuhls <bernd at kuhls.net>
+---
+ acinclude.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 620a629ef..cd917567f 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -590,8 +590,8 @@ extern
+ __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<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
+ void f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
+-for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
+ void h(){} void g(){}
++for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
+ #else
+ int dummy;
+ #endif
diff --git a/package/mpir/Config.in b/package/mpir/Config.in
index da4cc9f44e..b22350b23b 100644
--- a/package/mpir/Config.in
+++ b/package/mpir/Config.in
@@ -5,4 +5,4 @@ config BR2_PACKAGE_MPIR
 	  MPIR is a highly optimised library for bignum arithmetic
 	  forked from the GMP bignum library.
 
-	  http://www.mpir.org/
+	  https://github.com/wbhart/mpir
diff --git a/package/mpir/mpir.hash b/package/mpir/mpir.hash
index 71d0c19d12..3b1b3e877d 100644
--- a/package/mpir/mpir.hash
+++ b/package/mpir/mpir.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256  52f63459cf3f9478859de29e00357f004050ead70b45913f2c2269d9708675bb  mpir-3.0.0.tar.bz2
+sha256  86a5039badc3e6738219a262873a1db5513405e15ece9527b718fcd0fac09bb2  mpir-3.0.0.tar.gz
 sha256  9ccf26cfe845e0eb8bb58053e47366e7ab6b697ae010f7650978d4b71b7d1fc1  COPYING.LIB
diff --git a/package/mpir/mpir.mk b/package/mpir/mpir.mk
index 46cd35e436..eab5233865 100644
--- a/package/mpir/mpir.mk
+++ b/package/mpir/mpir.mk
@@ -5,15 +5,24 @@
 ################################################################################
 
 MPIR_VERSION = 3.0.0
-MPIR_SITE = http://www.mpir.org
-MPIR_SOURCE = mpir-$(MPIR_VERSION).tar.bz2
+MPIR_SITE = https://github.com/wbhart/mpir/archive/refs/tags
 MPIR_LICENSE = LGPL-3.0+
 MPIR_LICENSE_FILES = COPYING.LIB
 MPIR_INSTALL_STAGING = YES
 MPIR_DEPENDENCIES = gmp host-yasm
 # 0002-Fix-configure-failures-with-Xcode12.patch
+# 0003-fix-configure-with-gcc-14.patch
 MPIR_AUTORECONF = YES
 
+# mpir tries to build/install .info doc even if makeinfo isn't installed
+# on the host, so we have to disable global doc installation to prevent
+# autobuild errors.
+define MPIR_DISABLE_DOC_INSTALL
+	$(SED) 's/SUBDIRS += mpn fft mpz mpq mpf printf scanf cxx tune doc/SUBDIRS += mpn fft mpz mpq mpf printf scanf cxx tune/' \
+		$(@D)/Makefile.am
+endef
+MPIR_POST_PATCH_HOOKS += MPIR_DISABLE_DOC_INSTALL
+
 ifeq ($(BR2_MIPS_NABI32),y)
 MPIR_CONF_OPTS += ABI=n32
 endif
-- 
2.47.3



More information about the buildroot mailing list