Skip to content

Commit 3b3a1a8

Browse files
[3.13] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572) (#123601)
gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572) (cherry picked from commit f95fc4d) Co-authored-by: Donghee Na <donghee.na@python.org>
1 parent 05dcc81 commit 3b3a1a8

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

Lib/test/libregrtest/utils.py

+5
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,11 @@ def get_build_info():
343343
if support.check_cflags_pgo():
344344
# PGO (--enable-optimizations)
345345
optimizations.append('PGO')
346+
347+
if support.check_bolt_optimized():
348+
# BOLT (--enable-bolt)
349+
optimizations.append('BOLT')
350+
346351
if optimizations:
347352
build.append('+'.join(optimizations))
348353

Lib/test/support/__init__.py

+9
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,15 @@ def check_cflags_pgo():
866866
return any(option in cflags_nodist for option in pgo_options)
867867

868868

869+
def check_bolt_optimized():
870+
# Always return false, if the platform is WASI,
871+
# because BOLT optimization does not support WASM binary.
872+
if is_wasi:
873+
return False
874+
config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
875+
return '--enable-bolt' in config_args
876+
877+
869878
Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
870879

871880
def requires_gil_enabled(msg="needs the GIL enabled"):

Lib/test/test_gdb/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
if support.check_cflags_pgo():
2525
raise unittest.SkipTest("test_gdb is not reliable on PGO builds")
2626

27+
if support.check_bolt_optimized():
28+
raise unittest.SkipTest("test_gdb is not reliable on BOLT optimized builds")
29+
2730

2831
def load_tests(*args):
2932
return support.load_package_tests(os.path.dirname(__file__), *args)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Skip ``test_gdb`` if the binary is relocated by BOLT.
2+
Patch by Donghee Na.

0 commit comments

Comments
 (0)