Subject: Kernel optimizations!
To: None <netbsd-help@netbsd.org>
From: Sung N. Cho <sucho2@vt.edu>
List: netbsd-help
Date: 05/09/2002 19:51:23
Hi,

I was wondering, shouldn't turning on the optimization for gcc make the 
kernel bigger?

I added in my /etc/mk.conf the following lines:

COPTS+= -O3 -mcpu=i686 -march=i686
CXXFLAGS+= -O3 -mcpu=i686 -march=i686
CFLAGS+= -O3 -mcpu=i686 -march=i686

Then compiled the kernel.  The prior size for the kernel which was compiled 
with default -O2 option was 2.4M.  This new kernel with -O3 option turned on 
have now even smaller size, 1.8M!  I thought the kernel size would get little 
bigger, so was everyone saying to me.  The system doesn't seem to have any 
malfuctions ( and the kernel infact did compile without any error! ) and it's 
running fine.  Was this the case before or the gcc just got improved?  Or was 
the konqueror file manager fooling me?  If you don't believe the reduced 
size, see for yourself. :)


Yours sincerely,
Sung N. Cho,
Thursday, May 09, 2002.