Packaging/Debuginfo
From openSUSE
Contents |
Debuginfo packages
This page contains information about debuginfo packages and common pitfalls about them for packagers. For usage information and an explanation why debuginfo packages are important, see StackTraces.
Checking your debuginfo package for usefulness
A useful debuginfo (*-debuginfo) package contains stripped symbols from ELF binaries (*.debug in /usr/lib/debug). The source source code related to them (in /usr/src/debug) is in the debugsource (*-debugsource) package. The script that generates the packages is /usr/lib/rpm/find-debuginfo.sh, read it through to get a basic understanding of how they're generated. If your debuginfo package doesn't contain any files, or is missing the sources or the size of the *.debug files in it is unexpectedly small (typically *.debug are larger than the corresponding binary it was stripped from), it's likely that there's a flaw in your package. That's not always the case though, read on.
Useless or incomplete debuginfo packages due to packaging issues
Useless or incomplete debuginfo packages are often a result of packaging flaws. Typical flaws that often manifest themselves as debuginfo packages containing no files:
- The specfile or the package's build routines explicitly strip symbols out of the binaries. Look for invocations of
strip,install -s,ld -s, orgcc -setc and get rid of them (or the-sflags). The method how to do that varies, some examples cases include patching, using%configureor amaketarget that prevents the strip from happening, and/or overriding a strip command like for examplemake install STRIP=/bin/true - The package is not marked as
noarch, but does not contain any architecture dependent things (native binaries, architecture dependent paths etc). Truenoarchpackages contain nothing rpmbuild could strip from them, so it's expected that they're empty ifBuildArch: noarchis missing. If that's the case, make the packagenoarch.
Flaws that manifest themselves as unexpectedly small *.debug in the debuginfo package and/or source files missing:
- The package was built without passing
-gtogccorg++. Without-g, no or insufficient information for debuginfo packages is generated, make sure that it is being used. - Note that the default
CFLAGSandCXXFLAGSof the distro already contain-g, so if those flags are being honored, it should be already in use. If not, suboptimal debuginfo packages are not the only problem; the package is probably also compiled without the security enhancing options of recent compiler versions. Make sure that$RPM_OPT_FLAGSis being honored and used. -
strip -gwas used on the binaries; see above for possible remedies.
Useless or incomplete debuginfo packages due to other reasons
Empty debuginfo packages may also be generated in situations where there are no obvious packaging flaws present. Sometimes these are because of limitations of find-debuginfo.sh, sometimes not. Some usual cases:
- Packages whose only architecture dependent binary part is a static library or many of them
- R and Mono packages TODO: people knowledgeable of R and/or Mono, verify these
Missing debuginfo packages
It is normal for noarch package builds to not produce a debuginfo package. If it's missing in other cases (where it has not been explicitly disabled), something's wrong.

