Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2006 03:08:23 -0700
From:      Pete Slagle <freebsd-stable@voidcaptain.com>
To:        olli@lurza.secnetix.de
Cc:        freebsd-stable@Freebsd.org
Subject:   Re: optimization levels for 6-STABLE build{kernel,world}
Message-ID:  <4507D897.4030502@voidcaptain.com>
In-Reply-To: <200609130905.k8D95idk062789@lurza.secnetix.de>
References:  <200609130905.k8D95idk062789@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Fromme wrote:

> Marc G. Fournier <freebsd@hub.org> 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?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4507D897.4030502>