default CFLAGS

Morgan Wesström freebsd-questions at pp.dyndns.biz
Sat Jan 24 14:44:55 PST 2009


RW wrote:
> On Sat, 24 Jan 2009 21:13:00 +0100
> Morgan Wesström <freebsd-questions at pp.dyndns.biz> wrote:
> 
>> gcc 4.2 and later will figure out the correct -march and -mtune for
>> you automatically if you use CPUTYPE=native. 
> 
> The point I was making before, is that CPUTYPE isn't just passed
> transparently to gcc, it's used for setting other variables, such as
> CFLAGS. So unless you know that CPUTYPE=native is supported by the OS as
> well as the compiler, you probably shouldn't use it in make.conf.

I got that point. As with all tuning you always take the risk of
breaking something but that is a personal choice. From my own experience
I prefer that the compiler choses the optimizations.
I don't know about the base OS but a quick grep through /usr/ports only
reveals 5 or 6 ports that actually checks CPUTYPE and they don't do much
more than setting -march={$CPUTYPE} which is pretty redundant.

Regards
Morgan


More information about the freebsd-questions mailing list