https://github.com/python/cpython/commit/4514998195c7ff9809d13ece89fc60298f6e9b12
commit: 4514998195c7ff9809d13ece89fc60298f6e9b12
branch: 3.12
author: Donghee Na <[email protected]>
committer: corona10 <[email protected]>
date: 2024-09-03T00:37:26+09:00
summary:
[3.12] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (… (#123603)
[3.12] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572)
(cherry picked from commit f95fc4de115ae03d7aa6dece678240df085cb4f6)
files:
A Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst
M Lib/test/libregrtest/utils.py
M Lib/test/support/__init__.py
M Lib/test/test_gdb/__init__.py
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index 3bd2ccdedf363e..a4fd1ee7a85fee 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -343,6 +343,11 @@ def get_build_info():
if support.check_cflags_pgo():
# PGO (--enable-optimizations)
optimizations.append('PGO')
+
+ if support.check_bolt_optimized():
+ # BOLT (--enable-bolt)
+ optimizations.append('BOLT')
+
if optimizations:
build.append('+'.join(optimizations))
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 9a56faa648bfb1..8519fedf8dbc9d 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -817,10 +817,20 @@ def check_cflags_pgo():
_align = '0P'
_vheader = _header + 'n'
+def check_bolt_optimized():
+ # Always return false, if the platform is WASI,
+ # because BOLT optimization does not support WASM binary.
+ if is_wasi:
+ return False
+ config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
+ return '--enable-bolt' in config_args
+
+
def calcobjsize(fmt):
import struct
return struct.calcsize(_header + fmt + _align)
+
def calcvobjsize(fmt):
import struct
return struct.calcsize(_vheader + fmt + _align)
diff --git a/Lib/test/test_gdb/__init__.py b/Lib/test/test_gdb/__init__.py
index 99557739af6748..0dd721780233e6 100644
--- a/Lib/test/test_gdb/__init__.py
+++ b/Lib/test/test_gdb/__init__.py
@@ -24,6 +24,9 @@
if support.check_cflags_pgo():
raise unittest.SkipTest("test_gdb is not reliable on PGO builds")
+if support.check_bolt_optimized():
+ raise unittest.SkipTest("test_gdb is not reliable on BOLT optimized
builds")
+
def load_tests(*args):
return support.load_package_tests(os.path.dirname(__file__), *args)
diff --git
a/Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst
b/Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst
new file mode 100644
index 00000000000000..ae8001ad373119
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst
@@ -0,0 +1,2 @@
+Skip ``test_gdb`` if the binary is relocated by BOLT.
+Patch by Donghee Na.
_______________________________________________
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]