From 1f9cddc83dd5d3b273751c6e21c5af29cae467f4 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 19 Nov 2025 08:37:59 -0600 Subject: [PATCH 1/6] cpython-3.15 3.15.0a1 -> 3.15.0a2 --- pythonbuild/downloads.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 4981e139..75686a9f 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -93,10 +93,10 @@ "python_tag": "cp314", }, "cpython-3.15": { - "url": "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a1.tar.xz", - "size": 23646768, - "sha256": "3194939d488eeaeefdcf990d35542d9ad1ce788789c4e2305a2060eb7058e5a4", - "version": "3.15.0a1", + "url": "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a2.tar.xz", + "size": 23728836, + "sha256": "d8a0a2f4a7f3d7090cf195e81814efe95f70554955557f40e149d8694a662751", + "version": "3.15.0a2", "licenses": ["Python-2.0", "CNRI-Python"], "license_file": "LICENSE.cpython.txt", "python_tag": "cp315", From 231b6c9e705bce55d2833e8d623ba0c631b1c997 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 19 Nov 2025 11:23:33 -0600 Subject: [PATCH 2/6] add _math_interger extension module --- cpython-unix/extension-modules.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index c9e5df9c..1fb0860d 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -362,6 +362,11 @@ _lzma: links: - lzma +_math_integer: + minimum-python-version: "3.15" + sources: + - mathintegermodule.c + _md5: sources: - md5module.c From e60473d06a8ad06d8c6b71597ec746f1eb01dec4 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 19 Nov 2025 11:23:51 -0600 Subject: [PATCH 3/6] update patches for 3.15.0a2 release --- cpython-unix/patch-configure-bolt-skip-funcs.patch | 7 ++++--- cpython-unix/patch-jit-llvm-version-3.15.patch | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cpython-unix/patch-configure-bolt-skip-funcs.patch b/cpython-unix/patch-configure-bolt-skip-funcs.patch index afc8dd95..df3d5a2b 100644 --- a/cpython-unix/patch-configure-bolt-skip-funcs.patch +++ b/cpython-unix/patch-configure-bolt-skip-funcs.patch @@ -1,15 +1,16 @@ diff --git a/configure.ac b/configure.ac -index 3fcb18922c5..2df614a3063 100644 +index a059a07bec2..92a7ff8d54c 100644 --- a/configure.ac +++ b/configure.ac -@@ -2227,10 +2227,8 @@ then +@@ -2167,11 +2167,8 @@ then [m4_normalize(" [-update-debug-sections] - dnl At least LLVM 19.x doesn't support computed gotos in PIC compiled code. - dnl Exclude functions containing computed gotos. - dnl TODO this may be fixed in LLVM 20.x via https://github.com/llvm/llvm-project/pull/120267. -- [-skip-funcs=_PyEval_EvalFrameDefault,sre_ucs1_match/1,sre_ucs2_match/1,sre_ucs4_match/1] +- dnl GCC's LTO creates .lto_priv.0 clones of these functions. +- [-skip-funcs=_PyEval_EvalFrameDefault,sre_ucs1_match/1,sre_ucs2_match/1,sre_ucs4_match/1,sre_ucs1_match.lto_priv.0/1,sre_ucs2_match.lto_priv.0/1,sre_ucs4_match.lto_priv.0/1] + dnl LLVM on at least 20.1.0 crashes on this symbol. Work around. + [-skip-funcs=RC4_options/1] ")] diff --git a/cpython-unix/patch-jit-llvm-version-3.15.patch b/cpython-unix/patch-jit-llvm-version-3.15.patch index 35aae48e..5a039ffb 100644 --- a/cpython-unix/patch-jit-llvm-version-3.15.patch +++ b/cpython-unix/patch-jit-llvm-version-3.15.patch @@ -5,8 +5,8 @@ diff --git a/Tools/jit/_llvm.py b/Tools/jit/_llvm.py import _targets --_LLVM_VERSION = "19" +-_LLVM_VERSION = "21" +_LLVM_VERSION = "21" - _EXTERNALS_LLVM_TAG = "llvm-19.1.7.0" + _EXTERNALS_LLVM_TAG = "llvm-21.1.4.0" From 41c9bcd55fe79f5981384af452ea13c77bad2239 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 19 Nov 2025 11:55:46 -0600 Subject: [PATCH 4/6] split patch by python version --- cpython-unix/build-cpython.sh | 6 +++++- .../patch-configure-bolt-skip-funcs-3.15.patch | 18 ++++++++++++++++++ .../patch-configure-bolt-skip-funcs.patch | 7 +++---- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 cpython-unix/patch-configure-bolt-skip-funcs-3.15.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 9c65394e..70caecc2 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -260,7 +260,11 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then patch -p1 -i ${ROOT}/patch-configure-bolt-icf-safe.patch # Tweak --skip-funcs to work with our toolchain. - patch -p1 -i ${ROOT}/patch-configure-bolt-skip-funcs.patch + if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_15}" ]; then + patch -p1 -i ${ROOT}/patch-configure-bolt-skip-funcs-3.15.patch + else + patch -p1 -i ${ROOT}/patch-configure-bolt-skip-funcs.patch + fi fi # The optimization make targets are both phony and non-phony. This leads diff --git a/cpython-unix/patch-configure-bolt-skip-funcs-3.15.patch b/cpython-unix/patch-configure-bolt-skip-funcs-3.15.patch new file mode 100644 index 00000000..df3d5a2b --- /dev/null +++ b/cpython-unix/patch-configure-bolt-skip-funcs-3.15.patch @@ -0,0 +1,18 @@ +diff --git a/configure.ac b/configure.ac +index a059a07bec2..92a7ff8d54c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2167,11 +2167,8 @@ then + [m4_normalize(" + [-update-debug-sections] + +- dnl At least LLVM 19.x doesn't support computed gotos in PIC compiled code. +- dnl Exclude functions containing computed gotos. +- dnl TODO this may be fixed in LLVM 20.x via https://github.com/llvm/llvm-project/pull/120267. +- dnl GCC's LTO creates .lto_priv.0 clones of these functions. +- [-skip-funcs=_PyEval_EvalFrameDefault,sre_ucs1_match/1,sre_ucs2_match/1,sre_ucs4_match/1,sre_ucs1_match.lto_priv.0/1,sre_ucs2_match.lto_priv.0/1,sre_ucs4_match.lto_priv.0/1] ++ dnl LLVM on at least 20.1.0 crashes on this symbol. Work around. ++ [-skip-funcs=RC4_options/1] + ")] + ) + fi diff --git a/cpython-unix/patch-configure-bolt-skip-funcs.patch b/cpython-unix/patch-configure-bolt-skip-funcs.patch index df3d5a2b..afc8dd95 100644 --- a/cpython-unix/patch-configure-bolt-skip-funcs.patch +++ b/cpython-unix/patch-configure-bolt-skip-funcs.patch @@ -1,16 +1,15 @@ diff --git a/configure.ac b/configure.ac -index a059a07bec2..92a7ff8d54c 100644 +index 3fcb18922c5..2df614a3063 100644 --- a/configure.ac +++ b/configure.ac -@@ -2167,11 +2167,8 @@ then +@@ -2227,10 +2227,8 @@ then [m4_normalize(" [-update-debug-sections] - dnl At least LLVM 19.x doesn't support computed gotos in PIC compiled code. - dnl Exclude functions containing computed gotos. - dnl TODO this may be fixed in LLVM 20.x via https://github.com/llvm/llvm-project/pull/120267. -- dnl GCC's LTO creates .lto_priv.0 clones of these functions. -- [-skip-funcs=_PyEval_EvalFrameDefault,sre_ucs1_match/1,sre_ucs2_match/1,sre_ucs4_match/1,sre_ucs1_match.lto_priv.0/1,sre_ucs2_match.lto_priv.0/1,sre_ucs4_match.lto_priv.0/1] +- [-skip-funcs=_PyEval_EvalFrameDefault,sre_ucs1_match/1,sre_ucs2_match/1,sre_ucs4_match/1] + dnl LLVM on at least 20.1.0 crashes on this symbol. Work around. + [-skip-funcs=RC4_options/1] ")] From 61059f590bc73f876212e6d2b579b79ae0a49f4e Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 19 Nov 2025 12:08:07 -0600 Subject: [PATCH 5/6] split off 3.15 global extensions in validation --- src/validation.rs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/validation.rs b/src/validation.rs index 9b4756fe..ef64d29d 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -731,12 +731,8 @@ const GLOBAL_EXTENSIONS: &[&str] = &[ // _xxinterpchannels added in 3.12. // audioop removed in 3.13. -const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[ - "audioop", - "_sha256", - "_sha512", - "_xxsubinterpreters", -]; +const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = + &["audioop", "_sha256", "_sha512", "_xxsubinterpreters"]; const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[ "audioop", @@ -782,6 +778,22 @@ const GLOBAL_EXTENSIONS_PYTHON_3_14: &[&str] = &[ "_zstd", ]; +const GLOBAL_EXTENSIONS_PYTHON_3_15: &[&str] = &[ + "_interpchannels", + "_interpqueues", + "_interpreters", + "_math_integer", + "_remote_debugging", + "_sha2", + "_suggestions", + "_sysconfig", + "_tokenize", + "_typing", + "_hmac", + "_types", + "_zstd", +]; + const GLOBAL_EXTENSIONS_MACOS: &[&str] = &["_scproxy"]; const GLOBAL_EXTENSIONS_POSIX: &[&str] = &[ @@ -1586,9 +1598,12 @@ fn validate_extension_modules( "3.13" => { wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_13); } - "3.14" | "3.15" => { + "3.14" => { wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_14); } + "3.15" => { + wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_15); + } _ => { panic!("unhandled Python version: {python_major_minor}"); } From 79928967bbbef21781c2bae1d1f2b2d7756ea69e Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 19 Nov 2025 13:35:02 -0600 Subject: [PATCH 6/6] fix patch condition typo --- cpython-unix/build-cpython.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 70caecc2..33391336 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -260,7 +260,7 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then patch -p1 -i ${ROOT}/patch-configure-bolt-icf-safe.patch # Tweak --skip-funcs to work with our toolchain. - if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_15}" ]; then + if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" ]; then patch -p1 -i ${ROOT}/patch-configure-bolt-skip-funcs-3.15.patch else patch -p1 -i ${ROOT}/patch-configure-bolt-skip-funcs.patch