aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-07-18 06:13:45 +0200
committerTom de Vries <tdevries@suse.de>2022-07-18 06:13:45 +0200
commit9d9dd861e9815829124a4413f0446e3bcc119dca (patch)
tree7d9b46587e9d43608ab4fd83dc7a80dbc7e76720 /gdb/testsuite/gdb.base/step-indirect-call-thunk.exp
parent68a5118c481da16f81874a92f4daaab4dcdc5d89 (diff)
downloadfsf-binutils-gdb-9d9dd861e9815829124a4413f0446e3bcc119dca.zip
fsf-binutils-gdb-9d9dd861e9815829124a4413f0446e3bcc119dca.tar.gz
fsf-binutils-gdb-9d9dd861e9815829124a4413f0446e3bcc119dca.tar.bz2
[gdb/testsuite] Fix regression in step-indirect-call-thunk.exp with gcc 7
Since commit 43127ae5714 ("Fix gdb.base/step-indirect-call-thunk.exp") I run into: ... gdb compile failed, gcc: error: unrecognized command line option \ '-fcf-protection=none'; did you mean '-flto-partition=none'? UNTESTED: gdb.base/step-indirect-call-thunk.exp: failed to prepare ... The problem is that -fcf-protection is supported starting gcc 8, but I'm using system gcc 7.5.0. Fix this by only adding -fcf-protection=none for gcc 8 and later. Tested on x86_64-linux, with gcc 7.5.0, 8.2.1 and 12.1.1.
Diffstat (limited to 'gdb/testsuite/gdb.base/step-indirect-call-thunk.exp')
-rw-r--r--gdb/testsuite/gdb.base/step-indirect-call-thunk.exp6
1 files changed, 5 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