mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[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 f95fc4de11
)
This commit is contained in:
parent
22ec9cb823
commit
4514998195
4 changed files with 20 additions and 0 deletions
|
@ -343,6 +343,11 @@ def get_build_info():
|
||||||
if support.check_cflags_pgo():
|
if support.check_cflags_pgo():
|
||||||
# PGO (--enable-optimizations)
|
# PGO (--enable-optimizations)
|
||||||
optimizations.append('PGO')
|
optimizations.append('PGO')
|
||||||
|
|
||||||
|
if support.check_bolt_optimized():
|
||||||
|
# BOLT (--enable-bolt)
|
||||||
|
optimizations.append('BOLT')
|
||||||
|
|
||||||
if optimizations:
|
if optimizations:
|
||||||
build.append('+'.join(optimizations))
|
build.append('+'.join(optimizations))
|
||||||
|
|
||||||
|
|
|
@ -817,10 +817,20 @@ if hasattr(sys, "getobjects"):
|
||||||
_align = '0P'
|
_align = '0P'
|
||||||
_vheader = _header + 'n'
|
_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):
|
def calcobjsize(fmt):
|
||||||
import struct
|
import struct
|
||||||
return struct.calcsize(_header + fmt + _align)
|
return struct.calcsize(_header + fmt + _align)
|
||||||
|
|
||||||
|
|
||||||
def calcvobjsize(fmt):
|
def calcvobjsize(fmt):
|
||||||
import struct
|
import struct
|
||||||
return struct.calcsize(_vheader + fmt + _align)
|
return struct.calcsize(_vheader + fmt + _align)
|
||||||
|
|
|
@ -24,6 +24,9 @@ if not sysconfig.is_python_build():
|
||||||
if support.check_cflags_pgo():
|
if support.check_cflags_pgo():
|
||||||
raise unittest.SkipTest("test_gdb is not reliable on PGO builds")
|
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):
|
def load_tests(*args):
|
||||||
return support.load_package_tests(os.path.dirname(__file__), *args)
|
return support.load_package_tests(os.path.dirname(__file__), *args)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Skip ``test_gdb`` if the binary is relocated by BOLT.
|
||||||
|
Patch by Donghee Na.
|
Loading…
Add table
Add a link
Reference in a new issue