public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Fix gdb.reverse/step-indirect-call-thunk.exp with -fcf-protection
Date: Fri, 30 Dec 2022 16:48:29 +0100	[thread overview]
Message-ID: <20221230154829.4165-1-tdevries@suse.de> (raw)

On Ubuntu 22.04.1 x86_64, I run into:
...
gdb.reverse/step-indirect-call-thunk.c: In function 'inc':^M
gdb.reverse/step-indirect-call-thunk.c:22:1: error: '-mindirect-branch' and \
  '-fcf-protection' are not compatible^M
   22 | {                /* inc.1 */^M
      | ^^M
...

Fix this by forcing -fcf-protection=none, if supported.

Tested on x86_64-linux.
---
 .../gdb.reverse/step-indirect-call-thunk.exp      | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
index 3f1f5381f09..1234a042645 100644
--- a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
+++ b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
@@ -20,9 +20,18 @@ if { ![supports_reverse] } {
 
 standard_testfile
 
-set cflags "-mindirect-branch=thunk -mfunction-return=thunk"
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
-        [list debug "additional_flags=$cflags"]] } {
+set cflags {}
+lappend cflags debug
+lappend cflags additional_flags=-mindirect-branch=thunk
+lappend cflags additional_flags=-mfunction-return=thunk
+
+set fcf_protection_none additional_flags=-fcf-protection=none
+if { [gdb_can_simple_compile fcf-protection-none {int main () { return 0; }} \
+	  executable $fcf_protection_none] } {
+    lappend cflags $fcf_protection_none
+}
+
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile $cflags] } {
     return -1
 }
 

base-commit: b1b0f69cb4a2ccd421419f9703edfcc5c3032dc0
-- 
2.35.3


                 reply	other threads:[~2022-12-30 15:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221230154829.4165-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).