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

Re: NDEBUG when building packages?



On Fri, Jun 07, 2013 at 07:34:21AM -0400, Kumar Appaiah wrote:
> On Fri, Jun 07, 2013 at 11:54:49AM +0200, Mathieu Malaterre wrote:
> > cmake from sid makes it even harder. RelWithDebInfo now contains
> > -DNDEBUG ... I have to source-upload all my packages :(
> > 
> > $ grep NDEBUG ChangeLog.manual
> >       Add -DNDEBUG to RelWithDebInfo flags where where Release flags had it.
> > 
> > 
> > The solution (backward compat) is now:
> > 
> > Either do *not* define CMAKE_BUILD_TYPE, or define CMAKE_BUILD_TYPE to
> > Debug (and hope -DNDEBUG does not creep in ever)
> 
> While we're at it, could you please let me know what is the best
> practice for package builds that generate debug symbol packages?
> Ideally, I would hapve to rebuild the whole package TWICE, once with
> -O0 -g, and the other time with -O2, right?
> 
> Currently, I don't bother with this, since the the debug library with
> -O2 is still useful, other than the odd "optimized out" messages.

As I understand it, with dwarf 4 you should see less problems
trying to debug optimised programs.  Dwarf 4 is enabled by default
in gcc 4.8 and supported by gdb 7.5.


Kurt


Reply to: