From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: Linking in .a files from within RHIDE Date: Fri, 07 Apr 2000 17:39:24 +0200 Organization: NetVision Israel Lines: 34 Message-ID: <38EE012C.3008E816@is.elta.co.il> References: <8ciba7$ttq$1 AT plato DOT wadham DOT ox DOT ac DOT uk> <38ECD3B0 DOT FE8403F8 AT hotmail DOT com> <8ckdam$343$1 AT plato DOT wadham DOT ox DOT ac DOT uk> NNTP-Posting-Host: ras1-p49.rvt.netvision.net.il Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.netvision.net.il 955121879 5206 62.0.172.51 (7 Apr 2000 15:37:59 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 7 Apr 2000 15:37:59 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,ru,hebrew To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com J-P wrote: > > Out of interest, is there any way of stopping > both gcc via RHIDE and command-line gcc from including all the POSIX stuff > and thus speeding up compile time? GCC doesn't include any ``POSIX stuff'' that your program doesn't call directly. The only exception to this rule is the startup code which expands wildcards, and the FAQ explains how to avoid linking it in. But that won't speed up linking in any way. > I noticed two things - the hack mentioned in the FAQ about getting rid of > some of gcc's automatically included functions, and the checkbox under > OPTIONS\LIBRARIES that says "include default libraries." Can I happily run > a non-POSIX program by removing libc.a linking? You cannot avoid linking against libc.a, because all the standard C functions, like printf, the interface with the OS, etc. reside in it. You cannot have a functional program without that, unless you write your own replacements. > It's again me trying to > convince my supervisor to move from Turbo C... :) His main complaint at > the moment is compile time. In general, the speed of compilation is not affected much by the libraries you link into your program. GCC is simply slower than Turbo C, because it does more optimizations, and because it is a portable compiler that cannot be too speedy on any particular platform. However, I'd be surprised if the speed difference could actually matter for any reasonable-size program. So please post the compilation speed you see. Perhaps your system is set up incorrectly. (The expected compilation speed is detailed in Chapter 7 of the FAQ.)