Skip to content

Commit 4514998

Browse files
authored
[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 f95fc4d)
1 parent 22ec9cb commit 4514998

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-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

+10
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,20 @@ def check_cflags_pgo():
817817
_align = '0P'
818818
_vheader = _header + 'n'
819819

820+
def check_bolt_optimized():
821+
# Always return false, if the platform is WASI,
822+
# because BOLT optimization does not support WASM binary.
823+
if is_wasi:
824+
return False
825+
config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
826+
return '--enable-bolt' in config_args
827+
828+
820829
def calcobjsize(fmt):
821830
import struct
822831
return struct.calcsize(_header + fmt + _align)
823832

833+
824834
def calcvobjsize(fmt):
825835
import struct
826836
return struct.calcsize(_vheader + fmt + _align)

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)