summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-28 01:54:55 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-28 01:54:55 +0100
commit69a337edae4d8d0dd6bd6e96468ba887509f3f0a (patch)
treea09e31f2593438ce384e82702bc226769521ac95 /pkgs/build-support
parent2040a9ac574fffd36fe20130897ccec2d5928827 (diff)
downloadnixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.tar
nixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.tar.gz
nixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.tar.bz2
nixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.tar.lz
nixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.tar.xz
nixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.tar.zst
nixpkgs-69a337edae4d8d0dd6bd6e96468ba887509f3f0a.zip
separateDebugInfo: Compress debug sections at compile/link time
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/separate-debug-info.sh14
1 files changed, 3 insertions, 11 deletions
diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh
index 37753d9ce40..d2d8386c92d 100644
--- a/pkgs/build-support/setup-hooks/separate-debug-info.sh
+++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh
@@ -1,5 +1,5 @@
-export NIX_LDFLAGS+=" --build-id"
-export NIX_CFLAGS_COMPILE+=" -ggdb"
+export NIX_LDFLAGS+=" --build-id --compress-debug-sections"
+export NIX_CFLAGS_COMPILE+=" -ggdb -Wa,--compress-debug-sections"
 dontStrip=1
 
 fixupOutputHooks+=(_separateDebugInfo)
@@ -25,18 +25,10 @@ _separateDebugInfo() {
         # Extract the debug info.
         header "separating debug info from $i (build ID $id)"
         mkdir -p "$dst/${id:0:2}"
-        objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" --compress-debug-sections
+        objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
         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 < <(find "$prefix" -type f -print0)
 }
-
-# - We might prefer to compress the debug info during link-time already,
-#   but our ld doesn't support --compress-debug-sections=zlib (yet).
-# - Debug info may cause problems due to excessive memory usage during linking.
-#   Using -Wa,--compress-debug-sections should help with that;
-#   further interesting information: https://gcc.gnu.org/wiki/DebugFission
-# - Another related tool: https://fedoraproject.org/wiki/Features/DwarfCompressor
-