On Sun, Sep 28, 2014 at 09:44:16AM +0100, Jorge Almeida wrote
> I'm having a somewhat disgusting issue on my Gentoo: binaries are
> unaccountably large.
> 
> I'm talking about C programs of my own, so no version related issues
> whatsoever. The computer is a core i3 with a 32 bit system.
> 
> Example, for the same program:
> 
> 10275 B on an atom running Slackware 14.1 (gcc 4.8.2)
> 5896 B (same, stripped with strip --strip-unneeded)
> 
> 11675 B on i3, Gentoo, gcc 4.8.3 (with default gcc it was worse)
> 9704 B stripped
> 
> 8207 B on *the same i3 box* running LFS (gcc 4.9.1)
> 5768 B stripped
> 
> When compiling against dietlibc, the difference is even more shocking
> (almost double size in Gentoo after stripping).
> 
> Compiled with:
> gcc -Os -march=i686  -fomit-frame-pointer -pipe -Wall -pedantic
> -fdata-sections -ffunction-sections -Wl,--gc-sections
> -fno-asynchronous-unwind-tables -std=c99

  In my make.conf I have...
CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe
-fno-unwind-tables -fno-asynchronous-unwind-tables"

  "-fno-unwind-tables" is the extra flag I have that you don't have.
See http://comments.gmane.org/gmane.linux.busybox/36695 for a short
discussion ".eh_frame bloat issue - solution found".  The busybox people
go to extreme lengths to keep the size of busybox to a minimum, so you
can't go wrong by following their example.  I assume that you do not
have debugging enabled.

-- 
Walter Dnes <waltd...@waltdnes.org>
I don't run "desktop environments"; I run useful applications

Reply via email to