www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/02/09:43:35

Date: Wed, 2 Aug 1995 08:28:55 -0400
From: dj (DJ Delorie)
To: ecorvell AT irisa DOT fr
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: ** Comparison between DJGPP V2 & WATCOM C V10 **

> gcc -O1 a.c
> strip --strip-all a.out
> coff2exe a.out
> A.EXE SIZE=33280 bytes
> 
> gcc -O1 -c a.c -o a.o
> ld a.o -o a.out ../lib/gcrt0.o -L../lib -T../lib/djgpp.lnk -lc
> strip --strip-all a.out
> coff2exe a.out
> A.EXE SIZE=37376 bytes
> 
> wcc386 -os a.c
> wlink file a
> A.EXE SIZE=25468 bytes
> 
>    First, why is there a difference of size between the two gcc outputs ?

gcrt0.o is for profiling.  Linking it in causes the profiling routines
in libc.a to get linked in, causing the extra 4K.  Use crt0.o instead.

>    Second, I am VERY distappointed by the difference of size between gcc and
>  wcc386... :(

djgpp includes a lot of extra overhead to handle unix-like things that
watcom won't give you.  For example, command-line wildcards, long
command lines, environment variables from a file, etc.

It is possible in V2 to strip those out (it's documented, too!).  The
smallest (non-printf) program I can generate is 15,364 WITH the stub.
If you add printf, it goes to 24,580 - which is still smaller than
watcom.

DJ

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019