tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -current sparc build failure with MKDEBUG=yes/COPTS=-g



On Fri, Nov 18, 2011 at 13:16:45 +0100, Nicolas Joly wrote:

> On Fri, Nov 18, 2011 at 04:57:31PM +1100, matthew green wrote:

> > > Is the attached patch, which clear COPTS, correct ?
> > 
> > that's the wrong answer.  a quick workaround would be to
> > stop installing two copies of the same binary and have
> > ofwboot and ofwboot.net linked together.
> 
> Ok. Here's the patch that fix it by using COPY/LINK instead of
> COPYDIR.
> 
> > ideally, we should strip -g these for installation, but
> > leave the debug info somewhere.
> 
> Agreed. I'll keep it in mind ...
> 
> > wait.  is that COPTS=-g also means "no -O"?  if so, then
> > i recommend that you use "COPTS=-g -O2".  actually, i've
> > always thought the right way is to set DBG, not COPTS.
> 
> Actually, i do add -g to COPTS in mk.conf :
> 
> MKDEBUG=        yes
> .if !defined(KERNEL_BUILD) && ${MKDEBUG:Uno} != no
> COPTS+=         -g
> .endif

There's an ancient bug in sys/conf/Makefile.kern.inc - it does't
implement the same semantic for DBG and COPTS as the rest of the tree:

DEFCOPTS?=      -O2
COPTS?=         ${DEFCOPTS}
DBG=            # might contain unwanted -Ofoo


People have been bitten by this time and again, when they thing they
add -g via COPTS but in fact they lose -O2.

-uwe


Home | Main Index | Thread Index | Old Index