WITH_CTF vs -g

George Neville-Neil gnn at neville-neil.com
Fri Sep 26 14:52:33 UTC 2014


On 26 Sep 2014, at 1: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,

Can you put this up in Phabricator?  reviews.freebsd.org

Best,
George


> 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 @@ __<bsd.own.mk>__:
>
> .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
> _______________________________________________
> freebsd-dtrace at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20140926/611779f8/attachment.sig>


More information about the freebsd-toolchain mailing list