Bug 163775 - [patch] sfxge(4) explicitly sets -g -DDEBUG=1
Summary: [patch] sfxge(4) explicitly sets -g -DDEBUG=1
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.0-PRERELEASE
Hardware: Any Any
: Normal Affects Some People
Assignee: Andrew Rybchenko,St.Petersburg Russia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-02 11:20 UTC by Enji Cooper
Modified: 2015-11-30 13:23 UTC (History)
2 users (show)

See Also:
ngie: mfc-stable10+
arybchik: mfc-stable9+
ngie: mfc-stable8-


Attachments
file.diff (361 bytes, patch)
2012-01-02 11:20 UTC, Enji Cooper
no flags Details | Diff
mps.txt (317 bytes, text/plain)
2013-04-30 03:02 UTC, r4721@tormail.org
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2012-01-02 11:20:09 UTC
The attached patch removes the explicit setting of DEBUG_FLAGS in sfxge/Makefile, s.t. it doesn't affect developers such as myself who depend on DEBUG_FLAGS to be a user-defined value and thus react accordingly via make.conf.

Fix: Patch attached with submission follows:
How-To-Repeat: 1. Add the following to make.conf:

.if defined(DEBUG_FLAGS) && !empty(DEBUG_FLAGS)
.error "I didn't do it!"
.endif

2. Run `make buildkernel'.
Comment 1 r4721@tormail.org 2013-04-30 03:02:20 UTC
this is happen in mps driver also.
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2014-07-11 03:45:24 UTC
mps appears to be fixed now :).

Because sfxge is a SUBDIR and DEBUG_FLAGS isn't exported, it doesn't do anything other than add debug symbols to itself.
Comment 3 Hiren Panchasara freebsd_committer freebsd_triage 2014-07-18 00:01:46 UTC
Adding philip@ (who removed -g via r255936) to comment.
Comment 4 Philip Paeps freebsd_committer freebsd_triage 2014-07-18 13:01:06 UTC
So, what do you want me to do? :)
Does the -DDEBUG=1 to sfxge cause any problems?
Comment 5 Hiren Panchasara freebsd_committer freebsd_triage 2014-07-18 17:40:55 UTC
(In reply to Philip Paeps from comment #4)
> So, what do you want me to do? :)
> Does the -DDEBUG=1 to sfxge cause any problems?

Removing -DDEBUG=1 is also the proposed patch's intention. I am not sure if thats still needed.  I'd let yaneurabeya@ (reporter of this bug) comment about it.

PS: We have many bugs with patches not getting looked at. Just trying to triage some :-)
Comment 6 Enji Cooper freebsd_committer freebsd_triage 2015-11-09 10:48:30 UTC
No longer an issue on head after r283679 or stable/10 after r284556. Giving to Andrew to decide if he wants to MFC the change(s) back to stable/9.
Comment 7 Andrew Rybchenko,St.Petersburg Russia freebsd_committer freebsd_triage 2015-11-30 13:06:48 UTC
I think it is pretty straightforward to fix in stable/9. So, I'll do.
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-11-30 13:21:05 UTC
A commit references this bug:

Author: arybchik
Date: Mon Nov 30 13:20:49 UTC 2015
New revision: 291487
URL: https://svnweb.freebsd.org/changeset/base/291487

Log:
  MFC r283679

  sfxge: do not use DEBUG_FLAGS to enable extra debug checks

  DEBUG_FLAGS are set to DEBUG option value when kernel is built.
  For example, it is -g in GENERIC config to have debug symbols.
  Also DEBUG_FLAGS are used to determine if ctfconvert should keep
  debug symbols.
  Since we redefined DEBUG_FLAGS, debug symbols were always missing.
  ctfconvert complains about it during kernel build.
  It is incorrect to append DEBUG_FLAGS, since if DEBUG has no -g (or
  similar), we'll have no debug symbols and ctfconvert will complain.
  If it incorrect to always have -g in our DEBUG_FLAGS, since debug
  symbols presence should be controllable by kernel config.
  So, just add disabled by default addition of -DDEBUG=1 to CFLAGS.

  PR:             163775
  Sponsored by:   Solarflare Communications, Inc.

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
_U  stable/9/sys/modules/
  stable/9/sys/modules/sfxge/Makefile
Comment 9 Andrew Rybchenko,St.Petersburg Russia freebsd_committer freebsd_triage 2015-11-30 13:23:31 UTC
Fixed in head, stable/10 and stable/9.