On Wed, Sep 13, 2006 at 03:08:23AM -0700, Pete Slagle wrote: > Oliver Fromme wrote: > > > Marc G. Fournier <[EMAIL PROTECTED]> wrote: > > > What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf for > > > building kernel/world? I know awhile back it wasn't recommended to go > > > above -O2, for instance, but suspect that has changed ... ? > > > > The best optimization is probably to not override the > > defaults at all, because they're already pretty optimal. > > In fact, by overriding the defaults there's a good chance > > to make things worse. :-) > > > > The default CFLAGS are "-O2 -pipe -fno-strict-aliasing". > > Anything above -O2 isn't supported, and using -O2 without > > -fno-strict-aliasing also isn't supported (and will create > > broken code for some programs). A common mistake is to > > specify CFLAGS="-O2 -pipe" and omit -fno-strict-aliasing. > > That'll shot you in the foot sooner or later. > > /etc/make.conf on most of my 6.1 machines contains (in part) this: > > CFLAGS= -O2 -pipe -fno-strict-aliasing > COPTFLAGS= -O2 -pipe > > I no longer remember exactly why, but at some point I must have > understood or assumed that to be the recommendation. > > Just to be completely clear, are you saying that this > > CFLAGS= -O2 -pipe -fno-strict-aliasing > COPTFLAGS= -O2 -pipe -fno-strict-aliasing > > would be better in the general case? > Doesn't matter; kern.pre.mk will automatically add -fno-strict-aliasing to COPTFLAGS if needed:
: . if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) : COPTFLAGS+= -fno-strict-aliasing : . endif Cheers, -- Ruslan Ermilov [EMAIL PROTECTED] FreeBSD committer
pgpXqRQmgleu1.pgp
Description: PGP signature