[binutils-gdb] [gdb/testsuite] Require -fsplit-stack in gdb.base/morestack.exp

Tom de Vries vries@sourceware.org
Tue Feb 21 13:41:04 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=491b4c189a4135edf2a4e580a0433af12a71fba5

commit 491b4c189a4135edf2a4e580a0433af12a71fba5
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Feb 21 14:41:14 2023 +0100

    [gdb/testsuite] Require -fsplit-stack in gdb.base/morestack.exp
    
    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.

Diff:
---
 gdb/testsuite/gdb.base/morestack.exp | 2 ++
 gdb/testsuite/lib/gdb.exp            | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp
index a60a3de5a3a..b4d22187390 100644
--- a/gdb/testsuite/gdb.base/morestack.exp
+++ b/gdb/testsuite/gdb.base/morestack.exp
@@ -15,6 +15,8 @@
 
 require is_c_compiler_gcc
 
+require {expr [have_compile_flag -fsplit-stack]}
+
 standard_testfile
 
 set opts "additional_flags=-fsplit-stack"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 12839a54710..6864dac3ac9 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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


More information about the Gdb-cvs mailing list