Skip to content

Commit bda2d19

Browse files
committed
Fix BOLT flags for 3.14
1 parent 64f0959 commit bda2d19

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

cpython-unix/build-cpython.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,17 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
284284
fi
285285

286286
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then
287-
# Adjust BOLT flags to yield better behavior. See inline details in patch.
288-
patch -p1 -i ${ROOT}/patch-configure-bolt-flags.patch
287+
# On 3.14+, we upstreamed these changes and they are no longer needed
288+
if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_13}" ]; then
289+
# Adjust BOLT flags to yield better behavior. See inline details in patch.
290+
patch -p1 -i ${ROOT}/patch-configure-bolt-flags.patch
289291

290-
# Adjust BOLT application flags to make use of modern LLVM features.
291-
patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags.patch
292+
# Adjust BOLT application flags to make use of modern LLVM features.
293+
patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags.patch
294+
else
295+
# We are still upstreaming some additional optimization flags
296+
patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags-3.14.patch
297+
fi
292298
fi
293299

294300
# The optimization make targets are both phony and non-phony. This leads
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index ee034e5a962..f1a69b7d4a7 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -2183,8 +2183,9 @@ then
6+
[m4_normalize("
7+
-update-debug-sections
8+
-reorder-blocks=ext-tsp
9+
-reorder-functions=cdsort
10+
-split-functions
11+
+ -split-strategy=cdsplit
12+
-icf=1
13+
-inline-all
14+
-split-eh
15+
@@ -2196,6 +2197,7 @@ then
16+
-dyno-stats
17+
-use-gnu-stack
18+
-frame-opt=hot
19+
+ -hugify
20+
")]
21+
)
22+
fi

0 commit comments

Comments
 (0)