summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-15 16:12:05 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-15 16:16:11 +0100
commit2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84 (patch)
treeea4e9bcbba4a066bca61b3362c7cf4a5cef755e4 /pkgs/build-support
parent5b20713041e33542ba1f5b4c402aa98a111915d6 (diff)
downloadnixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.tar
nixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.tar.gz
nixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.tar.bz2
nixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.tar.lz
nixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.tar.xz
nixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.tar.zst
nixlib-2fcee55e5fe46c8c4a7aa6bfdab7a9c9188f7a84.zip
separateDebugInfo: Create symlinks matching original binaries
For instance, a binary like libfoo.so will cause a symlink
lib/debug/libfoo.so.debug -> .build-id/<build-ID>.debug to be
created. This is primarily useful for use with eu-addr2line, if you
know the name of a binary and the relative address, but not the build
ID.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/separate-debug-info.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh
index dc6de05bb69a..55e3236847df 100644
--- a/pkgs/build-support/setup-hooks/separate-debug-info.sh
+++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh
@@ -32,6 +32,9 @@ _separateDebugInfo() {
         mkdir -p "$dst/${id:0:2}"
         objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" --compress-debug-sections
         strip --strip-debug "$i"
+
+        # Also a create a symlink <original-name>.debug.
+        ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
     done
 }