MINGW-packages/mingw-w64-python3.13/0052-Change-the-get_platform-method-in-sysconfig.patch
Christoph Reiter 04c9ed3700 python3.13: Add 3.13.7
* add libb2 as dep
* remove "-Wl,--large-address-aware", default now via makepkg
* remove 2to3 logic, no longer in Python
2025-09-08 22:02:30 +02:00

62 lines
2.2 KiB
Diff

From 49f25a3dd7bc11e03acc74e72ea9aa6f08404cb6 Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Tue, 21 Sep 2021 21:36:58 +0200
Subject: [PATCH 052/N] Change the `get_platform()` method in sysconfig
This would possibly fix building wheels when mingw python
is used and would be unique to each python same as EXT_SUFFIX.
Also, this modifies the `sys.version` argument to include UCRT
in it.
Signed-off-by: Naveen M K <naveen521kk@gmail.com>
---
Lib/sysconfig/__init__.py | 16 ++++++++++++++--
Python/getcompiler.c | 4 ++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 9a42867..06e7d16 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -613,8 +613,20 @@ def get_platform():
"""
if os.name == 'nt':
- if 'GCC' in sys.version:
- return 'mingw'
+ if 'gcc' in sys.version.lower():
+ if 'ucrt' in sys.version.lower():
+ if 'amd64' in sys.version.lower():
+ return 'mingw_x86_64_ucrt'
+ return 'mingw_i686_ucrt'
+ if 'clang' in sys.version.lower():
+ if 'amd64' in sys.version.lower():
+ return 'mingw_x86_64_clang'
+ if 'arm64' in sys.version.lower():
+ return 'mingw_aarch64'
+ return 'mingw_i686_clang'
+ if 'amd64' in sys.version.lower():
+ return 'mingw_x86_64'
+ return 'mingw_i686'
if 'amd64' in sys.version.lower():
return 'win-amd64'
if '(arm)' in sys.version.lower():
diff --git a/Python/getcompiler.c b/Python/getcompiler.c
index 7e7be71..275f799 100644
--- a/Python/getcompiler.c
+++ b/Python/getcompiler.c
@@ -33,8 +33,12 @@
#define COMPILER COMP_SEP "[GCC Clang " xstr(__clang_major__) "." \
xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]"
#else
+#if defined(_UCRT)
+#define COMPILER COMP_SEP "[GCC UCRT " __VERSION__ ARCH_SUFFIX "]"
+#else
#define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]"
#endif
+#endif
// Generic fallbacks.
#elif defined(__cplusplus)
#define COMPILER "[C++]"