Subject: Re: Anti-Optimizing Build (Was Re: optimizing compilation of
To: Nate Hill <>
From: Frederick Bruckman <>
List: tech-toolchain
Date: 09/15/2003 22:16:34
On Mon, 15 Sep 2003, Frederick Bruckman wrote:

> On Tue, 16 Sep 2003, Nate Hill wrote:
> > On Mon September 15 2003 00:46, Scott Zahn wrote:
> > > Hey all, I'm in the process of upgrading netbsd 1.6 to
> > > netbsd-current on my box.  I really want to optimize the binaries
> > > I'm compiling.  Is there a better way to specify gcc flags other
> > > than editing the 20 or so Makefiles and configure scripts?  I
> > > already have CFLAGS and CPPFLAGS set in my environment, but they
> > > don't seem to have any affect.  If anyone could point me in a good
> > > direction, I'd appreciate it.
> >
> > 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?
> Setting DBG=-g in the environment should do it.

To not strip the installed binaries, you can set STRIPFLAG to ""
(empty) in the environment. That's not strictly necessary, as long as
you retain the unstripped binaries in the object directories, as you
can use them to debug core dumps or even live processes launched with
the stripped binaries, the running image being the same.