How to put glibc-2.2.2 on a diet...

Peter Barada
Fri Jun 22 08:16:00 GMT 2001

Now for something completely different.

I'm putting together my embedded Linux system, and I want to
statically link my applications since I only have about 10 of them in
total (init, expand, mount, ifconfig, route, etc...), as well as
libc.a by itself is 10+Mb.

So when I statically link the hellow world application, here's what I get:

[/tmp] > echo 'main() { printf("hello world\n"); }' > hello.c
[/tmp] > powerpc-linux-gcc -static -Wl,-Map, hello.c -o hello
[/tmp] > powerpc-linux-size hello
   text	   data	    bss	    dec	    hex	filename
 256252	   4124	   3348	 263724	  4062c	hello

Note that the text segment is a quarter of a Meg!!!  And that's after I
hacked out 100Kb of dcgettext() stuff.

Does anyone have an idea of how I can configure glibc to not define
USE_WIDE_CHAR, not to call dcgettext and friends to look up strings in
message files, etc so I have a much, much smaller library footprint.

Thanks in advance,

Peter Barada                         
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list