From: CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::INFO-GCC-REQUEST" 7-JUL-1989 20:47 To: MRGATE::"ARISIA::EVERHART" Subj: Re: linking gcc object files on vax/vms Received: by life.ai.mit.edu (4.0/AI-4.10) id AA02844; Fri, 7 Jul 89 19:01:40 EDT Return-Path: Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.0/AI-4.10) id AA02836; Fri, 7 Jul 89 19:00:53 EDT Received: by tut.cis.ohio-state.edu (5.59/4.890612) id AA10224; Fri, 7 Jul 89 18:46:36 EDT Received: from USENET by tut.cis.ohio-state.edu with netnews for info-gcc@prep.ai.mit.edu (info-gcc@prep.ai.mit.edu) (contact usenet@tut.cis.ohio-state.edu if you have questions) Date: 7 Jul 89 22:00:42 GMT From: apple!motcsd!dms!albaugh@rutgers.edu (Mike Albaugh) Organization: Atari Games Inc., Milpitas, CA Subject: Re: linking gcc object files on vax/vms Message-Id: <779@dms.UUCP> References: <2686@daimi.dk> Sender: info-gcc-request@prep.ai.mit.edu To: info-gcc@prep.ai.mit.edu From article <2686@daimi.dk>, by mkemi@jupiter.dk (Morten Kjeldsgaard): > $ link hello, sys$library:vaxcrtl/lib > > and the resulting executable is 87 blocks!! A bit excessive for the most > minimal program possible! > > Any suggestions as how to decrease the .EXE file size would be most welcome!! As with Vax11c, the trick is use of shared libraries. The command: $ link hello, share.opt/opt ! see below produces a 4 block file(I just tried it with 1.34). The "magic" in share.opt is a single line: sys$library:vaxcrtl.exe/share Two caveats: The classic "hello" will probably exit with an error message of some sort because it returns dust to the caller, which is interpreted as an error code. An explicit return fixes this. I anticipated a problem with errno, as it is usually declared (in vax11c) as "extern noshare int errno", but GCC does not know about the vax11c extension keyword "noshare". However, David Kashtan apparently _also_ anticipated such a problem so there is a hack in the stdio.h and errno.h files to take care of it. Just be sure to #include these files if you use stdio or errno. Some of you might prefer: $ link hello,sys$input/opt sys$library:vaxcrtl.exe/share which is easily placed in your makefile. Yes, folks, I would have mailed, but this looked like the rare case where more than one person might benefit from the info. I was also unsure whether David Kashtan would respond this way, since this trick is not included in the GCC/VMS write-up. Be happy :-) Mike | Mike Albaugh (albaugh@dms.UUCP || {...decwrl!turtlevax!}weitek!dms!albaugh) | Atari Games Corp (Arcade Games, no relation to the makers of the ST) | 675 Sycamore Dr. Milpitas, CA 95035 voice: (408)434-1709 | The opinions expressed are my own (Boy, are they ever)