Bug 153157 - [build] [patch] Add support for generating userland debug symbols during installworld
Summary: [build] [patch] Add support for generating userland debug symbols during inst...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-14 20:50 UTC by Mark Johnston
Modified: 2014-06-17 13:51 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (5.66 KB, patch)
2010-12-14 20:50 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston 2010-12-14 20:50:07 UTC
I posted about this in a few threads on -hackers:

http://lists.freebsd.org/pipermail/freebsd-hackers/2010-November/033474.html

I just thought I'd open a PR in case someone is still interested.

The details are in my posts, but the basic idea behind this change is to allow users to have a 'make installworld' generate a directory (/usr/lib/debug) containing debug symbols for all of the base FreeBSD binaries. With my change, this can be done by adding an option to src.conf.

At the moment, my change adds a script to src/tools/ which is the script invoked by install(1) to strip and extract the debug symbols from each binary that gets installed. I'm not sure that this is the best place for it, but it seems ok to me.

Fix: I have a patch which applies against HEAD (as of a few days ago).

Patch attached with submission follows:
Comment 1 Ed Maste freebsd_committer freebsd_triage 2012-10-17 15:59:27 UTC
Note, it appears an equivalent change is needed in bsd.lib.mk.  It
looks like the current patch will add symbols for binaries only.

Work is ongoing by brooks@ to implement an install process that can
produce a tar file or other output directly, which will likely be
incompatible with this patch.
Comment 2 Ed Maste freebsd_committer freebsd_triage 2012-11-06 17:32:32 UTC
Now that I've had a chance to look at the patch in detail I see
another issue - STRIPBIN is set to the absolute path
/usr/src/tools/stripbin.sh and will not use the file in the source
tree.

To address this and more easily accommodate changes that brooks@ has
in the pipeline we could follow the model used in kern.post.mk:
explicitly invoke objcopy --only-keep-debug and --add-gnu-debuglink.
It does mean we'd need to build ${PROG}.debug though, and objcopy to
${PROG} and ${PROG}.symbols in the objdir.
Comment 3 Ed Maste freebsd_committer freebsd_triage 2014-06-17 13:50:58 UTC
Changes committed in:
r244224
r244236
r244408
r244915
r247054
r248753
r251512 (main part of the changes)
r251513
r251601
r251685
r253580

All but r253580 (initial support for generating release sets) merged to stable/9.