Subject: Re: Error in ip_nat.c when building -current
To: Martin Husemann <>
From: Blair Sadewitz <>
List: current-users
Date: 05/23/2007 17:57:59
Is there a reason why you'd want to build the kernel with -O3?  That
is, by and large -O3 tends to bloat code, often with performance
losses.  For certain specialized applications (such as multimedia
CODECs, graphics applications, etc.) it can help.  However, if the
kernel could benefit from such optimization, I'd imagine you'd want to
do some profiling first and apply it selectively to individual source

For many modern CPUs, the performance of -Os can often exceed that of
-O3, as the main bottleneck is memory, not CPU speed.  With -Os, you
can fit more of the kernel into the L1 cache.

I don't bother with optimization flags other than -O2 with the kernel,
unless it's something specifically indicated for some reason, e.g.
machine related (-maccumulate-outgoing-args, -march/-mtune), etc.

I recommend trying -march/-mtune and -fomit-frame-pointer (which
interestingly enough produces slightly LARGER binaries on i386, heh)
first after building a profiling kernel.

Good luck,