This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
Ship debug information in a separate file from the shared library #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Modifies
ffi-build.sh
to place the debug information for the shared library version of libddprof into a separate file.Motivation
By shipping the debug information in a separate file, downstream packages (e.g. the Ruby packages) can easily remove the debug information while packaging libddprof, but it's still very easy to restore it.
Additional Notes
This approach is documented in https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html and in the
objdump
man pages. Thanks @nsavoire for the tips.The
strip
'd file retains thebuild-id
information.I've tested with
gdb
and it seems to work:and if the
.debug
file is deleted:This PR is an alternative to #28, which instead shipped two copies of the shared library binaries (one
strip
d, and an untouched one).How to test the change?
libddprof_ffi.so
works correctly.debug
file is available.