]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Require -fsplit-stack in gdb.base/morestack.exp
authorTom de Vries <tdevries@suse.de>
Tue, 21 Feb 2023 13:41:14 +0000 (14:41 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 21 Feb 2023 13:41:14 +0000 (14:41 +0100)
On aarch64-linux, I run into:
...
gdb compile failed, cc1: error: '-fsplit-stack' is not supported by this \
  compiler configuration
UNTESTED: gdb.base/morestack.exp: failed to prepare
...

Fix this by requiring -fsplit-stack, such that we have instead:
...
UNSUPPORTED: gdb.base/morestack.exp: require failed: \
  expr [have_compile_flag -fsplit-stack]
...

Tested on x86_64-linux and aarch64-linux.

gdb/testsuite/gdb.base/morestack.exp
gdb/testsuite/lib/gdb.exp

index a60a3de5a3acb1b195cedc1800ef05dd04d199d8..b4d22187390e85c7c345394db73f8a8c74d6758b 100644 (file)
@@ -15,6 +15,8 @@
 
 require is_c_compiler_gcc
 
+require {expr [have_compile_flag -fsplit-stack]}
+
 standard_testfile
 
 set opts "additional_flags=-fsplit-stack"
index 12839a54710c26828dae286e3b94c54e6681b57b..6864dac3ac91f9c9753caf7a437c1aedbfa37ab4 100644 (file)
@@ -9408,5 +9408,13 @@ proc have_syscall { name } {
     return [gdb_can_simple_compile have_syscall_$name $src object]
 }
 
+# Return 1 if compile flag FLAG is supported.
+
+proc have_compile_flag { flag } {
+    set src { void foo () {} }
+    return [gdb_can_simple_compile have_compile_flag_$flag $src object \
+               additional_flags=$flag]
+}
+
 # Always load compatibility stuff.
 load_lib future.exp