Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2006 14:19:15 +0400
From:      Ruslan Ermilov <ru@freebsd.org>
To:        Pete Slagle <freebsd-stable@voidcaptain.com>
Cc:        freebsd-stable@freebsd.org, olli@lurza.secnetix.de
Subject:   Re: optimization levels for 6-STABLE build{kernel,world}
Message-ID:  <20060913101915.GA13946@rambler-co.ru>
In-Reply-To: <4507D897.4030502@voidcaptain.com>
References:  <200609130905.k8D95idk062789@lurza.secnetix.de> <4507D897.4030502@voidcaptain.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--ReaqsoxgOBHFXBhH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 13, 2006 at 03:08:23AM -0700, Pete Slagle wrote:
> Oliver Fromme wrote:
>=20
> > Marc G. Fournier <freebsd@hub.org> wrote:
> >  > What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf =
for=20
> >  > building kernel/world?  I know awhile back it wasn't recommended to =
go=20
> >  > above -O2, for instance, but suspect that has changed ... ?
> >=20
> > 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.  :-)
> >=20
> > 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=3D"-O2 -pipe" and omit -fno-strict-aliasing.
> > That'll shot you in the foot sooner or later.
>=20
> /etc/make.conf on most of my 6.1 machines contains (in part) this:
>=20
>    CFLAGS=3D    -O2 -pipe -fno-strict-aliasing
>    COPTFLAGS=3D -O2 -pipe
>=20
> I no longer remember exactly why, but at some point I must have
> understood or assumed that to be the recommendation.
>=20
> Just to be completely clear, are you saying that this
>=20
>    CFLAGS=3D    -O2 -pipe -fno-strict-aliasing
>    COPTFLAGS=3D -O2 -pipe -fno-strict-aliasing
>=20
> would be better in the general case?
>=20
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+=3D -fno-strict-aliasing
: . endif


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--ReaqsoxgOBHFXBhH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFB9sjqRfpzJluFF4RAoyBAJ9IHM20tsHAKNyrBKgGcHhMIk2b1ACghzQ/
nXWu0UoZxA5foao4PwGhf2k=
=SMqG
-----END PGP SIGNATURE-----

--ReaqsoxgOBHFXBhH--



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