From owner-freebsd-stable@FreeBSD.ORG Wed Sep 13 10:19:16 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0008116A407 for ; Wed, 13 Sep 2006 10:19:15 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7256143D45 for ; Wed, 13 Sep 2006 10:19:15 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 2188D5C74; Wed, 13 Sep 2006 14:19:14 +0400 (MSD) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id DC1AE5C0D; Wed, 13 Sep 2006 14:19:13 +0400 (MSD) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id k8DAJFw9014148; Wed, 13 Sep 2006 14:19:15 +0400 (MSD) (envelope-from ru) Date: Wed, 13 Sep 2006 14:19:15 +0400 From: Ruslan Ermilov To: Pete Slagle Message-ID: <20060913101915.GA13946@rambler-co.ru> References: <200609130905.k8D95idk062789@lurza.secnetix.de> <4507D897.4030502@voidcaptain.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <4507D897.4030502@voidcaptain.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: freebsd-stable@freebsd.org, olli@lurza.secnetix.de Subject: Re: optimization levels for 6-STABLE build{kernel,world} X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 10:19:16 -0000 --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 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--