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

Re: Help with -dbg packages for a library

On Thu, Aug 30, 2007 at 09:29:45AM +0530, Kumar Appaiah wrote:
> Dear Debian Mentors,
> I have a specific question with regard to -dbg packages for
> libraries. My understanding of generating -dbg libraries is like this:
> 1. We build the package with CFLAGS or CXXFLAGS = -g -O2 (for
> optimization).
> 2. We call dh_strip while exluding the dbg package, to ensure that
> debugging sumbols are present there.
I think the suggestion is for all libraries to use dh_strip
--dbg-package or -k.

> Now, my situation is that upstream generates special <pkg>_debug
> packages by sending ./configure --enable-debug. While I achieve the
> desired result with the CFLAGS mentioned above, upstream fears that
> generating the library with debugging symbols first and then stripping
> them may result in a slightly reduced performance (it's a numerical
> computation library). While I am going to run some tests myself to
> verify this, I just wanted to ask the mentors here about their
> knowledge of this issue.
My *understanding* is that the debug information is in a separate ELF
section in the executable.  See the "strip" manpage for details, but
you can move the debug sections to a separate file, and distribute
such files as separate Debian packages.  So people who use the library
as just a dependency of some other package (and don't have problems so
don't need to debug it) just get the lib, and people who develop with
it get lib-dev, and also lib-dbg.

So I think there should be no performance difference between running
with the libraries compiled without -g, compiled with -g, compiled
with -g and stripped, and compiled with -g and debug symbols/sections
moved to a separate file.

It would be neat if you could compare the ELF files using binutils


Reply to: