From owner-freebsd-toolchain@FreeBSD.ORG Fri Sep 26 15:59:40 2014 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AA67C4D; Fri, 26 Sep 2014 15:59:40 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1F36DE50; Fri, 26 Sep 2014 15:59:38 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA10883; Fri, 26 Sep 2014 18:59:36 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XXXvk-000NvE-F1; Fri, 26 Sep 2014 18:59:36 +0300 Message-ID: <54258D30.8040107@FreeBSD.org> Date: Fri, 26 Sep 2014 18:58:40 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Mark Johnston Subject: Re: WITH_CTF vs -g References: <54108909.7050908@FreeBSD.org> <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> In-Reply-To: <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@FreeBSD.org, freebsd-dtrace@FreeBSD.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 15:59:40 -0000 On 26/09/2014 01:51, Mark Johnston wrote: > On Wed, Sep 10, 2014 at 08:23:21PM +0300, Andriy Gapon wrote: >> >> In my opinion WITH_CTF should imply -g in CFLAGS otherwise, as far as I can see, >> there is nothing to generate CTF data from. Forcing an end-user to remember to >> additionally pass -g is not nice. >> >> Also, I think that we can always have -g in CTFFLAGS, because the stripping step >> takes care of the original DWARF data in any case. But I am not 100% sure about >> this. >> >> What do you think? >> Thanks! > > Hi Andriy, > > Are you planning to go through with this? I was just about to post this > exact question, but then I remembered that you already have. :) > > FWIW, the diff I have in mind is below. It also removes some checks that > I think are unnecessary from bsd.{lib,prog}.mk. It is not fully tested, > but seems to work for me. I'm also not sure about unconditionally > passing -g to ctfconvert and ctfmerge. Mark, your change looks like what I was thinking of. I will it a whirl here. Thank you! > diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk > index f0acf16..c6b689d 100644 > --- a/share/mk/bsd.lib.mk > +++ b/share/mk/bsd.lib.mk > @@ -36,7 +36,7 @@ NO_WERROR= > .if defined(DEBUG_FLAGS) > CFLAGS+= ${DEBUG_FLAGS} > > -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" > +.if ${MK_CTF} != "no" > CTFFLAGS+= -g > .endif > .else > diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk > index 486914b..32556a1 100644 > --- a/share/mk/bsd.own.mk > +++ b/share/mk/bsd.own.mk > @@ -128,6 +128,7 @@ ____: > > .if ${MK_CTF} != "no" > CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} > +DEBUG_FLAGS?= -g > .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) > CTFCONVERT_CMD= > .else > diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk > index 340950a..e4f7104 100644 > --- a/share/mk/bsd.prog.mk > +++ b/share/mk/bsd.prog.mk > @@ -20,7 +20,7 @@ NO_WERROR= > CFLAGS+=${DEBUG_FLAGS} > CXXFLAGS+=${DEBUG_FLAGS} > > -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" > +.if ${MK_CTF} != "no" > CTFFLAGS+= -g > .endif > .endif > -- Andriy Gapon