This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix various tests to use -no-pie linker flag when needed
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, Jan Vrany <jan dot vrany at fit dot cvut dot cz>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 17 Oct 2018 16:47:46 +0100
- Subject: Re: [PATCH] Fix various tests to use -no-pie linker flag when needed
- References: <20180828193643.15530-1-jan.vrany@fit.cvut.cz> <87lg8dvy0o.fsf@tromey.com> <a581ee534cabae20af92f6e47b2c9b08@polymtl.ca> <9dbaccd25aae8bdf1cd96e59ae8f7c9be9cce7db.camel@fit.cvut.cz> <01b5605a3df81c4d773a82e8648051fa@polymtl.ca>
On 10/16/2018 11:18 PM, Simon Marchi wrote:
> On 2018-10-14 05:59, Jan Vrany wrote:
>> No, I don't know how universal -no-pie is. From what I have understood
>> from Simon (https://sourceware.org/ml/gdb-patches/2018-08/msg00662.html),
>> out of the options available -no-pie is still the best bet.
>
> gcc supports it, icc supports it [1], clang supports it starting at version 6 according to my testing. I think this is universal
> enough that we can use it. If somebody stumbles on a compiler that does not understand -no-pie and they really need to use it for
> their testing, they can quite easily add an option for gdb_compile.
Not sure it's that universal. See:
https://github.com/xd009642/tarpaulin/issues/7#issuecomment-317180523
For example, the gcc 4.8 I have handy (our minimum supported version) does
not support it:
$ /opt/gcc-4.8/bin/gcc /home/pedro/gdb/tests/main.c -o main -no-pie
gcc: error: unrecognized command line option ‘-no-pie’
> But for now, I don't think it's worth the extra work.
I disagree.
Thanks,
Pedro Alves