[PATCH] Fix various tests to use -no-pie linker flag when needed

Simon Marchi simon.marchi@polymtl.ca
Wed Oct 17 15:51:00 GMT 2018


On 2018-10-17 11:47, Pedro Alves wrote:
> 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’

Ah, I just assumed that gcc supported it since virtually forever, but 
no.

>> But for now, I don't think it's worth the extra work.
> 
> I disagree.

Given that new information, I agree with you disagreeing.

Simon



More information about the Gdb-patches mailing list