This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: static executable bloat


> 
> >#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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]