1 |
W dniu 18.12.2012 12:13, Sven Eden pisze: |
2 |
> Am Montag, 17. Dezember 2012, 11:48:12 schrieb Walter Dnes: |
3 |
>> On Mon, Dec 17, 2012 at 01:37:27PM +0100, Sven Eden wrote |
4 |
>> |
5 |
>>> 1) --- kde-base/kate |
6 |
>>> ----------------------------- |
7 |
>>> |
8 |
>>> Compiled with -ggdb in CFLAGS: |
9 |
>>> # sum=0; for file in $(equery f kde-base/kate | grep "\.debug") ; do |
10 |
>>> |
11 |
>>> xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum" |
12 |
>>> 32652140 |
13 |
>>> |
14 |
>>> Compiled with -g in CFLAGS: |
15 |
>>> # sum=0; for file in $(equery f kde-base/kate | grep "\.debug") ; do |
16 |
>>> |
17 |
>>> xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum" |
18 |
>>> 32652140 |
19 |
>>> |
20 |
>>> Result: No size change at all. |
21 |
>>> |
22 |
>>> |
23 |
>>> 2) --- dev-libs/lzo |
24 |
>>> ----------------------------- |
25 |
>>> |
26 |
>>> Compiled with -ggdb in CFLAGS: |
27 |
>>> # sum=0; for file in $(equery f dev-libs/lzo | grep "\.debug") ; do |
28 |
>>> |
29 |
>>> xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum" |
30 |
>>> 558664 |
31 |
>>> |
32 |
>>> Compiled with -g in CFLAGS: |
33 |
>>> # sum=0; for file in $(equery f dev-libs/lzo | grep "\.debug") ; do |
34 |
>>> |
35 |
>>> xSize=$(stat -c "%s" $file) ; sum=$((sum+xSize)) ; done ; echo "$sum" |
36 |
>>> 558304 |
37 |
>>> |
38 |
>>> |
39 |
>>> Result: A difference of 260 bytes or 0.06%. Far away from the assumed |
40 |
>>> 300%. |
41 |
>>> |
42 |
>>> |
43 |
>>> Conclusion: |
44 |
>>> I do not doubt that -ggdb adds size. It does. And maybe, if I did an |
45 |
>>> emerge -e @world would reduce the size used on my system between 30% and |
46 |
>>> 40%. But not about 66% like assumed. |
47 |
>>> |
48 |
>>> |
49 |
>>> However, even if it where "around 5-6" G, it would be thrice the initial |
50 |
>>> assumption of 2G. And that's the whole point. |
51 |
>> |
52 |
>> On my 32-bit machines I have... |
53 |
>> |
54 |
>> FLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe |
55 |
>> -fno-unwind-tables -fno-asynchronous-unwind-tables" CXXFLAGS="${CFLAGS}" |
56 |
>> |
57 |
>> See http://comments.gmane.org/gmane.linux.busybox/36695 for why I |
58 |
>> include "-fno-unwind-tables -fno-asynchronous-unwind-tables". Would I |
59 |
>> have to rebuild system and world without... |
60 |
>> |
61 |
>> -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables |
62 |
>> |
63 |
>> ...to have debug data available? |
64 |
> |
65 |
> No, you haven't, if you have compiled everything with "-g" or "-ggdb". |
66 |
> |
67 |
> According to the web page you linked, the DWARF-2 tables are then written into |
68 |
> the .debug files. Without -g/-ggdb, they are stripped and no longer available |
69 |
> for debugging. |
70 |
|
71 |
> So according to your CFLAGS, you'd have to rebuild everything, yes, but a |
72 |
> simple "-g" would do. |
73 |
> |
74 |
> Oh, and "splitdebug" in "FEATURES" would be a good idea, too! ;) |
75 |
|
76 |
Hi Sven! |
77 |
Meseems you are not right, please look at it: |
78 |
$ readelf -p .GCC.command.line /usr/lib64/debug/usr/bin/sqlite3.debug |
79 |
|grep "unwind\|-g" |
80 |
[ 1e2] -grecord-gcc-switches |
81 |
[ 1f8] -ggdb |
82 |
[ 202] -frecord-gcc-switches |
83 |
$ size /usr/bin/sqlite3 |
84 |
text data bss dec hex filename |
85 |
44545 4124 328 48997 bf65 /usr/bin/sqlite3 |
86 |
|
87 |
|
88 |
And with -fno-unwind... |
89 |
$ readelf -p .GCC.command.line /usr/lib64/debug/usr/bin/sqlite3.debug |
90 |
|grep "unwind\|-g" |
91 |
[ 1e2] -grecord-gcc-switches |
92 |
[ 1f8] -ggdb |
93 |
[ 202] -frecord-gcc-switches |
94 |
[ 218] -fno-unwind-tables |
95 |
[ 22b] -fno-asynchronous-unwind-tables |
96 |
$ size /usr/bin/sqlite3 |
97 |
text data bss dec hex filename |
98 |
42713 4124 328 47165 b83d /usr/bin/sqlite3 |
99 |
|
100 |
As you can see I have splitdebug turned on. |
101 |
Marcin |