This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -fPIC -fPIE


On Wed, Nov 21, 2012 at 8:02 PM, Ian Lance Taylor <iant@google.com> wrote:
>> The main advantage is that you can compile a program with CFLAGS="-O2 -g
>> -fPIE", and libtool's adding of -fPIC for shared libraries will work
>> reliably.  If -fPIE can still override -fPIC, the result depends on
>> whether -fPIC comes before or after CFLAGS.
>
> ...which is exactly how all our other options work.  The last one
> wins.  Why should these be different?

Most other options are not added by the build system automatically
with the presumption that they always override the default.

> Using -fPIE in CFLAGS for
> libtool seems like a very specific use case

It's actually a very common use case for distributions that want to
harden some binaries.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]