diff options
-rw-r--r-- | gdb/testsuite/gdb.base/step-indirect-call-thunk.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp index 7c1b53c..c4f69ad 100644 --- a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp +++ b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp @@ -19,7 +19,11 @@ if { ![istarget "x86*"] } { return } -set cflags "-mindirect-branch=thunk -mfunction-return=thunk -fcf-protection=none" +set cflags "-mindirect-branch=thunk -mfunction-return=thunk" + +if { [gcc_major_version] >= 8 } { + append cflags " -fcf-protection=none" +} if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ [list debug "additional_flags=$cflags"]] } { return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 698dd14..5d6f126 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8529,6 +8529,17 @@ gdb_caching_proc supports_gnuc { return [gdb_simple_compile $me $src object ""] } +# Return 1 if compiler supports __GNUC__, otherwise return 0. +gdb_caching_proc supports_gnuc { + set me "supports_gnuc" + set src { + #ifndef __GNUC__ + #error "No gnuc" + #endif + } + return [gdb_simple_compile $me $src object ""] +} + # Return 1 if target supports mpx, otherwise return 0. gdb_caching_proc have_mpx { global srcdir |