On Sat Apr 29, 2000 at 10:18:21AM -0500, Mike Touloumtzis wrote:
> >
> > http://sourceware.cygnus.com/newlib/
> >
>
> Last I checked (a while ago), newlib didn't have syscall glue for
> Linux. Has this been added?
Dunno. I have not gotten newlib to work under Linux so far. However, as I
have time I intend to make it work. The basic problem with GNU libc for
embedded systems is that glibc is so fat, fat, fat. For example:
[andersen@slag /tmp]$ cat hello.c
#include <stdio.h>
int main(void)
{
printf( "hello world\n");
exit( 0);
}
With gcc 2.95.2 and GNU libc 2.1.3:
[andersen@slag /tmp]$ gcc -Os -s hello.c -o hello
[andersen@slag /tmp]$ ls -sh ./hello
4.0k ./hello*
[andersen@slag /tmp]$ gcc -Os -s --static hello.c -o hello
[andersen@slag /tmp]$ ls -sh ./hello
200k ./hello*
With gcc 2.7.2.3 and Linux libc 5.4.46:
[andersen@slag /tmp]$ PATH=/usr/i486-linuxlibc1/bin:$PATH
[andersen@slag /tmp]$ gcc -Os -s hello.c -o hello
cc1: Invalid option `-Os'
[andersen@slag /tmp]$ gcc -O -s hello.c -o hello
[andersen@slag /tmp]$ ls -sh ./hello
4.0k ./hello*
[andersen@slag /tmp]$ gcc -O -s --static hello.c -o hello
[andersen@slag /tmp]$ ls -sh ./hello
92k ./hello*
So with Linux libc5, statically linking hello.c results in a 92k binary (still
far larger than it should be), while the same app with the latest GNU libc is
200k! There are frequently cases where I want to compile up minimalist
statically linked versions of BusyBox. As you can imagine, avoiding all the
extra bloat by linking vs newlib would be a big win. I am currently in the
process of making BusyBox work with libc5 (which is still a win, even though
not as thin as I would like it to be).
-Erik
--
Erik B. Andersen Web: http://www.xmission.com/~andersen/
email: [EMAIL PROTECTED]
--This message was written using 73% post-consumer electrons--
--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.