CPUTYPE and gcc optimizations

Steve Mynott steve.mynott at gmail.com
Sun Feb 11 02:48:53 PST 2007


It depends whether it appears to speed up the code you are compiling
up or not!  And the only way you will know this is if you try it.
Although benchmarks tend to lie anyway and "magic bullets" not exist.
The best way of doing this, at least for packages, would be to port

/usr/pkgsrc/devel/cpuflags

so that it works with DragonFly

I have modified for my system

CFLAGS+=-march=pentium3 in the BSD_PKG_MK section of /etc/mk.conf

This seems to speed up ubench anyway.

I doubt there is much point in setting it for kernel compiles,
although perhaps world.
To be honest playing with GCC optimisation flags rarely seems to speed
up stuff in the real world that much and increases the chance of
errors.
YMMV

Cheers Steve

On 2/11/07, Petr Janda <elekktretterr at exemail.com.au> wrote:
Hey everyone,

I'm wondering if its good o set CPUTYPE for extra optimization, or if
its ok to set any other extra  compiler optimizations other than the
default.
Thanks,

Petr






More information about the Users mailing list