Aaron Lewis <aaron.lewis1...@gmail.com> wrote:

>     I read `man mk.conf' found there's no CFLAGS or CXXFLAG entries , 
> even though i tried to
>     put `CFLAG += -O3 -march=i686' into that file , but ports doesn't 
> recognize it.

No such variable is used by the ports infrastructure.  Note the
name, CFLAG is not the same as CFLAGS.

>     Just want to optimize ports software , during compilation of kernel 
> , i'd comment them out.

Yes, you can set CFLAGS and CXXFLAGS in /etc/mk.conf or the environment
and most ports will pick it up.  (Some don't for sound technical
reasons, a few don't and it's an error that needs to be fixed.)

Generally speaking, I advise against playing with gcc's optimization
flags.  You will not see an improvement, and some of these optimization
steps may actually generate incorrect code.  The time you spend
fiddling with these settings will be more than you can ever gain
from them.

I do occasionally set CFLAGS to build a port *without* optimization
when I need to debug a problem with gdb(1).  Single-stepping through
code that has been run through -O2 can be a surreal experience.

-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to