> Date: Sun, 25 Mar 2012 23:11:17 -0700
> From: Philip Guenther <[email protected]>
> 
> On Sat, 24 Mar 2012, Woodchuck wrote:
> > Recently, working with a yacc grammar, I had the occasion to export 
> > YYDEBUG=1 to the environment.  Running make then caused a spew of 
> > yydebug: messages to the console.  These appear to emanate from ld(1).
> ...
> > Perhaps the culprit is in /usr/src/gnu/binutils/ld/ldgram.y, where
> > this code exists:
> ...
> > #ifndef YYDEBUG
> > #define YYDEBUG 1
> > #endif
> 
> It's that YYDEBUG chunk that's causing it, yes.  The obvious diff to 
> remove that from ldgram.y works.  This appears to have been from the 
> initial import, which means it's probably the default in the binutils 
> source distributions.  If making that change and pushing it back to the 
> binutils people turns people's stomaches' there's the alternative of 
> turning it off locally.  Diff below...

It is GNU "policy" to compile with debug options enabled.  Not a bad
policy, since it makes for easier debugging when you encounter a bug.
It's the same reason why I always compile my kernels with -g.

Why the origional poster certainly was suprprised, I don't think it's
a serious issue.  I don't think there is a huge overhead, and the
behaviour has been present since 1995 and I've never seen anybody
complain about it.  And one day, this may become handy.

> Index: Makefile.bsd-wrapper
> ===================================================================
> RCS file: /cvs/src/gnu/usr.bin/binutils/Makefile.bsd-wrapper,v
> retrieving revision 1.76
> diff -u -p -r1.76 Makefile.bsd-wrapper
> --- Makefile.bsd-wrapper      30 Oct 2011 20:57:06 -0000      1.76
> +++ Makefile.bsd-wrapper      26 Mar 2012 06:09:32 -0000
> @@ -2,6 +2,8 @@
>  
>  NEW_BINUTILS=alpha amd64 arm hppa hppa64 i386 mips64 powerpc sh sparc sparc64
>  
> +CFLAGS += -DYYDEBUG=0
> +
>  .for _arch in ${MACHINE_CPU}
>  .  if !empty(NEW_BINUTILS:M${_arch})
>  USING_NEW_BINUTILS?=yes

Reply via email to