]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572)
authorDonghee Na <donghee.na@python.org>
Mon, 2 Sep 2024 13:24:53 +0000 (22:24 +0900)
committerGitHub <noreply@github.com>
Mon, 2 Sep 2024 13:24:53 +0000 (13:24 +0000)
Lib/test/libregrtest/utils.py
Lib/test/support/__init__.py
Lib/test/test_gdb/__init__.py
Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst [new file with mode: 0644]

index 2a3449016fe9511aa009da85eafb1e74186654a1..495691054ab9132f271dc23064ea2cca5a67cc4e 100644 (file)
@@ -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))
 
index 3149fd732f64a784521a38162c98a056c6a33c61..dbf479dddff7b349bf547db356d51eaf2573c805 100644 (file)
@@ -866,6 +866,15 @@ def check_cflags_pgo():
     return any(option in cflags_nodist for option in pgo_options)
 
 
+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
+
+
 Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
 
 def requires_gil_enabled(msg="needs the GIL enabled"):
index 99557739af6748cae6d393446b1dea475beabd11..0dd721780233e6893138e0ab2e86667c18504252 100644 (file)
@@ -24,6 +24,9 @@ if not sysconfig.is_python_build():
 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 (file)
index 0000000..ae8001a
--- /dev/null
@@ -0,0 +1,2 @@
+Skip ``test_gdb`` if the binary is relocated by BOLT.
+Patch by Donghee Na.