diff options
author | Domen Kožar <domen@dev.si> | 2016-03-27 13:19:04 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2016-03-27 13:19:04 +0100 |
commit | b07e7bfc7bc8f0b5428acaab026738866af32a28 (patch) | |
tree | 88dfca9473373d72d3d0e60a84ced34f33d69bf4 /pkgs/build-support/setup-hooks/separate-debug-info.sh | |
parent | d88ae1045d37f8cd1b3428617670f7358eb45a29 (diff) | |
parent | dae3a7b721aeaaffabf336563182852c800a5ae0 (diff) | |
download | nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.gz nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.bz2 nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.lz nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.xz nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.zst nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.zip |
Merge remote-tracking branch 'origin/staging'
Diffstat (limited to 'pkgs/build-support/setup-hooks/separate-debug-info.sh')
-rw-r--r-- | pkgs/build-support/setup-hooks/separate-debug-info.sh | 15 |
1 files changed, 4 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 37753d9ce406..518be9647334 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -1,5 +1,6 @@ -export NIX_LDFLAGS+=" --build-id" -export NIX_CFLAGS_COMPILE+=" -ggdb" +export NIX_SET_BUILD_ID=1 +export NIX_LDFLAGS+=" --compress-debug-sections=zlib" +export NIX_CFLAGS_COMPILE+=" -ggdb -Wa,--compress-debug-sections" dontStrip=1 fixupOutputHooks+=(_separateDebugInfo) @@ -25,18 +26,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 - |