summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZanie Blue <contact@zanie.dev>2025-01-07 03:02:55 (GMT)
committerGitHub <noreply@github.com>2025-01-07 03:02:55 (GMT)
commit24b147a19b360c49cb1740aa46211d342aaa071f (patch)
tree38f11b6c5ae939b2d9af7f9b9d650c222e7b4222
parent953b49e5468d02afaddadc2307f4763422078603 (diff)
downloadcpython-24b147a19b360c49cb1740aa46211d342aaa071f.zip
cpython-24b147a19b360c49cb1740aa46211d342aaa071f.tar.gz
cpython-24b147a19b360c49cb1740aa46211d342aaa071f.tar.bz2
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 Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com> * NEWS --------- Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
-rw-r--r--Misc/NEWS.d/next/Build/2025-01-04-22-39-10.gh-issue-128472.Wt5E6M.rst2
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac9
3 files changed, 11 insertions, 2 deletions
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 0000000..c6233e1
--- /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 9024d22..08c10ff 100755
--- a/configure
+++ b/configure
@@ -9398,7 +9398,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 86775e0..fb1dd77 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2170,7 +2170,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