diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-01-13 14:34:58 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-01-14 16:37:24 -0500 |
commit | 3ae079dc5650e5af73516198b429d56d9131d637 (patch) | |
tree | 86cec4fe177af39d1860ce126d79b3de3edf08a9 /bin | |
parent | ac263977391643f1c147d7e767b5b804ac095d55 (diff) | |
download | portage-3ae079dc5650e5af73516198b429d56d9131d637.tar.gz portage-3ae079dc5650e5af73516198b429d56d9131d637.tar.bz2 portage-3ae079dc5650e5af73516198b429d56d9131d637.zip |
add support for compressing debug sections to save space
Since binutils/gdb can compress the .debug* sections with zlib into
.zdebug*, we should be able to save quite a bit of space -- on my
system, I saw /usr/lib/debug/ go from ~20GB to ~7.5GB.
This requires binutils/gdb to be built with USE=zlib which is why
this defaults to off.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild-helpers/prepstrip | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip index ee547f235..daaa25250 100755 --- a/bin/ebuild-helpers/prepstrip +++ b/bin/ebuild-helpers/prepstrip @@ -15,7 +15,7 @@ exp_tf() { eval ${var}_${flag}=$(tf has ${flag} ${!var}) done } -exp_tf FEATURES installsources nostrip splitdebug +exp_tf FEATURES compressdebug installsources nostrip splitdebug exp_tf RESTRICT binchecks installsources strip [[ " ${FEATURES} " == *" force-prefix "* ]] || \ @@ -121,7 +121,9 @@ save_elf_debug() { if [[ -e ${T}/prepstrip.split.debug ]] ; then mv "${T}"/prepstrip.split.debug "${y}" else - ${OBJCOPY} --only-keep-debug "${x}" "${y}" + local objcopy_flags="--only-keep-debug" + ${FEATURES_compressdebug} && objcopy_flags+=" --compress-debug-sections" + ${OBJCOPY} ${objcopy_flags} "${x}" "${y}" ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}" fi local args="a-x,o-w" |