How do does the compiler driver and compiler driver work together?

Rupert Wood rup@kanat.pair.com
Tue Sep 3 01:28:00 GMT 2002


Guy Montag wrote:

> I am trying to understand how the compiler driver and compiler
> proper go together, where and how are they linked?

They're not. They're separate executables.

The compiler proper lives under

    <prefix>/lib/gcc-lib/<platform>/<version>

e.g. the C++ compiler proper installed in the default location on a Sun
box might be:

    /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/cc1plus

This path is hardcoded into the compiler driver. Try:

    gcc -print-prog-name=cc1plus

to see this. If you compile something and add the '-v' switch, you'll see
the compiler driver invoke the compiler proper and see the complete
command line used. Alternatively, if you start top in a separate
console/xterm while you're compiling something large, you'll see it chew
through process numbers (each gcc invocation will use at least one process
each for gcc, cc1 and as - or cc1plus/cc1obj/jc1/gnat1/f771/tree1/etc.
depending on the language used) and see the backend compiler processes
take up most of the time.

I don't have access to the source to point you at anything specific right
now, sorry.

Hope that helps,
Rup.



More information about the Gcc-help mailing list