Aaron,
    I built 3.7 base + OpenVPN for VPN gateway with custom
CFLAGS/LDFLAGS and it worked well for years, even with such aggressive
flags as CFLAGS="-O3 -march=c3 -mmmx -m3dnow -fomit-frame-pointer" and
LDFLAGS="-Wl,-z,combreloc -Wl,-O2 -Wl,--sort-common
-Wl,--enable-new-dtags". But build was broken and I must to fix many
things in OpenBSD makefiles, to get binaries done. Such LDFLAGS
significantly speedups application loading, cause it's doing the same
things as prelink utility, but it link time. CFLAGS helps me speedup C3
500MHz router device as about 20-30%, but it was synthetic measurement
on nbench built with and without CLFAGS. Kernel build was also forced
for such CFLAGS and no stability issue and subjectively more speedy.
    It was few years ago, when I've had mood to compile everything with
all CPU features on. ;-) Looking at this concrete OpenBSD build my
summary is that it took me more than 20h to build it and speedups was
not such significant, comparing that it should took an about 1h to do
the same functionality with release binaries only bit slow. And two
other things to keep on mind: nowadays x86 CPUs has very heuristic
instruction handling/prefetching so it will not speedup as much with
custom CFLAGS; OpenBSD still use gcc 3.3.5 which can't do as good
optimization for new CPUs as to loose time with custom flags build. And
many makefiles in OpenBSD base don't handle CFLAGS/LDFLAGS correctly.
The last time I tried it (about 1/2y. ago), I made only kernel with
custom flags (for kernel it is COPTS variable if I remember right). Rest
of system didn't build and I didn't had a time to bother with broken
makefiles.
    So if you don't want to do HPC, don't loose time with custom flags.
I if you want to do HPC, choose other operating system, cause OpenBSD
strengths are other.

I.

On Sat, 2010-03-27 at 10:05 +0800, Aaron Lewis wrote:

> Hi,
>     Is that possible to modify CFLAG for port installed software ?
> 
>     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.
> 
>     Just want to optimize ports software , during compilation of kernel 
> , i'd comment them out.
> 
>     Does anyone has any ideas ?
> 
>     Thanks in advance !

Reply via email to