]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Jan 2025 16:59:20 +0000 (17:59 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Jan 2025 16:59:20 +0000 (01:59 +0900)
gh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors (gh-128511)

* Add `-skip-funcs` to BOLT options to fix computed goto errors

* NEWS

---------

(cherry picked from commit 24b147a19b360c49cb1740aa46211d342aaa071f)

Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
Misc/NEWS.d/next/Build/2025-01-04-22-39-10.gh-issue-128472.Wt5E6M.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2025-01-04-22-39-10.gh-issue-128472.Wt5E6M.rst b/Misc/NEWS.d/next/Build/2025-01-04-22-39-10.gh-issue-128472.Wt5E6M.rst
new file mode 100644 (file)
index 0000000..c6233e1
--- /dev/null
@@ -0,0 +1,2 @@
+Skip BOLT optimization of functions using computed gotos, fixing errors on
+build with LLVM 19.
index 0d8a9ffa8a26059b117c1590516f1cb9db927547..ff8e29de1439ec5432c70cdc8096f7b44c1b2d0d 100755 (executable)
--- a/configure
+++ b/configure
@@ -9335,7 +9335,7 @@ fi
 printf %s "checking BOLT_COMMON_FLAGS... " >&6; }
 if test -z "${BOLT_COMMON_FLAGS}"
 then
-  BOLT_COMMON_FLAGS=-update-debug-sections
+  BOLT_COMMON_FLAGS=" -update-debug-sections -skip-funcs=_PyEval_EvalFrameDefault,sre_ucs1_match/1,sre_ucs2_match/1,sre_ucs4_match/1 "
 
 fi
 
index b3e112a0a181d6d5d2e29a1d16693538344e0c28..dd4e0b4723c1d3b013ad755b07f2368c97fcb445 100644 (file)
@@ -2224,7 +2224,14 @@ if test -z "${BOLT_COMMON_FLAGS}"
 then
   AS_VAR_SET(
     [BOLT_COMMON_FLAGS],
-    [-update-debug-sections]
+    [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