diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 9c65394e..33391336 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_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 + fi fi # The optimization make targets are both phony and non-phony. This leads 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 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-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" 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", 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}"); }