static executable bloat
H.J. Lu
hjl@lucon.org
Sun Aug 22 09:20:00 GMT 1999
>
> >#include <stdio.h>
> >int main(int argc, char **argv)
> >{
> > printf ("Hello World\n");
> >}
> >
> >compiles to 985,018 bytes. This is almost all libc overhead.
> >Most of which is never going to be needed.
>
> Yes, it is a bit sad. Somewhere I have some half-baked patches that allow you
> to stub out the majority of the gconv and wchar code at configure time; I did
> this for an internal project where the resulting binaries had to fit into ROM.
>
> The other thing I looked at was dropping the stdio implementation from newlib
> (which is far less featureful but also a whole lot smaller) into libc. I
> think I got that to mostly work and again I can probably dig out some patches
> if anyone is interested.
>
May I ask if it is ok to add some flags to get a smaller static
binary without gconv and/or wchar support? I am thinking to write
libNoGconv.a and libNoWchar.a. People can stub out gconv and/or wchar
with
# gcc -static .... -lNoGconv -lNoWchar
Will that work for people who want smaller static binaries or do you
want smaller static binaries with supports for everything?
--
H.J. Lu (hjl@gnu.org)
More information about the Libc-hacker
mailing list