FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 01-13-2012, 07:29 PM
Mike Frysinger
 
Default 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>
---
bin/ebuild-helpers/prepstrip | 6 ++++--
man/make.conf.5 | 10 +++++++++-
pym/_emerge/EbuildPhase.py | 6 ++++--
pym/portage/const.py | 2 +-
4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index ee547f2..daaa252 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"
diff --git a/man/make.conf.5 b/man/make.conf.5
index f7491a9..e5a9ae1 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -260,6 +260,12 @@ Log file names have an extension that is appropriate for the compression
type. Currently, only fBgzipfR(1) compression is supported, so build
logs will have a '.gz' extension when this feature is enabled.
.TP
+.B compressdebug
+Compress the debug sections in the split debug files with zlib to save
+space. Make sure you have built both binutils and gdb with USE=zlib
+support for this to work. See fBsplitdebugfR for general split debug
+information (upon which this feature depends).
+.TP
.B config-protect-if-modified
This causes the fBCONFIG_PROTECTfR behavior to be skipped for files
that have not been modified since they were installed.
@@ -476,7 +482,9 @@ instead of using fBPORT_LOGDIRfR directly.
.B splitdebug
Prior to stripping ELF etdyn and etexec files, the debugging info is
stored for later use by various debuggers. This feature is disabled by
-fBnostripfR. For installation of source code, see fBinstallsourcesfR.
+fBnostripfR. You should also consider setting fBcompressdebugfR so
+the files don't suck up a lot of space. For installation of source code,
+see fBinstallsourcesfR.
.TP
.B strict
Have portage react strongly to conditions that have the potential to be
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index ed0be0b..27944f4 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -33,11 +33,13 @@ class EbuildPhase(CompositeTask):
("_ebuild_lock",)

# FEATURES displayed prior to setup phase
- _features_display = ("ccache", "distcc", "distcc-pump", "fakeroot",
+ _features_display = (
+ "ccache", "compressdebug", "distcc", "distcc-pump", "fakeroot",
"installsources", "keeptemp", "keepwork", "nostrip",
"preserve-libs", "sandbox", "selinux", "sesandbox",
"splitdebug", "suidctl", "test", "userpriv",
- "usersandbox")
+ "usersandbox"
+ )

# Locked phases
_locked_phases = ("setup", "preinst", "postinst", "prerm", "postrm")
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 5fcb24f..bebb922 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -88,7 +88,7 @@ EBUILD_PHASES = ("pretend", "setup", "unpack", "prepare", "configure"
SUPPORTED_FEATURES = frozenset([
"assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy",
"ccache", "chflags", "clean-logs",
- "collision-protect", "compress-build-logs",
+ "collision-protect", "compress-build-logs", "compressdebug",
"config-protect-if-modified",
"digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot",
"fail-clean", "force-mirror", "force-prefix", "getbinpkg",
--
1.7.8.3
 
Old 01-13-2012, 09:15 PM
Zac Medico
 
Default add support for compressing debug sections to save space

On 01/13/2012 12:29 PM, Mike Frysinger wrote:
> 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>
> ---
> bin/ebuild-helpers/prepstrip | 6 ++++--
> man/make.conf.5 | 10 +++++++++-
> pym/_emerge/EbuildPhase.py | 6 ++++--
> pym/portage/const.py | 2 +-
> 4 files changed, 18 insertions(+), 6 deletions(-)

LGTM
--
Thanks,
Zac
 

Thread Tools




All times are GMT. The time now is 11:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org