On Sun, Sep 28, 2014 at 10:56 PM, walt <w41...@gmail.com> wrote: > On 09/28/2014 01:44 AM, Jorge Almeida wrote: >> I'm having a somewhat disgusting issue on my Gentoo: binaries are >> unaccountably large. >>
> Are you cross-compiling for different hardware? I'm just curious what results > you get with --march=native. Nope. Actually, I compiled with --march=native, with no difference (probably because my code is not fancy enough to make use of whatever stuff that pulls), but then tried i686 just to enable comparing with non-Gentoo systems. The purpose is to have small static binaries compiled against dietlibc to be used in the same computer (compile once and forget about future software incompatibilities!). I compiled against glibc to make sure the problem is not with dietlibc. > > Also, I looked up data-sections and function-sections (which I'd never heard > of before today :) The gcc man page says the resulting executable will be > larger and slower, and not to use them "unless there are significant benefits" > but then doesn't say what those benefits might be. Hm, cryptic. > I found those flags in the net (probably StackOverflow), looking for ways to optimize size. Maybe what you read was not meant to static compiling? Anyway, I used these flags in 4 systems (including LFS in the same computer as Gentoo) and only the Gentoo system has this behaviour... Thanks, Jorge >