Cannot compile with gcc 4.8

dcc@jelmail.com dcc@jelmail.com
Mon Jun 16 11:25:03 UTC 2014


The setting of CPPFLAGS on Arch Linux is done globally in the 
configuration of its "makepkg" tool that is used to build packages. 
Currently it does this:

CPPFLAGS="-D_FORTIFY_SOURCE=2"

I changed my dcc PKGBUILD on Arch so that it appends "-O2" to CPPFLAGS 
and this allows it to compile successfully.

The other thing I tried, which also worked, was to append CPPFLAGS to 
CFLAGS and then unset CPPLAGS. I decided against this approach because 
CPPFLAGS could contain settings other than FORTIFY_SOURCE.

Further discussion on the Arch forum here: 
https://bbs.archlinux.org/viewtopic.php?id=182812

If there is an alternative fix in the future then I'll remove the 
workaround from the package.

Thanks,
John Lane




https://aur.archlinux.org/packages/dc/dcc/PKGBUILD

On 16/06/14 04:55, Sven Willenberger wrote:
>
> On Sun, 15 Jun 2014 07:06:25 GMT
> Vernon Schryver <vjs@rhyolite.com> wrote:
>>
>> I think that putting _FORTIFY_SOURCE into CPPFLAGS is a bug in the
>> Arch Linux packaging system.
>>
>> I also think that checking compiler optimzation levels in cpp is a gcc
>> bug, even there is no way to know whether cpp is running by itself
>> (including as gcc -E) or as a C compiler pre-processor.
>>
>> Judging from a little Google searching, this will be a widespread
>> problem as more Linux distributions get the new gcc features.h and if
>> they make the same choice as Arch Linux of treating -D_FORTIFY_SOURCE
>> as a pre-preprocessor setting (CPPFLAGS) instead of a compiler
>> setting (CFLAGS).  By "widespread", by which I mean not just DCC.
>>
>>
> Reading through this I tried to add -O2 to the CPPFLAGS so that it
> reads:
> CPPLAGS="-D_FORTIFY_SOURCE=2 -O2"
> to makepkg.conf and tried to build the DCC package. Long story short,
> it was successful. I would suggest to the package maintainer that he
> simply add CPPFLAGS+="-O2" to his own build so as not to clash with the
> system makepkg (or simply change to CPPFLAGS="-U_FORTIFY_SOURCE")
>
> I will leave the system-wide package making flags up to the developers
> of Arch (as typically they would be the ones actually making packages.)
> There are many packages that are community added (such as DCC) and as
> this issue starts to crop up more, this thread may server as a good
> frame of reference for "fixes".
>
>
>
>
> _______________________________________________
> DCC mailing list      DCC@rhyolite.com
> http://www.rhyolite.com/mailman/listinfo/dcc




More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.