dbx is able to manage separate debug information:
http://blogs.sun.com/dbx/entry/creating_separate_debug_info
The attached patch modify rpmbuild to automatically generated "-debuginfo" sub-packages for each existing sub-package which hold elf files. It walk all the provided files, and if some is recognized via the "file" command as an elf file, strip the debug symbols and place them in a separate file, placed under /usr/lib/debug.
The debug symbol file name comprise the original file name and the the md5 checksum of the original file, to avoid aliasing issue. The debuginfo generation is performed only for svr4 packages
The patch is against pkgbuild version 1.3.101
generate separte debuginfo patch
Very cool. I reviewed this patch and have a few questions/comments:
1) the exit status from gobjcopy should be checked. (It may not even be installed, in which case
this whole code should be skipped)
2) the name and description of the package is hard coded in the patch. It should be configurable.
If rpm has a way to specify these in the spec file, then pkgbuild should do the same. If not, let's
discuss.
3) what happens in the case of IPS packages? What I'd like to see happen is that it includes the
debug info files in the same package as the corresponding binaries are, but tagged as "debug"
or "debuginfo", so they can be installed as "facets" of the package.
updated patch: fix debuginfo link path
I updated the patch, adding some checks for the system() calls and fixing an issue with the debuginfo link creation (the debuginfo file was previously placed into the "wrong" directory, i.e. dbx did not find it with the default configuration
AFAIK, the subpackage name is hardcoded by rpm, too. There are a few other differences: rpmbuild generate a single debuginfo subpackage for each specfile, while this patch generate a debuginfo subpackage for each existing subpackage into the specfile that hold elf files. Moreover rpmbuild allow the spec file to disable the debuginfo generation with a proper tag:
%define debug_package %{ni}
I did not code any IPS support, mainly due to time constraint; but i thing that it can be added with a few changes in create_ips_packages(), calling rpm_debuginfo::create_pkg() for each subpackage and then conditionally building the generated subpackage.
The patch itself is pretty rough, but I hope it can be used as a starting point. BTW I just discovered that rpmbuild do this thing with a "macros-only" implementation...
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
reopening