From: Damian Yerrick 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: References: X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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. --