Makefile and Kernel Optimizations in 6.0

Kris Kennaway kris at obsecurity.org
Mon Nov 14 20:23:02 GMT 2005


On Mon, Nov 14, 2005 at 10:23:22AM -0500, Gerard Seibert wrote:
> I am presently running FreeBSD 5.4, but am considering upgrading to
> version 6.0 in the near future.
> 
> I have read on this forum that the /etc/make.conf file has been moved in
> version 6.0. I assume that although it has been moved, that it still
> serves the same purpose as it did in the 5.4 version. Is that correct?
> 
> I also read somewhere that version 6 has CFLAGS=O2 set by default. Does
> it also have COPTFLAGS=-O2 set or does it make any difference?
> 
> Finally, I was using something I found in the BSD Hacks book distributed
> by O'Reilly. It has a section on Kernel Optimizations and recommends
> assigning  this to the kernel immediately after the i386 line.
> 
> Makeoptions	COPTFLAGS="O2 - pipe" Actually it goes on to  recommend
> '-funroll-loops' and '-ffast-math' as well. Since I do not know what
> those two are about, I never used them. In any case, is it recommended
> to use any optimization in the kernel in the new 6.0 version?

It's recommended to use the default settings, of course :)

You're unlikely to see a real difference with different compiler
optimizations, and adding weird non-standard options may even cause
problems.

Kris

P.S. -funroll-loops and -ffast-math are commonly used by people who
don't understand what they mean but like the thrill it gives them to
compile their application with secret optimizations (e.g. the word
"fast" makes them feel excited).  However, the former is often not
actually an optimization (which is why it's not on by default), and
the latter can cause incorrect computations (but I think it's
completely irrelevant in the kernel which does not do FP math).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20051114/ae1e7d59/attachment.bin


More information about the freebsd-questions mailing list