Christian Weisgerber wrote: > 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. > >
Yeah , its a typo , should be 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. > You're right Christian. AFAIK , sqlite can't work with intel mmx instructions , gcc generate wrong asm codes > 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. > > Use CFLAGS to build software with debug information is a good hack , i'll take your suggestion. -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode