Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Aug 2000 14:54:12 -0500 (CDT)
From:      Mike Meyer <mwm@mired.org>
To:        rob <europax@home.com>
Cc:        questions@freebsd.org
Subject:   CFLAGS -O, if I am running a 686, does it automatically target my cpu?
Message-ID:  <14764.5348.342064.352183@guru.mired.org>
In-Reply-To: <74759745@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

	<mike



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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