Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Cc: Keith Seitz <keiths@redhat.com>
Subject: Re: [PATCH][gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable
Date: Sat, 17 Aug 2019 07:09:00 -0000	[thread overview]
Message-ID: <7759ea98-851e-4216-a9ed-1dd0d626d6ed@suse.de> (raw)
In-Reply-To: <8592a3b7-56b2-92e8-1450-91882a4d524c@redhat.com>

On 16-08-19 20:48, Pedro Alves wrote:
> On 7/23/19 8:22 AM, Tom de Vries wrote:
>> When running gdb.base/dump.exp with --target_board=unix/-fPIE/-pie, we get:
>> ...
>> Running gdb/testsuite/gdb.base/dump.exp ...
>> FAIL: gdb.base/dump.exp: dump array as value, intel hex
>> ...
>>
>> The FAIL happens because although the test specifies nopie, the exec is
>> in fact compiled as PIE.  The "-fPIE -pie" options specified using the
>> target_board are interpreted by dejagnu as multilib_flags, and end up
>> overriding the nopie flags.
> 
> I'd think it would be better to temporarily strip out -fPIE/-pie (*)
> from multilib_flags if nopie is set?
> 
> (*) - and/or the contents of gdb,pie_ldflag gdb,pie_flag.
>  

I'm not sure about that.

I think the rationale you're applying here is to test as much as
possible in a single run: testing more is better.

But AFAIU, the implicit assumption about multilib flags is that a range
of multilib flags is tested (because multilib flags select different
libraries, so in order to claim complete testing you'd have to test all
libraries). In other words, taking the -m32/-m64 example, that you'd
test both with --target_board='unix/-m64' and
--target_board='unix/-m32'. So, if a test-case only works for -m32, then
forcing it to -m32 for unix/-m64 only makes sure you run the test twice
in identical fashion. In which case testing more is not better, just longer.

[ The same approach is used in gcc testing: a testcase can require a
certain effective target, and multilib flags influence whether the
effective target is available or not, and if not, the test is skipped as
unsupported. ]

Thanks,
- Tom


      reply	other threads:[~2019-08-17  7:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  7:22 Tom de Vries
2019-07-29  9:57 ` Alan Hayward
2019-07-30  1:20   ` Simon Marchi
2019-08-05 10:57     ` [committed][gdb/testsuite] Fail in gdb_compile if pie results in non-PIE executable Tom de Vries
2019-08-16 18:49 ` [PATCH][gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable Pedro Alves
2019-08-17  7:09   ` Tom de Vries [this message]

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=7759ea98-851e-4216-a9ed-1dd0d626d6ed@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=palves@redhat.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