Skip to content

Commit 575619f

Browse files
committed
Port the mingw shared-build machinery: MSYS2 0009/0010 + the dynload_win cluster (0011-0015) + 0018 + 0034 + 0066 + 0039; the smoke leg goes --enable-shared
The wall (tebako-runtime-python PR #16, run 34735362057, leg windows/3.14.7): the full factory build reaches the extension modules and dies linking Modules/array.cpython-314.so — undefined references to PyExc_EOFError/_Py_Dealloc/PyUnicode_* and the rest of the core API. On PE/Windows a loadable module cannot carry undefined symbols at link time, and statically embedding the core per-extension breaks interpreter-state identity — the --disable-shared + .so extensions shape is impossible by construction on Windows. The intended shape is --enable-shared (the factory's PythonVersion#msys_dll_name and upload_release dll-facet path were written for it; the ruby factory ships that way). Eight MSYS2 MINGW-packages ports close it, inserted in series order: - 0009 -> exports_declspec_msys (verbatim): HAVE_DECLSPEC_DLL on __MINGW32__ + the cygwin arms (auto-import functions, dllimport data, exported PyMODINIT_FUNC). Without it the core exports nothing in the MSVC style and the import library binds no API surface. Inert for the static build: the special-linkage block still gates on defined(Py_ENABLE_SHARED) || defined(__CYGWIN__). - 0010 -> configure_shared_mingw_msys, with ONE hunk elided (the closing LIBS hunk — one carrier for -lversion/-lshlwapi/-lpathcch/ -lbcrypt, the syslibs deviation's post-MODLIBS SYSLIBS position; a pre-MODLIBS LIBS copy of -lbcrypt would not resolve libcrypto's static refs). The ported hunks: the enable_shared MINGW arms (LDLIBRARY=libpython$(LDVERSION).dll.a, DLLLIBRARY= libpython$(LDVERSION).dll — the factory's msys_dll_name —, BLDLIBRARY=-L. -lpython$(LDVERSION)), the static LDLIBRARY=.a arm, LDSHARED/LDCXXSHARED=$(CC) -shared -Wl,--enable-auto-image-base, and LIBPYTHON/MODULE_DEPS_SHARED for win32 — what puts $(BLDLIBRARY) on every stdlib extension link and $(LDLIBRARY) on its dependency list. The 0009+0010 cross proof then exposed the wall cascade; each further port is forced by named evidence (local cross build, x86_64-w64-mingw32-gcc 14 on macOS, configure --host= x86_64-w64-mingw32 --enable-shared): 1. The libpython3.14.dll link died: Modules/getpath.o references PyWin_DLLhModule (Modules/getpath.c:811-816, compiled only under Py_ENABLE_SHARED && MS_WINDOWS — the static tree never misses it), and upstream defines the symbol only in PC/dl_nt.c, which the autoconf build never compiles. 0012 (dynload_win_msys, verbatim) cures it: DYNLOADFILE=dynload_win.o plus PC/dl_nt.o in extra_machdep_objs. The loader switch is itself forced — base mingw has no dlopen (configure falls to dynload_stub.o = a shared build that cannot load anything; the v0.3.2 skip note's "ucrt64 has dlfcn" was wrong). 2. 0012 drags its coherence cluster, previously deferred as interop naming: the dynload_win.o compile rule passes -DPYD_PLATFORM_TAG='"$(PYD_PLATFORM_TAG)"' (0011), and dynload_win's import filetab is .pyd-based (Include/internal/pycore_importdl.h, upstream), so the build-time suffix must agree — 0013 (SHLIB_SUFFIX=.pyd + the import-lib install rule) and 0014 (mingw SOABI=cp<ver><thread>- <PYD_PLATFORM_TAG>, EXT_SUFFIX=.<SOABI>.pyd). Observable rename: windows-msys extension modules change spelling from .cpython-314.so to .cp314-mingw_x86_64_ucrt_gnu.pyd. And dl_nt.c's PyWin_DLLVersionString = MS_DLL_ID needs 0015's definition (MS_DLL_ID via CFLAGS_NODIST; upstream defines it only in the MSVC pyconfig). 3. dynload_win.c then failed to COMPILE: its static _Py_CheckPython3 collides with pylifecycle.h's external declaration under MS_WINDOWS. 0066 (verbatim) drops the declaration; no other caller exists. 4. python.exe then failed to link: Programs/python.c provides wmain under MS_WINDOWS, and linking wmain needs -municode — without it the mingw CRT pulls the WinMain startup (crtexewin) and dies (crtexewin.c:62: undefined reference to `WinMain'). 0039 (one anchor elided — its closing configure.ac hunk rides on 0010's elided LIBS case; the FIELD3/RCFLAGS additions apply verbatim in a fresh mingw case at the same spot) rewrites the interpreter link with -municode + the python_exe.o version/icon resource, adds pythonw.exe (-municode -mwindows, the GUI variant every windows install ships), the DLL's python_nt.o version resource, the windres/RCFLAGS configure machinery, and the altbininstall python3w.exe lines. This PR's own CI then exposed the next wall (run 34741183330, leg smoke 3.14.7 (windows-msys)): with the link shape fixed, every make target died at frozen-module regen — ModuleNotFoundError: No module named 'winreg' / Fatal Python error: _PyImport_InitExternal: external importer setup failed (Makefile:1957/1960, frozen_modules/abc.h, codecs.h). Root cause: Lib/importlib/_bootstrap_external.py:36 imports winreg at module top level whenever sys.platform == 'win32', and the autoconf build never builds winreg (upstream compiles it MSVC-only via PCbuild) — so EVERY mingw interpreter boot dies in import setup, _bootstrap_python included. 0018 (winreg_modules_msys, verbatim + regen) cures it: winreg/msvcrt/_winapi become bootstrap-static modules (Setup.bootstrap.in + PY_STDLIB_MOD), winsound gains -lwinmm and _overlapped -lws2_32 (Setup.stdlib.in), crtdbg.h is debug-gated in _winapi.c/msvcrtmodule.c, and dynamic_annotations.c's _MSC_VER guard becomes MS_WINDOWS. The second CI leg then moved one step deeper (run 34742370411, job 103684133612): with winreg in place the interpreter boots past _PyImport_InitExternal and dies at Lib/site.py:330 — _get_path's win32 branch (sys.platform == 'win32' via configure_machdep_msys) reads sys.winver -> AttributeError: module 'sys' has no attribute 'winver' (Makefile:1964/1967, the same frozen-headers regen). Upstream sysmodule.c installs winver/dllhandle only under MS_COREDLL, an MSVC-project-only macro (PC/pyconfig.h) the autotools build never defines — while the definitions it guards DO exist in this link (0012 compiles PC/dl_nt.o, 0015 defines MS_DLL_ID). 0034 (sysmodule_coredll_msys — the transformation verbatim, the hunks re-authored against 3.14.7: the upstream hunk-3 context rides MSYS2's own 0003 sys._is_mingw_ucrt patch, which this series does not carry) makes the guard defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED); in the static shape the guard stays false (static behavior unchanged), POSIX untouched, no configure.ac change so no regen. Deliberately skipped from the cluster's neighborhood (recorded in the PR body): 0067 (PYTHONLEGACYWINDOWSDLLLOADING — uninstalled-tree test convenience; its mingw_smoketests.py hunk targets an MSYS2-CI-local file), 0068 (GetPythonImport libpython-name port — without it the wrong-python-version guard is inert, not broken: the .pyd imports libpython3.14.dll, which never matches the MSVC "python" prefix), 0069 (backslash normalization — its precondition is MSYS2-fork forward-slash path handling this series does not carry), 0070 (suppress the python3.dll preload under mingw — with PY3_DLLNAME= libpython3.14.dll the preload resolves to the already-loaded core DLL, a harmless no-op; its hunk context also rides on the skipped 0067). tools/compile_smoke follows the factory's new linkage shape (the coverage contract — the smoke IS the factory's shape): the windows-msys leg configures --enable-shared and gains the one LINK regression target — Modules/array$(EXT_SUFFIX), the exact run-34735362057 casualty, never probed, EXT_SUFFIX read off the generated Makefile (it now resolves to the .pyd spelling). The POSIX leg is untouched (pristine tree, upstream's static default, 12 wall TUs). Verified locally (macOS + homebrew mingw-w64 gcc 14; the native ucrt64 build is CI's oracle): the 35-patch series applies clean to pristine 3.14.7 (tools/lint) — the 34-patch prefix reproduces the reference tree byte-for-byte, and 0034's only target (Python/sysmodule.c) is touched by no other entry; shipped configure/pyconfig.h.in equal the pinned autoconf 2.72 regen exactly; rspec 103/0; validate_manifests OK; the POSIX smoke leg compiles all 12 wall TUs on the pristine tree. Cross proof: configure yields the MSYS2 spellings (LDLIBRARY= libpython3.14.dll.a, DLLLIBRARY=libpython3.14.dll, DYNLOADFILE= dynload_win.o, MACHDEP_OBJS=PC/dl_nt.o, SHLIB_SUFFIX=.pyd, EXT_SUFFIX=.cp314-mingw_x86_64_ucrt_gnu.pyd, PY_ENABLE_SHARED=1); the build links libpython3.14.dll (38 MB), python.exe, pythonw.exe, and Modules/array.cp314-mingw_x86_64_ucrt_gnu.pyd — the run-34735362057 casualty under its new name; the DLL export table carries PyExc_EOFError/_Py_Dealloc/PyUnicode_FromString (the wall's undefined symbols) among 3678 exports; the .pyd imports libpython3.14.dll; the DLL's own imports add libgcc_s_seh-1.dll and libwinpthread-1.dll — the two mingw runtime DLLs the factory's windows layout must stage beside the exe. The 0018 shape: winreg/msvcrt/ _winapi compile into the core archive (PC/winreg.o, PC/msvcrtmodule.o, Modules/_winapi.o), the generated Modules/config.c registers all three in _PyImport_Inittab, and PyInit_winreg exports from the DLL. The 0034 shape: Python/sysmodule.o compiles for the target and the python.exe link still closes. Both boot-time fixes are provable only at run time — the CI smoke leg is the oracle.
1 parent 0fb8cd8 commit 575619f

30 files changed

Lines changed: 1901 additions & 185 deletions

patches/3.14/bootstrap_python_link_flags_msys.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# rides along from the proven patch (GUI subsystem: no console window for
1414
# the build-time tool).
1515
diff --git a/Makefile.pre.in b/Makefile.pre.in
16-
index a4c738b..f1b346d 100644
16+
index 0c117a0..22553b4 100644
1717
--- a/Makefile.pre.in
1818
+++ b/Makefile.pre.in
19-
@@ -1681,7 +1681,7 @@ BOOTSTRAP_HEADERS = \
19+
@@ -1697,7 +1697,7 @@ BOOTSTRAP_HEADERS = \
2020
Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) $(PYTHON_HEADERS)
2121

2222
_bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local

patches/3.14/configure_c_locale_coercion_msys.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
# (named opt-in, not a silent removal).
2222

2323
diff --git a/configure b/configure
24-
index 730c719..26e35e9 100755
24+
index 0e6b6f3..ae84cd8 100755
2525
--- a/configure
2626
+++ b/configure
27-
@@ -1934,7 +1934,7 @@ Optional Packages:
27+
@@ -1948,7 +1948,7 @@ Optional Packages:
2828
--with-pymalloc enable specialized mallocs (default is yes)
2929
--with-c-locale-coercion
3030
enable C locale coercion to a UTF-8 based locale
@@ -33,7 +33,7 @@ index 730c719..26e35e9 100755
3333
--with-valgrind enable Valgrind support (default is no)
3434
--with-dtrace enable DTrace support (default is no)
3535
--with-libm=STRING override libm math library to STRING (default is
36-
@@ -19527,7 +19527,10 @@ fi
36+
@@ -19663,7 +19663,10 @@ fi
3737

3838
if test -z "$with_c_locale_coercion"
3939
then
@@ -46,10 +46,10 @@ index 730c719..26e35e9 100755
4646
if test "$with_c_locale_coercion" != "no"
4747
then
4848
diff --git a/configure.ac b/configure.ac
49-
index e1ae5b8..dd093fa 100644
49+
index 603ab94..e9c187a 100644
5050
--- a/configure.ac
5151
+++ b/configure.ac
52-
@@ -5258,11 +5258,14 @@ AC_MSG_RESULT([$with_pymalloc])
52+
@@ -5277,11 +5277,14 @@ AC_MSG_RESULT([$with_pymalloc])
5353
AC_MSG_CHECKING([for --with-c-locale-coercion])
5454
AC_ARG_WITH(
5555
[c-locale-coercion],

patches/3.14/configure_disable_posix_modules_msys.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
# Setup.local *disabled* list overlaps deliberately (readline &co.);
1616
# this patch covers the ones it does not name.
1717
diff --git a/configure b/configure
18-
index efadbf5..6dac703 100755
18+
index d3e9f1c..b31373c 100755
1919
--- a/configure
2020
+++ b/configure
21-
@@ -32340,6 +32340,23 @@ case $ac_sys_system in #(
21+
@@ -32664,6 +32664,23 @@ case $ac_sys_system in #(
2222

2323
py_cv_module__scproxy=n/a
2424
;; #(
@@ -43,10 +43,10 @@ index efadbf5..6dac703 100755
4343

4444

4545
diff --git a/configure.ac b/configure.ac
46-
index 43c1417..d47bcda 100644
46+
index 95cb4a2..39b04e7 100644
4747
--- a/configure.ac
4848
+++ b/configure.ac
49-
@@ -8112,6 +8112,20 @@ AS_CASE([$ac_sys_system],
49+
@@ -8255,6 +8255,20 @@ AS_CASE([$ac_sys_system],
5050
)
5151
],
5252
[CYGWIN*], [PY_STDLIB_MOD_SET_NA([_scproxy])],

patches/3.14/configure_exeext_msys.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# Makefile (PythonBuild#exe_path); the patch pins EXEEXT=.exe and
1414
# BUILDEXEEXT=.exe for MINGW so the artifact name is probe-independent.
1515
diff --git a/configure b/configure
16-
index a621d6a..efadbf5 100755
16+
index ad023c7..d3e9f1c 100755
1717
--- a/configure
1818
+++ b/configure
19-
@@ -7510,6 +7510,8 @@ else case e in #(
19+
@@ -7524,6 +7524,8 @@ else case e in #(
2020
EXEEXT=.mjs ;; #(
2121
WASI) :
2222
EXEEXT=.wasm ;; #(
@@ -25,7 +25,7 @@ index a621d6a..efadbf5 100755
2525
*) :
2626
EXEEXT=
2727
;;
28-
@@ -7545,6 +7547,14 @@ printf "%s\n" "no" >&6; }
28+
@@ -7559,6 +7561,14 @@ printf "%s\n" "no" >&6; }
2929
fi
3030
rmdir CaseSensitiveTestDir
3131

@@ -41,7 +41,7 @@ index a621d6a..efadbf5 100755
4141
hp*|HP*)
4242
case $ac_cv_cc_name in
4343
diff --git a/configure.ac b/configure.ac
44-
index 19907c4..43c1417 100644
44+
index 9a512f7..95cb4a2 100644
4545
--- a/configure.ac
4646
+++ b/configure.ac
4747
@@ -1391,6 +1391,7 @@ AC_ARG_WITH([suffix],

patches/3.14/configure_inet_pton_msys.patch

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# capability loss on a platform that has the API. Probe through
1414
# ws2tcpip.h under _WIN32 instead.
1515
diff --git a/configure b/configure
16-
index 3675f6c..730c719 100755
16+
index 1147514..0e6b6f3 100755
1717
--- a/configure
1818
+++ b/configure
19-
@@ -23857,10 +23857,14 @@ else case e in #(
19+
@@ -24019,10 +24019,14 @@ else case e in #(
2020
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2121
/* end confdefs.h. */
2222

@@ -31,7 +31,7 @@ index 3675f6c..730c719 100755
3131

3232
int
3333
main (void)
34-
@@ -23903,10 +23907,14 @@ else case e in #(
34+
@@ -24065,10 +24069,14 @@ else case e in #(
3535
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3636
/* end confdefs.h. */
3737

@@ -46,7 +46,7 @@ index 3675f6c..730c719 100755
4646

4747
int
4848
main (void)
49-
@@ -23949,10 +23957,14 @@ else case e in #(
49+
@@ -24111,10 +24119,14 @@ else case e in #(
5050
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5151
/* end confdefs.h. */
5252

@@ -61,7 +61,7 @@ index 3675f6c..730c719 100755
6161

6262
int
6363
main (void)
64-
@@ -23995,10 +24007,14 @@ else case e in #(
64+
@@ -24157,10 +24169,14 @@ else case e in #(
6565
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6666
/* end confdefs.h. */
6767

@@ -76,7 +76,7 @@ index 3675f6c..730c719 100755
7676

7777
int
7878
main (void)
79-
@@ -24041,10 +24057,14 @@ else case e in #(
79+
@@ -24203,10 +24219,14 @@ else case e in #(
8080
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8181
/* end confdefs.h. */
8282

@@ -91,7 +91,7 @@ index 3675f6c..730c719 100755
9191

9292
int
9393
main (void)
94-
@@ -24087,10 +24107,14 @@ else case e in #(
94+
@@ -24249,10 +24269,14 @@ else case e in #(
9595
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9696
/* end confdefs.h. */
9797

@@ -106,7 +106,7 @@ index 3675f6c..730c719 100755
106106

107107
int
108108
main (void)
109-
@@ -24133,10 +24157,14 @@ else case e in #(
109+
@@ -24295,10 +24319,14 @@ else case e in #(
110110
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
111111
/* end confdefs.h. */
112112

@@ -121,7 +121,7 @@ index 3675f6c..730c719 100755
121121

122122
int
123123
main (void)
124-
@@ -24179,10 +24207,14 @@ else case e in #(
124+
@@ -24341,10 +24369,14 @@ else case e in #(
125125
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
126126
/* end confdefs.h. */
127127

@@ -136,7 +136,7 @@ index 3675f6c..730c719 100755
136136

137137
int
138138
main (void)
139-
@@ -24225,10 +24257,14 @@ else case e in #(
139+
@@ -24387,10 +24419,14 @@ else case e in #(
140140
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
141141
/* end confdefs.h. */
142142

@@ -151,7 +151,7 @@ index 3675f6c..730c719 100755
151151

152152
int
153153
main (void)
154-
@@ -24271,10 +24307,14 @@ else case e in #(
154+
@@ -24433,10 +24469,14 @@ else case e in #(
155155
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
156156
/* end confdefs.h. */
157157

@@ -166,7 +166,7 @@ index 3675f6c..730c719 100755
166166

167167
int
168168
main (void)
169-
@@ -24317,10 +24357,14 @@ else case e in #(
169+
@@ -24479,10 +24519,14 @@ else case e in #(
170170
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
171171
/* end confdefs.h. */
172172

@@ -181,7 +181,7 @@ index 3675f6c..730c719 100755
181181

182182
int
183183
main (void)
184-
@@ -24363,10 +24407,14 @@ else case e in #(
184+
@@ -24525,10 +24569,14 @@ else case e in #(
185185
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
186186
/* end confdefs.h. */
187187

@@ -196,7 +196,7 @@ index 3675f6c..730c719 100755
196196

197197
int
198198
main (void)
199-
@@ -24409,10 +24457,14 @@ else case e in #(
199+
@@ -24571,10 +24619,14 @@ else case e in #(
200200
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
201201
/* end confdefs.h. */
202202

@@ -212,10 +212,10 @@ index 3675f6c..730c719 100755
212212
int
213213
main (void)
214214
diff --git a/configure.ac b/configure.ac
215-
index 0d73a2e..e1ae5b8 100644
215+
index b9cf7ce..603ab94 100644
216216
--- a/configure.ac
217217
+++ b/configure.ac
218-
@@ -5747,10 +5747,14 @@ PY_CHECK_NETDB_FUNC([getprotobyname])
218+
@@ -5792,10 +5792,14 @@ PY_CHECK_NETDB_FUNC([getprotobyname])
219219

220220
dnl PY_CHECK_SOCKET_FUNC(FUNCTION)
221221
AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [

patches/3.14/configure_noerror_incompat_ptr_msys.patch

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,16 @@
2121
# honored by the ABI either way). Was mis-classified "warning-grade"
2222
# in this sweep's first pass; the GCC-14 escalation makes it
2323
# gate-critical on any current toolchain (CI ships gcc 16).
24-
diff --git a/configure b/configure
25-
index e4cbbb6..156f543 100755
26-
--- a/configure
27-
+++ b/configure
28-
@@ -10289,6 +10289,14 @@ then :
24+
diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h
25+
index 2331247..edfcaef 100644
26+
--- a/Include/internal/pycore_time.h
27+
+++ b/Include/internal/pycore_time.h
28+
@@ -59,7 +59,7 @@ extern "C" {
2929

30-
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
30+
#include "pycore_runtime_structs.h" // _PyTimeFraction
3131

32-
+ # GCC 14 and later error out with incompatible-pointer-types
33-
+ # this only occues on mingw
34-
+ case $host in
35-
+ *-*-mingw*)
36-
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
37-
+ ;;
38-
+ esac
39-
+
32+
-#ifdef __clang__
33+
+#ifdef MS_WINDOWS
34+
struct timeval;
35+
#endif
4036

41-
42-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can add -Wextra" >&5
43-
diff --git a/configure.ac b/configure.ac
44-
index 4a169da..d7ad919 100644
45-
--- a/configure.ac
46-
+++ b/configure.ac
47-
@@ -2587,6 +2587,14 @@ fi
48-
AS_VAR_IF([ac_cv_gcc_compat], [yes], [
49-
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
50-
51-
+ # GCC 14 and later error out with incompatible-pointer-types
52-
+ # this only occues on mingw
53-
+ case $host in
54-
+ *-*-mingw*)
55-
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
56-
+ ;;
57-
+ esac
58-
+
59-
PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
60-
AS_VAR_IF([ac_cv_enable_extra_warning], [yes],
61-
[CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])

patches/3.14/configure_pthread_name_maxlen_msys.patch

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,40 @@
1212
# the autotools mingw build dies on the undeclared identifier. The patch
1313
# sets the MSVC value (32766) for MINGW hosts.
1414
diff --git a/configure b/configure
15-
index 6dac703..1b8d088 100755
15+
index d14cfe6..e250048 100755
1616
--- a/configure
1717
+++ b/configure
18-
@@ -32285,6 +32285,7 @@ case "$ac_sys_system" in
19-
iOS) _PYTHREAD_NAME_MAXLEN=63;;
20-
FreeBSD*) _PYTHREAD_NAME_MAXLEN=19;; # gh-131268
21-
OpenBSD*) _PYTHREAD_NAME_MAXLEN=23;; # gh-131268
22-
+ MINGW*) _PYTHREAD_NAME_MAXLEN=32766;;
23-
*) _PYTHREAD_NAME_MAXLEN=;;
24-
esac
25-
if test -n "$_PYTHREAD_NAME_MAXLEN"; then
18+
@@ -10418,6 +10418,14 @@ then :
19+
20+
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
21+
22+
+ # GCC 14 and later error out with incompatible-pointer-types
23+
+ # this only occues on mingw
24+
+ case $host in
25+
+ *-*-mingw*)
26+
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
27+
+ ;;
28+
+ esac
29+
+
30+
31+
32+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can add -Wextra" >&5
2633
diff --git a/configure.ac b/configure.ac
27-
index d47bcda..2f834f0 100644
34+
index 3d2b46e..705bea1 100644
2835
--- a/configure.ac
2936
+++ b/configure.ac
30-
@@ -8067,6 +8067,7 @@ case "$ac_sys_system" in
31-
iOS) _PYTHREAD_NAME_MAXLEN=63;;
32-
FreeBSD*) _PYTHREAD_NAME_MAXLEN=19;; # gh-131268
33-
OpenBSD*) _PYTHREAD_NAME_MAXLEN=23;; # gh-131268
34-
+ MINGW*) _PYTHREAD_NAME_MAXLEN=32766;;
35-
*) _PYTHREAD_NAME_MAXLEN=;;
36-
esac
37-
if test -n "$_PYTHREAD_NAME_MAXLEN"; then
37+
@@ -2599,6 +2599,14 @@ fi
38+
AS_VAR_IF([ac_cv_gcc_compat], [yes], [
39+
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
40+
41+
+ # GCC 14 and later error out with incompatible-pointer-types
42+
+ # this only occues on mingw
43+
+ case $host in
44+
+ *-*-mingw*)
45+
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
46+
+ ;;
47+
+ esac
48+
+
49+
PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
50+
AS_VAR_IF([ac_cv_enable_extra_warning], [yes],
51+
[CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])

0 commit comments

Comments
 (0)