Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2006 11:05:44 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: optimization levels for 6-STABLE build{kernel,world}
Message-ID:  <200609130905.k8D95idk062789@lurza.secnetix.de>
In-Reply-To: <20060912161603.R1031@ganymede.hub.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.


'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'



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