From owner-freebsd-current@FreeBSD.ORG Tue Jan 20 11:47:21 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F8B016A4CE for ; Tue, 20 Jan 2004 11:47:21 -0800 (PST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDFEE43D4C for ; Tue, 20 Jan 2004 11:47:07 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 16563 invoked from network); 20 Jan 2004 19:47:03 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 20 Jan 2004 19:47:03 -0000 Received: from 10.50.41.236 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i0KJieM2014221; Tue, 20 Jan 2004 14:46:02 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Bruce Evans , Ruslan Ermilov Date: Tue, 20 Jan 2004 13:19:52 -0500 User-Agent: KMail/1.5.4 References: <200401190738.i0J7ccF3020266@postoffice.e-easy.com.au> <20040119083303.GF39956@FreeBSD.org.ua> <20040121005140.D4640@gamplex.bde.org> In-Reply-To: <20040121005140.D4640@gamplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401201319.52943.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-current@freebsd.org Subject: Re: Release Building and /etc/make.conf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 19:47:21 -0000 On Tuesday 20 January 2004 09:41 am, Bruce Evans wrote: > On Mon, 19 Jan 2004, Ruslan Ermilov wrote: > > On Mon, Jan 19, 2004 at 06:23:30PM +1100, Chris Knight wrote: > > > Howdy, > > > > > > I'm just doing a release build of 5.2 and have noticed that > > > from Stage 4.2 onwards, -mcpu=pentiumpro is added to the cc > > > command line. > > > The only place I can see this being set is in /etc/make.conf > > > which is outside the sandbox. > > > I was expecting the release build to be CPU agnostic, but > > > this doesn't appear to be the case. Any way of overriding > > > this without modifying /etc/make.conf? > > Is there a problem with modifying /etc/make.conf? As maxim said, > you can avoid /etc/make.conf using __MAKE_CONF. You can also set > CPUTYPE in the environment. Beware that settings in the enviroment > might not have precedence over settings in /etc/make.conf. Anyway, > -mcpu=pentiumpro is not actually set in /etc/make.conf. As ru doesn't > > quite say, it is set in bsd.cpu.mk: > > There's a substantional difference between -mcpu and -march: > > : -mcpu=cpu type > > : Assume the defaults for the machine type CPU TYPE when schedul- > > : ing instructions. The choices for CPU TYPE are: i386, i486, > > : i586 (pentium), pentium, i686 (pentiumpro), and pentiumpro. > > : While picking a specific CPU TYPE will schedule things appropri- > > : ately for that particular chip, the compiler will not generate > > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > : any code that does not run on the i386 without the -march=cpu > > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > : type option being used. > > : > > : -march=cpu type > > : Generate instructions for the machine type CPU TYPE. The choic- > > : es for CPU TYPE are: i386, i486, pentium, and pentiumpro. Spec- > > : ifying -march=cpu type implies -mcpu=cpu type. > > > > Please also see the commit log for bsd.cpu.mk,v 1.13. > > Also see gcc.info, since the above seems to be from gcc.1 which is as out > of date as a pentiumpro. > > bsd.cpu.mk should rarely be edited, but /etc.make.conf is per-machine so > you can put anything you want in it. However, defaulting to > -mcpu=pentiumpro is just a bug, so I edit it out of bsd.cpu.mk. It > just micro-pessimizes for all CPUs that aren't pentium pros. This is > almost harmless for i386's because no one uses them, and almost harmless > for P3's and maybe P4's because they share some bottlenecks with > pentiumpros, but Athlons handle naive i386 code better than pentiums so > many of the pentiumpro optimizations are pessimizations for athlons. The choice if ppro was Peter's suggestion. Feel free to offer a better default CPU to tune for. > Note that CPUTYPE has worse bugs for i386's. Setting it to a supported > CPU gives -march instead of -mcpu, so using it gives unportable binaries, > and bsd.cpu.mk provides no way to get the corresponding -mcpu settings. > OTOH, CPUTYPE for alphas gives only -mcpu. That is by design. Note that on all non-i386 architectures such as alpha, etc. -mcpu means the same thing as -march. The other architectures use -mtune to get the same effect as -mcpu on i386. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org