[linux-elitists] HTML in e-mail

Aaron Lehmann aaronl@vitelus.com
Thu Aug 21 21:15:59 PDT 2003


On Thu, Aug 21, 2003 at 06:25:28PM -0700, Tim Hammerquist wrote:
> The DOS one wasn't dynamic.  Let's try this again:
> 
>     % gcc -static -o test test.c
>     % ls -l test
>     -rwxr-xr-x    1 user     users      420580 2003-08-21 17:47 test
> 
> That's more like it.  Still a big jump from 50k, but for over 10
> years, that's acceptable to me.

I liked your post until it got to this, which is an awful example.
Size of static binaries is not something that glibc is good about
compared to proprietary systems. By most other metrics, Linux and BSD are
far ahead of the game in efficiency.

$ uname -a
Linux endquote 2.6.0-test2 #8 Wed Aug 6 22:02:31 PDT 2003 i686 GNU/Linux
$ cat hello.c
#include <stdio.h>
int main (int argc, char **argv)
{
        printf("Hello world.\n");
        return 0;
}
[aaronl@endquote:~]$ diet gcc -static -o hello hello.c # dietlibc
/usr/lib/diet/lib-i386/libc.a(vprintf.o)(.text+0x3d): In function
`vprintf': : warning: the printf functions add several kilobytes of bloat.
[aaronl@endquote:~]$ ls -l hello
-rwxr-xr-x    1 aaronl   aaronl       8896 Aug 21 20:54 hello
[aaronl@endquote:~]$ diet gcc -s -static -o hello hello.c
/usr/lib/diet/lib-i386/libc.a(vprintf.o)(.text+0x3d): In function
`vprintf': : warning: the printf functions add several kilobytes of bloat.
[aaronl@endquote:~]$ ls -l hello
-rwxr-xr-x    1 aaronl   aaronl       6212 Aug 21 20:55 hello
$ scp hello.c san.tropez.org:
$ ssh san.tropez.org
FreeBSD 4.8-RELEASE (TROPEZ) #0: Mon Apr  7 22:26:43 PDT 2003

% gcc -static -o hello hello.c
% ls -l hello
-rwxr-xr-x  1 aaronl  users  52917 Aug 21 20:50 hello
% gcc -s -static -o hello hello.c
% ls -l hello
-rwxr-xr-x  1 aaronl  users  47540 Aug 21 20:51 hello
% ^D
$ scp hello.c unix.ic.ucsc.edu:
$ ssh unix
% uname -a
SunOS unix1 5.8 Generic_108528-22 sun4u sparc SUNW,Ultra-80
% /opt/SUNWspro/bin/cc -B static hello.c -o hello
% ls -l hello
-rwxr-xr-x   1 alehmann user      408472 Aug 21 21:10 hello



More information about the linux-elitists mailing list