Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2004 18:06:53 -0500 (CDT)
From:      "Conrad J. Sabatier" <conrads@cox.net>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:    Re: builworld fails if debugging enabled in usr.sbin/pkg_install/lib
Message-ID:  <XFMail.20040812180653.conrads@cox.net>
In-Reply-To: <20040812201138.GA79664@ip.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

On 12-Aug-2004 Ruslan Ermilov wrote:
> On Thu, Aug 12, 2004 at 02:58:23PM -0500, Conrad J. Sabatier wrote:
>> 
>> I have the following in /etc/make.conf:
>> 
>> .if defined(DEBUG)
>> CFLAGS+=-g
>> .endif
>> 
>> And then use "make -DDEBUG buildworld".
>> 
> I suspected something like this. 
> src/usr.sbin/pkg_install/*/Makefile's added the contents of the
> DEBUG variable to CFLAGS.  By passing the -DDEBUG to make(1), you
> effectively set the value of the DEBUG variable to 1 (see the make(1)
> manpage), so "1" was added to CFLAGS.
> 
> I've "fixed" these makefiles to not add DEBUG to CFLAGS.  Note that
> the name DEBUG is unsafe to use anyway.  Also, there's an
> alternative and standard way to recompile your programs and libraries
> with -g: there's the DEBUG_FLAGS variable, so you could as well do it
> like this:
> 
>       make buildworld DEBUG_FLAGS=-g
> 
> Passing DEBUG_FLAGS=-g to ``make installworld'' will also cause the
> binaries to *not* be stripped when installing, which is essential
> for having the debugger symbols in binaries.  Please consider
> switching to this method of building world with debug infomation.

Ah, great!  I never knew about this before.  Thanks!

-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20040812180653.conrads>