Y 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   Q Received: by life.ai.mit.edu (4.0/AI-4.10) id AA02844; Fri, 7 Jul 89 19:01:40 EDT / Return-Path: <info-gcc-request@prep.ai.mit.edu> m 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 3 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 netnews8 	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, CA0 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  G From article <2686@daimi.dk>, by mkemi@jupiter.dk (Morten Kjeldsgaard): * >    $ link hello, sys$library:vaxcrtl/lib > J > and the resulting executable is 87 blocks!! A bit excessive for the most > minimal program possible!  > O > Any suggestions as how to decrease the .EXE file size would be most welcome!!   B As with Vax11c, the trick is use of shared libraries. The command:  ( 	$ link hello, share.opt/opt	! see below  L 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 ofE some sort because it returns dust to the caller, which is interpreted 0 as an error code. An explicit return fixes this.  > 	I anticipated a problem with errno, as it is usually declaredJ (in vax11c) as "extern noshare int errno", but GCC does not know about theL vax11c extension keyword "noshare". However, David Kashtan apparently _also_H anticipated such a problem so there is a hack in the stdio.h and errno.hI 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.  D 	Yes, folks, I would have mailed, but this looked like the rare caseI where more than one person might benefit from the info. I was also unsure E whether David Kashtan would respond this way, since this trick is not . included in the GCC/VMS write-up. Be happy :-)  	 					Mike   M | Mike Albaugh (albaugh@dms.UUCP || {...decwrl!turtlevax!}weitek!dms!albaugh) F | Atari Games Corp (Arcade Games, no relation to the makers of the ST); | 675 Sycamore Dr. Milpitas, CA 95035		voice: (408)434-1709 8 | The opinions expressed are my own (Boy, are they ever)