From owner-freebsd-questions Tue Aug 29 17:47: 9 2000 Delivered-To: freebsd-questions@freebsd.org Received: from femail4.sdc1.sfba.home.com (femail4.sdc1.sfba.home.com [24.0.95.84]) by hub.freebsd.org (Postfix) with ESMTP id 3741C37B424 for ; Tue, 29 Aug 2000 17:47:06 -0700 (PDT) Received: from home.com ([24.12.186.185]) by femail4.sdc1.sfba.home.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20000830004619.VMNM8556.femail4.sdc1.sfba.home.com@home.com>; Tue, 29 Aug 2000 17:46:19 -0700 Message-ID: <39ABF71E.A3D8EF@home.com> Date: Tue, 29 Aug 2000 17:47:10 +0000 From: rob X-Mailer: Mozilla 4.74 [en] (X11; U; FreeBSD 4.1-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Mike Meyer Cc: questions@freebsd.org Subject: Re: CFLAGS -O, if I am running a 686, does it automatically target my cpu? References: <14764.5348.342064.352183@guru.mired.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mike Meyer wrote: > > 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. > >