Skip to content

[3.12] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (… #123603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Lib/test/libregrtest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
10 changes: 10 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_gdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Skip ``test_gdb`` if the binary is relocated by BOLT.
Patch by Donghee Na.
Loading