diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 565304cd..436f879f 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -19,7 +19,7 @@ jobs: with: python-version: '3.13' - - uses: msys2/setup-msys2@v2.27.0 + - uses: msys2/setup-msys2@v2.28.0 with: msystem: mingw64 # path-type inherit is used so that when cibuildwheel calls msys2 to diff --git a/bin/build_dependencies_unix.sh b/bin/build_dependencies_unix.sh index ed1156c7..eb0dae5c 100755 --- a/bin/build_dependencies_unix.sh +++ b/bin/build_dependencies_unix.sh @@ -42,6 +42,7 @@ do echo " --gmp gmp - build based on GMP (default)" echo " --gmp mpir - build based on MPIR (no longer works)" echo " --patch-gmp-arm64 - apply patch to GMP 6.2.1 for OSX arm64" + echo " --patch-C23 - apply patch to GMP 6.3.0 for C23 compatibility" echo " --arb - build Arb (only needed for flint < 3.0.0)" echo exit @@ -88,6 +89,11 @@ do PATCH_GMP_ARM64=yes shift ;; + --patch-C23) + # Patch GMP 6.3.0 for newer gcc versions + PATCH_GMP_C23=yes + shift + ;; --use-gmp-github-mirror) USE_GMP_GITHUB_MIRROR=yes shift @@ -164,6 +170,20 @@ if [ $USE_GMP = "gmp" ]; then echo -------------------------------------------- patch -N -Z -p0 < ../../../bin/patch-arm64.diff fi + # + # https://github.com/msys2/MSYS2-packages/issues/5499 + # + # This patch needed for GMP 6.3.0 building with msys2 or probably just + # newer gcc versions. + # + if [ $PATCH_GMP_C23 = "yes" ]; then + echo + echo -------------------------------------------- + echo " patching GMP" + echo -------------------------------------------- + patch -N -Z < ../../../bin/patch-C23.diff + autoreconf -fi + fi # Show the output of configfsf.guess chmod +x configfsf.guess diff --git a/bin/cibw_before_all_windows.sh b/bin/cibw_before_all_windows.sh index c86dc634..1f0b0dae 100755 --- a/bin/cibw_before_all_windows.sh +++ b/bin/cibw_before_all_windows.sh @@ -31,4 +31,7 @@ pacman -S --noconfirm \ # # This is slow with MinGW: -bin/build_dependencies_unix.sh --use-gmp-github-mirror +bin/build_dependencies_unix.sh \ + --use-gmp-github-mirror\ + --patch-C23\ + # diff --git a/bin/patch-C23.diff b/bin/patch-C23.diff new file mode 100644 index 00000000..5f1c0214 --- /dev/null +++ b/bin/patch-C23.diff @@ -0,0 +1,21 @@ +# HG changeset patch +# User Marc Glisse +# Date 1738186682 -3600 +# Node ID 8e7bb4ae7a18b1405ea7f9cbcda450b7d920a901 +# Parent e84c5c785bbe8ed8c3620194e50b65adfc2f5d83 +Complete function prototype in acinclude.m4 for C23 compatibility + +diff -r e84c5c785bbe -r 8e7bb4ae7a18 acinclude.m4 +--- a/acinclude.m4 Wed Dec 04 18:26:27 2024 +0100 ++++ b/acinclude.m4 Wed Jan 29 22:38:02 2025 +0100 +@@ -609,7 +609,7 @@ + + #if defined (__GNUC__) && ! defined (__cplusplus) + typedef unsigned long long t1;typedef t1*t2; +-void g(){} ++void g(int,t1 const*,t1,t2,t1 const*,int){} + 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>> print(arb("3.0")) 3.00000000000000 - >>> print(arb("0.1")) # doctest: +SKIP + >>> print(arb("0.1")) # doctest: +SKIP [0.100000000000000 +/- 2.23e-17] >>> print(arb("1/10")) # doctest: +SKIP [0.100000000000000 +/- 2.23e-17]