https://github.com/python/cpython/commit/115d5043b1a7f1890eb5f17a5c9779d666415656
commit: 115d5043b1a7f1890eb5f17a5c9779d666415656
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: corona10 <[email protected]>
date: 2025-01-07T14:21:43+09:00
summary:

[3.12] gh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors 
(gh-128511) (gh-128572)

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 <[email protected]>
Co-authored-by: Gregory Szorc <[email protected]>

files:
A Misc/NEWS.d/next/Build/2025-01-04-22-39-10.gh-issue-128472.Wt5E6M.rst
M configure
M 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
index 00000000000000..c6233e1f2d8693
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2025-01-04-22-39-10.gh-issue-128472.Wt5E6M.rst
@@ -0,0 +1,2 @@
+Skip BOLT optimization of functions using computed gotos, fixing errors on
+build with LLVM 19.
diff --git a/configure b/configure
index c9de45a2331a7b..32c9600b2e8cac 100755
--- a/configure
+++ b/configure
@@ -9165,7 +9165,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
 
diff --git a/configure.ac b/configure.ac
index 7325d00e3942ef..0f60c849965719 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2114,7 +2114,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
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to