[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2"
From: |
Anatol Pomozov |
Subject: |
Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2" |
Date: |
Wed, 8 May 2013 11:26:41 -0700 |
Hi
On Wed, May 8, 2013 at 10:20 AM, Ralf Corsepius <address@hidden> wrote:
> On 05/08/2013 04:00 PM, Zack Weinberg wrote:
>
>> On Wed, May 8, 2013 at 1:17 AM, Allan McRae <address@hidden> 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 does not like "-D_FORTIFY_SOURCE=2 -O2", Anatol Pomozov, 2013/05/07
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Paul Eggert, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Allan McRae, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Ralf Corsepius, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2",
Anatol Pomozov <=
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Paul Eggert, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Allan McRae, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Eric Blake, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Allan McRae, 2013/05/09
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Paul Eggert, 2013/05/08
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Zack Weinberg, 2013/05/09
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Paul Eggert, 2013/05/09
- Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Mike Frysinger, 2013/05/09
Re: Autoconf does not like "-D_FORTIFY_SOURCE=2 -O2", Mike Frysinger, 2013/05/08