diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index a07188a6..6d8a5cde 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -267,17 +267,9 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then fi if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then - # On 3.14+, we upstreamed these changes and they are no longer needed - if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_13}" ]; then - # Adjust BOLT flags to yield better behavior. See inline details in patch. - patch -p1 -i ${ROOT}/patch-configure-bolt-flags.patch - - # Adjust BOLT application flags to make use of modern LLVM features. - patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags.patch - else - # We are still upstreaming some additional optimization flags - patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags-3.14.patch - fi + # Additional BOLT optimizations, being upstreamed in + # https://github.com/python/cpython/issues/128514 + patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags-128514.patch fi # The optimization make targets are both phony and non-phony. This leads diff --git a/cpython-unix/patch-configure-bolt-apply-flags-3.14.patch b/cpython-unix/patch-configure-bolt-apply-flags-128514.patch similarity index 100% rename from cpython-unix/patch-configure-bolt-apply-flags-3.14.patch rename to cpython-unix/patch-configure-bolt-apply-flags-128514.patch diff --git a/cpython-unix/patch-configure-bolt-apply-flags.patch b/cpython-unix/patch-configure-bolt-apply-flags.patch deleted file mode 100644 index c91822e4..00000000 --- a/cpython-unix/patch-configure-bolt-apply-flags.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index ee034e5a962..f1a69b7d4a7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2183,8 +2183,9 @@ then - [m4_normalize(" - -update-debug-sections - -reorder-blocks=ext-tsp -- -reorder-functions=hfsort+ -+ -reorder-functions=cdsort - -split-functions -+ -split-strategy=cdsplit - -icf=1 - -inline-all - -split-eh -@@ -2196,6 +2197,7 @@ then - -dyno-stats - -use-gnu-stack - -frame-opt=hot -+ -hugify - ")] - ) - fi diff --git a/cpython-unix/patch-configure-bolt-flags.patch b/cpython-unix/patch-configure-bolt-flags.patch deleted file mode 100644 index c9fbf824..00000000 --- a/cpython-unix/patch-configure-bolt-flags.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index bc8c357e996..eef55d4839a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2104,6 +2104,27 @@ AS_VAR_IF([enable_shared], [yes], [ - BOLT_BINARIES="${BOLT_BINARIES} \$(INSTSONAME)" - ]) - -+AC_ARG_VAR( -+ [BOLT_COMMON_FLAGS], -+ [Common arguments to llvm-bolt when instrumenting and applying] -+) -+ -+AC_MSG_CHECKING([BOLT_COMMON_FLAGS]) -+if test -z "${BOLT_COMMON_FLAGS}" -+then -+ AS_VAR_SET( -+ [BOLT_COMMON_FLAGS], -+ [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] -+ ")] -+ ) -+fi -+ - AC_ARG_VAR( - [BOLT_INSTRUMENT_FLAGS], - [Arguments to llvm-bolt when instrumenting binaries] -@@ -2111,7 +2132,7 @@ AC_ARG_VAR( - AC_MSG_CHECKING([BOLT_INSTRUMENT_FLAGS]) - if test -z "${BOLT_INSTRUMENT_FLAGS}" - then -- BOLT_INSTRUMENT_FLAGS= -+ BOLT_INSTRUMENT_FLAGS="${BOLT_COMMON_FLAGS}" - fi - AC_MSG_RESULT([$BOLT_INSTRUMENT_FLAGS]) - -@@ -2125,7 +2146,7 @@ then - AS_VAR_SET( - [BOLT_APPLY_FLAGS], - [m4_normalize(" -- -update-debug-sections -+ ${BOLT_COMMON_FLAGS} - -reorder-blocks=ext-tsp - -reorder-functions=hfsort+ - -split-functions diff --git a/cpython-unix/patch-test-embed-prevent-segfault.patch b/cpython-unix/patch-test-embed-prevent-segfault.patch index 4eac5b28..d05e2b00 100644 --- a/cpython-unix/patch-test-embed-prevent-segfault.patch +++ b/cpython-unix/patch-test-embed-prevent-segfault.patch @@ -10,11 +10,3 @@ index 13713cf37b8..40ee4837bfe 100644 def test_global_pathconfig(self): # Test C API functions getting the path configuration: # -@@ -1866,6 +1867,7 @@ def test_no_memleak(self): - self.assertEqual(blocks, 0, out) - - -+@unittest.skipIf(support.check_bolt_optimized, "segfaults on BOLT instrumented binaries") - class StdPrinterTests(EmbeddingTestsMixin, unittest.TestCase): - # Test PyStdPrinter_Type which is used by _PySys_SetPreliminaryStderr(): - # "Set up a preliminary stderr printer until we have enough diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 1e9a8ed8..0a723aa9 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -62,19 +62,19 @@ "python_tag": "cp311", }, "cpython-3.12": { - "url": "https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tar.xz", - "size": 20489808, - "sha256": "c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e", - "version": "3.12.8", + "url": "https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tar.xz", + "size": 20502440, + "sha256": "7220835d9f90b37c006e9842a8dff4580aaca4318674f947302b8d28f3f81112", + "version": "3.12.9", "licenses": ["Python-2.0", "CNRI-Python"], "license_file": "LICENSE.cpython.txt", "python_tag": "cp312", }, "cpython-3.13": { - "url": "https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz", - "size": 22589692, - "sha256": "9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9", - "version": "3.13.1", + "url": "https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz", + "size": 22621108, + "sha256": "d984bcc57cd67caab26f7def42e523b1c015bbc5dc07836cf4f0b63fa159eb56", + "version": "3.13.2", "licenses": ["Python-2.0", "CNRI-Python"], "license_file": "LICENSE.cpython.txt", "python_tag": "cp313",