Skip to content
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

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ffi-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ fi
if command -v objcopy > /dev/null; then
# Remove .llvmbc section which is not useful for clients
objcopy --remove-section .llvmbc "$destdir/lib/libddprof_ffi.a"

# Ship debug information separate from shared library, so that downstream packages can selectively include it
# https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
objcopy --only-keep-debug "$destdir/lib/libddprof_ffi${shared_library_suffix}" "$destdir/lib/libddprof_ffi${shared_library_suffix}.debug"
strip -S "$destdir/lib/libddprof_ffi${shared_library_suffix}"
objcopy --add-gnu-debuglink="$destdir/lib/libddprof_ffi${shared_library_suffix}.debug" "$destdir/lib/libddprof_ffi${shared_library_suffix}"
fi

echo "Checking that native-static-libs are as expected for this platform..."
Expand Down