Subject: Re: C compiler flags
To: None <pkgsrc-users@NetBSD.org>
From: Christian Biere <christianbiere@gmx.de>
List: pkgsrc-users
Date: 11/20/2006 09:34:44
Matthias Scheler wrote:
> On Mon, Nov 20, 2006 at 12:20:35AM +0100, Roland Illig wrote:
> > >1.) Please do *not* modify "CFLAGS" in "/etc/mk.conf". You will cause
> > >    various build failures.

> > It's mentioned in the pkgsrc guide, so why shouldn't one do that?

> http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=34844

I think you unnecessarily dumb things down. The compiler error there
had absolutely *nothing* to do with optimization flags. It is clear
that there are compiler flags that cannot be used there without a
lot of trouble and -D or -U are quite obviously flags one wouldn't
use except for *certain* packages unless you know what you're doing.
 
> They might not use that because the "Makefile" doesn't try to use
> "-O2" in the first place.

Many software has a very simple build system, sometimes even a
single Makefile. The absence of some compiler flags does not indicate
that these flags would be a bad choice. Furthermore, if one is
paranoid about -Ox, then -O2 is the best choice of all. I've seen a lot
more trouble at -O0 (or no -Ox) including compiler crashes than with a
generic -O2. YMMV.

-- 
Christian