www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/11/20:45:12

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP and Borland's compiler generated code size
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <ddlr0tknefk6eqhid2b1vrmgc5pji3aus7@4ax.com>
References: <madoka-6C398A DOT 16411011112000 AT news DOT supernews DOT com>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 48
X-Trace: +rUPLsgRN03NjfyhX8SF0/Q1jDHD7xh+45G2huStcOepkqm1xZg+izgTJszQTxMcLcsKCCCtnEyq!BGJDl7TkNj3LoRHatvenGMh+VrvxjH5VnAGFaTHPSHJNGJUsJ+4/Z2q04sys4ltnQvcKpLPzSGeS!USLmTw==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sun, 12 Nov 2000 01:41:53 GMT
Distribution: world
Date: Sun, 12 Nov 2000 01:41:54 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sat, 11 Nov 2000 16:41:10 -0500, Julian Hsiao <madoka AT novastar DOT com>
wrote:

>I'm currently taking a programming class and being short on budget, uses 
>DJGPP and Borland's free compiler and XEmacs for assignments.  The 
>reason I uses both compilers is because I try to avoid using certain 
>constructs that only GCC or Borland provides (well, I guess the only way 
>to completely avoid that is to code while reading the C++ specs paper, 
>but I'll pass on that...).
>
>Either one worked quite well for my purpose (except for some reason, 
>violating the const declaration only results in a warning in both 
>compilers, but an error in CW, which is what my class uses)

I treat warnings (except "this variable is unused") as errors.

>but I noticed that DJGPP's generated binary size is considerably larger
>than that of Borland compiler.  With DJGPP, I pretty much always get
>~200K  binaries while with Borland's compiler I get ~40K binaries.

A DJGPP 200K binary includes:
 o code to go into and out of protected mode
 o code to "glob" filenames passed on the command line
 o parts of DJGPP libc, which is large because it has to call DOS
   services through DPMI, it's nearly POSIX compliant, and it's
   optimized for speed (DOS calls through DPMI are _really_ expensive)
 o your code, using 32-bit constants
 o debugging information, which can be removed with strip.exe from
   djdev203.zip

A Borland 40K binary includes:
 o a much smaller libc, optimized for size
 o your code, using 16-bit constants
 o debugging information (unless you've turned it off)

Both kinds of exe can be made smaller with UPX:
  http://upx.tsx.org/
But why are you concerned about exe size anyway?  Do you have to fit
several binaries onto a single floppy?  If so, avoid duplicating libc
by combining several programs' function into one program.

-- 
<O
( \   GNOME vs. KDE: the game!
 X    http://pineight.8m.com/nes.htm

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


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