autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2"


From: Allan McRae
Subject: Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2"
Date: Wed, 08 May 2013 15:17:02 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130428 Thunderbird/17.0.5

On 08/05/13 15:01, Paul Eggert wrote:
> On 05/07/2013 08:49 PM, Anatol Pomozov wrote:
> 
>> Linux Arch distributive recently added following compilation flags to
>> CPPFLAGS: "-D_FORTIFY_SOURCE=2 -O2". Unfortunately it breaks autoconf based
>> projects such as gdb, gcc, ...
>>
>> The issue is that autoconf compiles some programs to find whether system
>> has headers. And to compile it uses only preprocessor defines from CPPFLAGS
>> (-D_FORTIFY_SOURCE=2 in case of Arch). recent versions of glibc produces a
>> warning when it compiles apps with _FORTIFY_SOURCE but without -O2.
> 
> Sorry, I don't understand.  If CPPFLAGS="-D_FORTIFY_SOURCE=2 -O2",
> and if 'configure' uses preprocessor defines from CPPFLAGS,
> then 'configure' should be using -D_FORTIFY_SOURCE=2 -O2.
> But you seem to be implying that 'configure' is using -D_FORTIFY_SOURCE=2
> without -O2.  How can this be?

Our distribution packages are compiled with:

CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4"

So when both CPPFLAGS and CFLAGS are passed there is no issue.

I have not looked into this in great detail yet, but it seems some
configure scripts have this in them:

ac_cpp='$CPP $CPPFLAGS'

and this is used to test for header presence.  Note I said some
configure scripts - I have not figured out why others do not use
CPPFLAGS in this test.

>> recent versions of glibc produces a
>> warning when it compiles apps with _FORTIFY_SOURCE but without -O2
> 
> That's a real problem, which will break lots of things.
> Fix that, and your Autoconf issue will go away.

I don't agree that the glibc warning is an issue.  Unless you use
-Werror (bad) or check for any warning rather than a specific one.

Allan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]