public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Luis Machado <luisgpm@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Try a couple PAuth compilation flags for gdb.arch/aarch64-pauth.exp
Date: Mon, 11 Jul 2022 15:29:57 +0000 (GMT)	[thread overview]
Message-ID: <20220711152957.413753858407@sourceware.org> (raw)

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

commit f58d9432cdf8a279ed584efdb9791f44bb4dcd9e
Author: Luis Machado <luis.machado@arm.com>
Date:   Thu Jun 30 15:23:56 2022 +0100

    Try a couple PAuth compilation flags for gdb.arch/aarch64-pauth.exp
    
    The -msign-return-address switch has been dropped from GCC, but some
    older compiler may still support it.  Make sure we try both
    -msign-return-address and -mbranch-protection before bailing out when
    running gdb.arch/aarch64-pauth.exp.

Diff:
---
 gdb/testsuite/gdb.arch/aarch64-pauth.exp | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/aarch64-pauth.exp b/gdb/testsuite/gdb.arch/aarch64-pauth.exp
index 76ffd22a7cb..901eb8212c9 100644
--- a/gdb/testsuite/gdb.arch/aarch64-pauth.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-pauth.exp
@@ -25,9 +25,24 @@ if {![is_aarch64_target]} {
 # Build program with address signing forced on.
 standard_testfile
 set compile_flags {debug}
-lappend compile_flags "additional_flags=-msign-return-address=all"
 lappend compile_flags "additional_flags=-fno-inline"
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${compile_flags}] } {
+
+# Records whether the compilation was successful or not.
+set compilation_ok 0
+
+# We need to try a couple compilation flags here because -msign-return-address
+# was dropped at some point, but could still be supported.
+foreach pauth_flag "-mbranch-protection=pac-ret+leaf -msign-return-address=all" {
+    set flags $compile_flags
+    lappend flags "additional_flags=$pauth_flag"
+
+    if {!$compilation_ok && ![prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${flags}] } {
+	set compilation_ok 1
+    }
+}
+
+# If we couldn't compile, just bail out.
+if {!$compilation_ok} {
     return -1
 }


                 reply	other threads:[~2022-07-11 15:29 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=20220711152957.413753858407@sourceware.org \
    --to=luisgpm@sourceware.org \
    --cc=gdb-cvs@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).