W dniu 18.12.2012 12:13, Sven Eden pisze:
> Am Montag, 17. Dezember 2012, 11:48:12 schrieb Walter Dnes:
>> On Mon, Dec 17, 2012 at 01:37:27PM +0100, Sven Eden wrote
>>
>>> 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.
>>
>> On my 32-bit machines I have...
>>
>> FLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe
>> -fno-unwind-tables -fno-asynchronous-unwind-tables" CXXFLAGS="${CFLAGS}"
>>
>> See http://comments.gmane.org/gmane.linux.busybox/36695 for why I
>> include "-fno-unwind-tables -fno-asynchronous-unwind-tables". Would I
>> have to rebuild system and world without...
>>
>> -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables
>>
>> ...to have debug data available?
>
> No, you haven't, if you have compiled everything with "-g" or "-ggdb".
>
> According to the web page you linked, the DWARF-2 tables are then written
> into
> the .debug files. Without -g/-ggdb, they are stripped and no longer available
> for debugging.
> So according to your CFLAGS, you'd have to rebuild everything, yes, but a
> simple "-g" would do.
>
> Oh, and "splitdebug" in "FEATURES" would be a good idea, too! ;)
Hi Sven!
Meseems you are not right, please look at it:
$ readelf -p .GCC.command.line /usr/lib64/debug/usr/bin/sqlite3.debug
|grep "unwind\|-g"
[ 1e2] -grecord-gcc-switches
[ 1f8] -ggdb
[ 202] -frecord-gcc-switches
$ size /usr/bin/sqlite3
text data bss dec hex filename
44545 4124 328 48997 bf65 /usr/bin/sqlite3
And with -fno-unwind...
$ readelf -p .GCC.command.line /usr/lib64/debug/usr/bin/sqlite3.debug
|grep "unwind\|-g"
[ 1e2] -grecord-gcc-switches
[ 1f8] -ggdb
[ 202] -frecord-gcc-switches
[ 218] -fno-unwind-tables
[ 22b] -fno-asynchronous-unwind-tables
$ size /usr/bin/sqlite3
text data bss dec hex filename
42713 4124 328 47165 b83d /usr/bin/sqlite3
As you can see I have splitdebug turned on.
Marcin