Am Montag, 17. Dezember 2012, 11:47:24 schrieb Tomáš Chvátal:
> 2012/12/17 Sven Eden <sven.e...@gmx.de>:
> > Hello Tomáš,
> >
> > on my system I have set up everything with splitdebug enabled. My CFLAGS
> > use - march=native, -O2 and -ggdb.
> > And this is the result: (Yes, I have a dedictated partition for that.)
> >
> >  ~ $ LC_ALL=C df -h /usr/lib/debug/.
> >
> > Filesystem      Size  Used Avail Use% Mounted on
> > /dev/sda10       25G   22G  1.7G  93% /usr/lib64/debug
> >
> > This is a full KDE-4.9.4 system with a total
> > of 1,807 packages installed.
> >
> > I guess the regular user would end up somewhere between your 2G and my
> > 22G.
> > But I bet it will be slightly more likely my end, wouldn't it?
>
> Well your "problem" is using -ggdb, that adds ton of stuff that makes
> things large exponencialy in most cases, i bet you would be around 5-6
> on -g usage.

First, I do not want to argue. I just want to state, and prove for at least
_my_ machine, that this is not true.

Second, my whole system is compiled using gcc-4.7.2. This means, that the
results below might differ greatly from a setting where stable gcc-4.5.4 is
used for the whole. But this doesn't matter, because gcc-4.7.* will,
eventually, become the stable and current gcc. (Unless it is skipped, of
course.)

Third, "_My_ Machine" means: My setting, hardware, USE-Flags and CFLAGS.

For this the assumption -ggdb would add about 300% in size is "a bit"
exsessive.

Background:
The option "-g" produces debugging information in the operating systems native
format, already fit for GDB. -ggdb simply uses the most expressive format.
Both, as I believe, result in "DWARF-2" format on my system. At least I get no
difference whether I specify "-g -gdwarf-2" or "-ggdb". GDB extensions are
added if possible.

It seems to me, judging the results of the tests below, that those "gdb-
extensions" are already enabled by default (gcc-4.7.2).
I have not found any information on that regarding DWARF-2, but at least
 http://gcc.gnu.org/onlinedocs/gccint/DBX-Options.html
states that DEFAULT_GDB_EXTENSIONS (for DBX output) is always turned on by
default.

Maybe that's true for DWARF-2 as well?


Below are the resulting sizes of all .debug files having been generated first
using "-ggdb", then using "-g" in make.conf CFLAGS.

The tested packages are:

1) kde-base/kate (C++ Code, heavy library usage) and
2) dev-libs/lzo (ANSI C)

I believe both are, regarding their code base, far enough apart for building
up a test case. It is _not_ representative, of course.


1) --- kde-base/kate
-----------------------------

Compiled with -ggdb in CFLAGS:

 # sum=0; for file in $(equery f kde-base/kate | grep "\.debug") ; do
xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum"
32652140

Compiled with -g in CFLAGS:

 # sum=0; for file in $(equery f kde-base/kate | grep "\.debug") ; do
xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum"
32652140

Result: No size change at all.


2) --- dev-libs/lzo
-----------------------------

Compiled with -ggdb in CFLAGS:

 # sum=0; for file in $(equery f dev-libs/lzo | grep "\.debug") ; do
xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum"
558664

Compiled with -g in CFLAGS:

 # sum=0; for file in $(equery f dev-libs/lzo | grep "\.debug") ; do
xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum"
558304


Result: A difference of 260 bytes or 0.06%. Far away from the assumed 300%.


Conclusion:
I do not doubt that -ggdb adds size. It does. And maybe, if I did an emerge -e
@world would reduce the size used on my system between 30% and 40%. But not
about 66% like assumed.


However, even if it where "around 5-6" G, it would be thrice the initial
assumption of 2G. And that's the whole point.



Sincerly

Sven

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to