1 |
On Sun, Sep 28, 2014 at 09:44:16AM +0100, Jorge Almeida wrote |
2 |
> I'm having a somewhat disgusting issue on my Gentoo: binaries are |
3 |
> unaccountably large. |
4 |
> |
5 |
> I'm talking about C programs of my own, so no version related issues |
6 |
> whatsoever. The computer is a core i3 with a 32 bit system. |
7 |
> |
8 |
> Example, for the same program: |
9 |
> |
10 |
> 10275 B on an atom running Slackware 14.1 (gcc 4.8.2) |
11 |
> 5896 B (same, stripped with strip --strip-unneeded) |
12 |
> |
13 |
> 11675 B on i3, Gentoo, gcc 4.8.3 (with default gcc it was worse) |
14 |
> 9704 B stripped |
15 |
> |
16 |
> 8207 B on *the same i3 box* running LFS (gcc 4.9.1) |
17 |
> 5768 B stripped |
18 |
> |
19 |
> When compiling against dietlibc, the difference is even more shocking |
20 |
> (almost double size in Gentoo after stripping). |
21 |
> |
22 |
> Compiled with: |
23 |
> gcc -Os -march=i686 -fomit-frame-pointer -pipe -Wall -pedantic |
24 |
> -fdata-sections -ffunction-sections -Wl,--gc-sections |
25 |
> -fno-asynchronous-unwind-tables -std=c99 |
26 |
|
27 |
In my make.conf I have... |
28 |
CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe |
29 |
-fno-unwind-tables -fno-asynchronous-unwind-tables" |
30 |
|
31 |
"-fno-unwind-tables" is the extra flag I have that you don't have. |
32 |
See http://comments.gmane.org/gmane.linux.busybox/36695 for a short |
33 |
discussion ".eh_frame bloat issue - solution found". The busybox people |
34 |
go to extreme lengths to keep the size of busybox to a minimum, so you |
35 |
can't go wrong by following their example. I assume that you do not |
36 |
have debugging enabled. |
37 |
|
38 |
-- |
39 |
Walter Dnes <waltdnes@××××××××.org> |
40 |
I don't run "desktop environments"; I run useful applications |