[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#157131: Bug#113525: Bug#157131: [PROPOSAL] Suggest to minimize optimization when DEB_BUILD_OPTIONS contains "debug"

On Sun, Aug 18, 2002 at 08:18:43PM -0400, Colin Walters wrote:
> +	  Although binaries in the build tree should be compiled with
> +	  debugging information by default,

Note that many packages don't currently do this.  I often had to do 
horrible things to Makefiles to get a binary with debugging symbols.
I speak in past tense because I usually don't bother to do this anymore.
So listen up, maintainers: if you want my bugreports to contain thorough
investigations and a patch, then make it easy to build a version with
debug information.

> +		The presence of this string means that the package
> +		should be complied with the minumum possible amount of
> +		optimization.  For C programs, this usually implies
> +		adding <tt>-O0</tt> to <tt>CFLAGS</tt>.  Some programs
> +		might fail to build or run at this level of
> +		optimization; it may be necessary to use <tt>-O1</tt>.


That said, "minimum possible amount" might be too strong.  If a package
does not work right without optimization (which IMHO is a bug in itself),
then trying to find the minimum is a lot of work that could be more
usefully spent on something else.  It's also error-prone.  In fact, if
a package is that sensitive to levels of optimization, then debugging it
at anything other than the default (well-tested) one is just asking
for trouble!

So I recommend a different rule:

  The presence of this string means that the package should be compiled
  without optimization, in order to make step-by-step debugging easier.
  For C programs, this usually means adding <tt>-O0</tt> to
  <tt>CFLAGS</tt>, or leaving the <tt>-O</tt> flag out entirely.  Some
  programs might fail to build or run without optimization, in which
  case the normal level of optimization should be used.

I added the "in order to..." clause to make clear what the intent is,
so that developers who are faced with an unusual situation can make
the right choice.  For example, some packages (perhaps in languages
other than C) might actually be harder to debug without optimization.

> +	    <tag>nostrip</tag>
> +	    <item>
> +	      <p>
> +		This string implies that the debugging symbols should
> +		not be stripped from the binary during installation, so
> +		that debugging information may be included in the
> +		package.
> +	      </p>

I would also do s/implies/means/ here.

Richard Braakman
"I sense a disturbance in the force"
"As though millions of voices cried out, and ran apt-get."
  (Anthony Towns about the Debian 3.0 release)

Reply to: