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

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

 



Hi


On Wed, May 8, 2013 at 10:20 AM, Ralf Corsepius <rc040203@xxxxxxxxxx> wrote:

> On 05/08/2013 04:00 PM, Zack Weinberg wrote:
>
>> On Wed, May 8, 2013 at 1:17 AM, Allan McRae <allan@xxxxxxxxxxxxx> wrote:
>>
>>> 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 think the quick fix from your end is to move -D_FORTIFY_SOURCE to
>> CFLAGS (and presumably also CXXFLAGS).
>>
>
> FWIW: This is what Fedora and RH are doing for years.


And I believe it is how Arch worked before. Previously flags were

CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

and now they are

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

Allan can provide more information about why -D_FORTIFY_SOURCE=2 was moved
to preprocessor flags.


I also have another (probably naive) question. Why autoconf uses CPPFLAGS
(and not CPPFLAGS+CXXFLAGS) for headers discovery? Is it because it passes
the program through preprocessor only and does not care whether programs
compiles? If my statement true then seems the solution for Arch is either
a) move _FORTIFY_SOURCE back to CFLAGS, or b) add -O2 to CPPFLAGS, yes -O2
is not a preprocessor flag, but other flag (_FORTIFY_SOURCE) requires it.

Or c) autoconf should use CFLAGS for header preprocessing (almost sure that
autoconf people would not like it).
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux