Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>, Joel Brobecker <brobecker@gnat.com>
Subject: [PATCH][gdb/testsuite] Fix ada tests with -fPIE/-pie
Date: Wed, 07 Aug 2019 11:07:00 -0000	[thread overview]
Message-ID: <20190807110713.GA23000@delia> (raw)

Hi,

When running the gdb testsuite with target board unix/-fPIE/-pie, the
resulting ada executables are not PIE executables, because gnatmake doesn't
recognize -pie, and consequently doesn't pass it to gnatlink.

Fix this by replacing "-pie" with "-largs -pie -margs" for ada test-cases in
gdb_default_target_compile, and doing the same for -no-pie.

Tested on x86_64-linux.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Fix ada tests with -fPIE/-pie

gdb/testsuite/ChangeLog:

2019-08-07  Tom de Vries  <tdevries@suse.de>

	PR testsuite/24888
	* lib/future.exp (gdb_default_target_compile): Route -pie/-no-pie to
	gnatlink for ada.

---
 gdb/testsuite/lib/future.exp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 122e652858..e26e49af91 100644
--- a/gdb/testsuite/lib/future.exp
+++ b/gdb/testsuite/lib/future.exp
@@ -530,7 +530,19 @@ proc gdb_default_target_compile {source destfile type options} {
     }
 
     if {[board_info $dest exists multilib_flags]} {
-	append add_flags " [board_info $dest multilib_flags]"
+	if { $compiler_type == "ada" } {
+	    foreach op [board_info $dest multilib_flags] {
+		if { $op == "-pie" || $op == "-no-pie" } {
+		    # Pretend gnatmake supports -pie/-no-pie, route it to
+		    # linker.
+		    append add_flags " -largs $op -margs"
+		} else {
+		    append add_flags " $op"
+		}
+	    }
+	} else {
+	    append add_flags " [board_info $dest multilib_flags]"
+	}
     }
 
     verbose "doing compile"


             reply	other threads:[~2019-08-07 11:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 11:07 Tom de Vries [this message]
2019-08-07 14:18 ` Tom Tromey
2019-08-07 15:27   ` Tom de Vries
2019-08-08 10:15     ` Tom de Vries
2019-08-21  7:15       ` [PING][PATCH][gdb/testsuite] " Tom de Vries
2019-08-28  7:18         ` [PING^2][PATCH][gdb/testsuite] " Tom de Vries
2019-09-04  8:17           ` [PING^3][PATCH][gdb/testsuite] " Tom de Vries
2019-09-13 19:47             ` [PING^4][PATCH][gdb/testsuite] " Tom de Vries
2019-10-09 14:49         ` [PING][PATCH][gdb/testsuite] " Tom Tromey
2019-10-10 14:03           ` [gdb/testsuite] Compile ada with -lgnarl_pic and -lgnat_pic if required Tom de Vries

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=20190807110713.GA23000@delia \
    --to=tdevries@suse.de \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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