Bug 201445 - bsd.prog.mk explicitly spams CFLAGS with -g if MK_DEBUG_FILES!= no, but bsd.lib.mk doesn't
Summary: bsd.prog.mk explicitly spams CFLAGS with -g if MK_DEBUG_FILES!= no, but bsd.l...
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-09 21:57 UTC by Enji Cooper
Modified: 2015-10-17 08:54 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2015-07-09 21:57:13 UTC
This is inconsistent/confusing. Either both bsd.lib.mk and bsd.prog.mk should append -g to CFLAGS/CTFFLAGS, or neither should:

Sources based off r285261:

$ cd /usr/src
$ cd bin/cp
$ make __MAKE_CONF=/dev/null SRCCONF=/dev/null MK_DEBUG_FILES=yes -VCFLAGS:M-g
-g
$ cd ../../lib/libthr
$ make __MAKE_CONF=/dev/null SRCCONF=/dev/null MK_DEBUG_FILES=yes -VCFLAGS:M-g
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2015-10-16 00:24:42 UTC
Adding bdrewery as CC (and emaste because of MK_DEBUG_FILES). If I have spare cycles I'll work on this.

17:12 < ngie> bdrewery_wfh: do you want to look at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201445 ?
17:12 < ngie> or should i put the change out for CR/commit it?
17:14 < bdrewery_wfh> I can look but not at the moment
17:23 < ngie> bdrewery_wfh: ok. i'll add you as a CC. just didn't want to conflict with any work you were doing there
Comment 2 Ed Maste freebsd_committer freebsd_triage 2015-10-16 00:34:55 UTC
This functions as expected: bsd.lib.mk adds -g to SHARED_CFLAGS and the resulting .so file gets a .debug.
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2015-10-17 08:54:31 UTC
(In reply to Ed Maste from comment #2)

Yeah, it does make sense. Closing (and thanks for the explanation -- would be nice if
there was a comment noting the inconsistency..)