Try to support gcc 15 in our GMP dependency

This commit is contained in:
Duke
2025-12-29 21:26:55 -05:00
parent 5fdcf49b26
commit be036e7013
2 changed files with 36 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package=libgmp
ifeq ($(host_os),mingw32)
$(package)_download_path=https://github.com/radix42/$(package)/archive
$(package)_file_name=$(package)-$($(package)_git_commit).tar.gz
@@ -16,6 +17,7 @@ $(package)_file_name=d613c855-cd92-4efb-b893-658496852019
$(package)_download_file=d613c855-cd92-4efb-b893-658496852019
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
$(package)_config_opts=--enable-cxx --disable-shared
$(package)_patches=gcc-15.patch
endif
#else
@@ -27,6 +29,10 @@ endif
#$(package)_config_opts=--enable-cxx --disable-shared
#endif
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/gcc-15.patch
endef
define $(package)_config_cmds
$($(package)_autoconf) --host=$(host) --build=$(build)
endef

View File

@@ -0,0 +1,30 @@
diff --git a/acinclude.m4 b/acinclude.m4
index bcc6f52..53705e1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -602,24 +602,6 @@ int f ()
}
])
-GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
-[/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
- Extracted from tests/mpn/t-iord_u.c. Causes Apple's gcc 3.3 build 1640 and
- 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<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();}}
-#else
-int dummy;
-#endif
-])
-
GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 2],
[/* The following provokes an internal compiler error on powerpc-apple-darwin.
Extracted from mpz/cfdiv_q_2exp.c. Causes Apple's gcc 3.3 build 1640 and