From owner-freebsd-dtrace@FreeBSD.ORG Thu Sep 25 22:46:46 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CA3DCD2; Thu, 25 Sep 2014 22:46:46 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD7FBC6F; Thu, 25 Sep 2014 22:46:45 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id x13so5990440qcv.9 for ; Thu, 25 Sep 2014 15:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a76s+FYI6vw0sM8t7jrFD1TR/coYIoN7TvXrCYwZ2Qg=; b=srr9pQyj1j+B1JDvbc338cfmTJV1zMAsW7jkQ5dTKXMODxmo05FE1sJEDazx3YUWzi FSADcfmWf2aLII6fTLLn1SN04n452S1xl6qX+yVFWnnVTbVXzeC3z7rl69ehL/2iyzKm z0CKAgGrYNmAYcfFGtKAbMoB6QuYgG7J+fK+dNRe+sUwzVhxmxwT6HV77YvU+XwBrnSi Nx4Wv/NqwCuTav1QdLhoYQNrh+4xPI0YxseIDvb2NzFG3prh/io7gcsArfyn+jmV2TuD +tcGrvMup3TeGWOUWynTRcC/RjJi/0xWo1Uw/ZYUVIf0DGtuToIe4YGLNSgT79cXylZT 6kXg== X-Received: by 10.140.102.215 with SMTP id w81mr25589102qge.67.1411685204868; Thu, 25 Sep 2014 15:46:44 -0700 (PDT) Received: from ip-172-31-25-62.ec2.internal (ec2-54-85-57-1.compute-1.amazonaws.com. [54.85.57.1]) by mx.google.com with ESMTPSA id h30sm3192266qge.38.2014.09.25.15.46.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Sep 2014 15:46:44 -0700 (PDT) Sender: Mark Johnston Date: Thu, 25 Sep 2014 22:51:42 +0000 From: Mark Johnston To: Andriy Gapon Subject: Re: WITH_CTF vs -g Message-ID: <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> References: <54108909.7050908@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54108909.7050908@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-toolchain@FreeBSD.org, freebsd-dtrace@FreeBSD.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:46:46 -0000 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. Thanks, -Mark 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