Mail Archives: djgpp/2000/04/07/15:31:24
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.)
- Raw text -