Subject: Re: Anti-Optimizing Build (Was Re: optimizing compilation of netbsd-current)
To: None <>
From: Greg A. Woods <>
List: tech-toolchain
Date: 09/16/2003 02:53:38
[ On Tuesday, September 16, 2003 at 00:13:27 (+0000), Nate Hill wrote: ]
> Subject: Anti-Optimizing Build (Was Re: optimizing compilation of netbsd-current)
> I to would like to know if there are any simple ways to control 
> optimization in a -current build (sources w/, but for 
> different reasons. I want to disable all compiler optimizations (-O* 
> -> -O0) and enable complete "debugging". I want full symbol tables 
> and non-stripped binaries. Anyone know a simple way to do this 
> globally?

I had to make a few mods to the share/mk files to get everything to work
properly, but I have been building with '-g' in both -current as of
about 1.5W now the netbsd-1-6 branch.  In theory the same mods I made
can be used to turn off optimization too though I've not actually tested
that yet across the full tree (the parts I did test seemed to work).

The end result is that I can control all these things from /etc/mk.conf:

# Note DBG and OPTIM must not use ?= and must not be defined if you
# want the defaults in <> to take effect.
DBG =           -g
#OPTIM =        -O2

# set LDSTATIC=-static in order to build a static-only system
z# (note you need a fair bit of disk for '-g' and '-static' :-)
LDSTATIC =      -static

Note what I have working at the moment is really only useful for the
netbsd-1-6 branch, but it should be easy enough to patch forward to
-current if you're willing to muck with the mk files.  Let me know if
you want my diffs.

						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <>
Planix, Inc. <>          Secrets of the Weird <>