Merge remote-tracking branch 'origin/staging'

This commit is contained in:
Domen Kožar
2016-03-27 13:19:04 +01:00
106 changed files with 1065 additions and 3988 deletions
@@ -19,6 +19,12 @@ makeWrapper() {
echo "export $varName=$value" >> $wrapper
fi
if test "$p" = "--unset"; then
varName=${params[$((n + 1))]}
n=$((n + 1))
echo "unset $varName" >> "$wrapper"
fi
if test "$p" = "--run"; then
command=${params[$((n + 1))]}
n=$((n + 1))
@@ -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