Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2006 12:17:15 +0300
From:      Stefan Lambrev <stefan.lambrev@sun-fish.com>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: optimization levels for 6-STABLE build{kernel,world}
Message-ID:  <4507CC9B.60704@sun-fish.com>
In-Reply-To: <200609130905.k8D95idk062789@lurza.secnetix.de>
References:  <200609130905.k8D95idk062789@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

Oliver Fromme wrote:
> 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
>
>   
May be default flags have to be set here:
/usr/src/share/examples/etc/make.conf ?
I'm asking because in this file I read:

# CFLAGS controls the compiler settings used when compiling C code.
# Note that optimization settings other than -O and -O2 are not recommended
# or supported for compiling the world or the kernel - please revert any
# nonstandard optimization settings to "-O" or -O2 before submitting bug
# reports without patches to the developers.
#
#CFLAGS= -O -pipe

May be "-fno-strict-aliasing" have to be added here then ?

-- 
Best Wishes,
Stefan Lambrev
ICQ# 24134177




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4507CC9B.60704>