Setting CPUTYPE and CFLAGS in make.conf

RW fbsd06 at
Wed Apr 9 17:44:40 UTC 2008

On Tue, 8 Apr 2008 13:14:45 -0700
"David Allen" <the.real.david.allen at> wrote:

> The advice I've read in several posts on the subject involve
> everything from setting one, setting both, to ignoring both,
> sometimes with the =? notation and sometimes without.  And then, I've
> read comments that suggest when compiling the kernel, for example,
> both are ignored, and default values (tucked away somewhere) are
> always applied.  IIRC, the handbook recommends at least setting

Avoid setting CFLAGS unless you have a good reason - Gentoo
documentation has a lot to answer for. CPUTYPE causes "-march" to be
applied, so it can affect compatibility. AFAIK both setting do affect
world and kernel because CFLAGS can cause a build to fail, and I've
seen matching march settings in kernel builds.

> Or are those settings relevant to the
> compilation process only?  Or to both the compilation process and the
> actual performance of the binary?

It can be either, -O2 is related to execution, -pipe speeds-up

More information about the freebsd-questions mailing list