Marc G. Fournier
2006-Sep-12 12:25 UTC
optimization levels for 6-STABLE build{kernel,world}
What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf for building kernel/world? I know awhile back it wasn't recommended to go above -O2, for instance, but suspect that has changed ... ? Thanks ... ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email . scrappy@hub.org MSN . scrappy@hub.org Yahoo . yscrappy Skype: hub.org ICQ . 7615664
Marc G. Fournier wrote:> What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf for > building kernel/world? I know awhile back it wasn't recommended to go > above -O2, for instance, but suspect that has changed ... ?CFLAGS=-O2 -pipe -fno-strict-aliasing COPTFLAGS=-O2 -pipe -fno-strict-aliasing CPUTYPE?=prescott .. just works(tm) for an Intel T-2300 dual core ;-) Using -O3 will get you into bother with the amount of inlining the compiler wants to do to the kernel, Michael
On Tue, Sep 12, 2006 at 04:22:51PM -0300, Marc G. Fournier wrote:> > What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf for > building kernel/world? I know awhile back it wasn't recommended to go > above -O2, for instance, but suspect that has changed ... ?Nothing above -O2 is supported. Period. If you try another value and something breaks, don't report it unless you can verify it happens with -O or -O2. For many applications, -O2 will perform better than -O3 so you need to benchmark individual applications. For most applications, there's simply no point. -- Brooks -------------- 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-stable/attachments/20060912/30cf52ab/attachment.pgp
On Tue, September 12, 2006 12:22 pm, Marc G. Fournier wrote:> What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf > for building kernel/world? I know awhile back it wasn't recommended > to go above -O2, for instance, but suspect that has changed ... ?The defaults are "-O2 -pipe -fno-strict-aliasing". I stopped manually setting CFLAGS/COPTFLAGS around the time of 5.1 and haven't really noticed any changes in performance. Prior to that, I used "-Os -pipe". There are reported problems with not using -fno-strict-aliasing with parts of the base and/or kernel. And, the first thing anyone will tell you if you run into any compile/runtime errors is to put CFLAGS/COPTFLAGS back to the defaults. :) ---- Freddie Cash fcash@ocis.net
Marc G. Fournier <freebsd@hub.org> wrote: > What are ppl currently using for CFLAGS/COPTFLAGS in /etc/make.conf for > building kernel/world? I know awhile back it wasn't recommended to go > above -O2, for instance, but suspect that has changed ... ? The best optimization is probably to not override the defaults at all, because they're already pretty optimal. In fact, by overriding the defaults there's a good chance to make things worse. :-) The default CFLAGS are "-O2 -pipe -fno-strict-aliasing". Anything above -O2 isn't supported, and using -O2 without -fno-strict-aliasing also isn't supported (and will create broken code for some programs). A common mistake is to specify CFLAGS="-O2 -pipe" and omit -fno-strict-aliasing. That'll shot you in the foot sooner or later. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.'