From owner-freebsd-questions Tue Aug 29 12:54:58 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (zoom0-050.telepath.com [216.14.0.50]) by hub.freebsd.org (Postfix) with SMTP id 88DD537B422 for ; Tue, 29 Aug 2000 12:54:50 -0700 (PDT) Received: (qmail 26417 invoked by uid 100); 29 Aug 2000 19:54:12 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14764.5348.342064.352183@guru.mired.org> Date: Tue, 29 Aug 2000 14:54:12 -0500 (CDT) To: rob Cc: questions@freebsd.org Subject: CFLAGS -O, if I am running a 686, does it automatically target my cpu? In-Reply-To: <74759745@toto.iv> X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG rob writes: > I am curious about whether make automatically tells gcc to optimize to > my machine's cpu, a 686, or does it optimize to a 386? Reading though > the manuals, I can see that gcc can target a 686 or any other cpu, but I > have no idea what happens when I use make to compile my system or a > port. Rob. I vaguely recall that it optimizes for the *family*. However, the interesting part is found in the -mcpu documentation: the compiler will not generate any code that does not run on the i386 without the -march=cpu type option being used. So you're going to be running 386 instructions on your machine unless you set add a -march flag to the compile. On FreeBSD, you can set these in /etc/make.conf. Use CFLAGS for ports and other userland code, and COPTFLAGS for the kernel.