Skip to contentSkip to conversation

package/mpir: fix build errors

PATCH Applied Bernd Kuhls 2 participants 3 messages Oct 26, 2025 – Feb 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mpir: fix build errors

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/[email protected]/
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/

---
 .../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
package/mpir/0003-fix-configure-with-gcc-14.patch new file +32 -0
new file mode 100644
index 0000000000..d3d490750b
@@ -0,0 +1,32 @@
+From 4ff3b770cbf86e29b75d12c13e8b854c74bccc5a Mon Sep 17 00:00:00 2001
+From: Reno Dakota <[email protected]>
+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 <[email protected]>
+---
+ 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
package/mpir/Config.in +1 -1
index da4cc9f44e..b22350b23b 100644
@@ -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
package/mpir/mpir.hash +1 -1
index 71d0c19d12..3b1b3e877d 100644
@@ -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
package/mpir/mpir.mk +11 -2
index 46cd35e436..eab5233865 100644
@@ -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
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Quoted 1 line · Bernd Kuhls

Added upstream patch to fix configure with gcc-14.

This should have been one commit.

Quoted 2 lines

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

And this should have been another commit, as it's unrelated.

So I've split into two commits.

Quoted 3 lines

The github helper could not be used, for details see
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
In contrast this commit does not bump the package version.

This is not what the comment was saying, and in fact using the github helper works just fine, so I've used that. The trick is that the old tarball was .tar.bz2 while the new one from github is .tar.gz, so there is no conflict.

package/mpir/mpir.mk line 24

Quoted 8 lines
package/mpir/mpir.mk +8 -0
+# 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

This was quite complicated, so I simplified to:

+# We don't care about the documentation
+MPIR_CONF_ENV = MAKEINFO=true

which is the approach we use in a number of packages already when makeinfo gets annoying.

So, applied your change after splitting into two commits, and doing various improvements along the way.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Bernd Kuhls

In reply of:

Quoted 9 lines

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/[email protected]/
In contrast this commit does not bump the package version.

Quoted 6 lines

Removed doc build which fails due to missing automake.

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

Applied to 2025.02.x & 2025.11.x. Thanks

Quoted 103 lines
---
 .../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
package/mpir/0003-fix-configure-with-gcc-14.patch new file +32 -0
new file mode 100644
index 0000000000..d3d490750b
@@ -0,0 +1,32 @@
+From 4ff3b770cbf86e29b75d12c13e8b854c74bccc5a Mon Sep 17 00:00:00 2001
+From: Reno Dakota <[email protected]>
+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 <[email protected]>
+---
+ 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
package/mpir/Config.in +1 -1
index da4cc9f44e..b22350b23b 100644
@@ -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
package/mpir/mpir.hash +1 -1
index 71d0c19d12..3b1b3e877d 100644
@@ -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
package/mpir/mpir.mk +11 -2
index 46cd35e436..eab5233865 100644
@@ -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
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot