gccg++

What is the difference between gcc/g++ and cc1/cc1plus?


When I compile my projects and check the resources used by running top, the big CPU/memory hog is sometimes called g++ and sometimes cc1plus. What is the difference between the two, and should I ever call cc1plus directly?


Solution

  • What is the difference between the two,

    The g++ is a compiler driver. It knows how to invoke the actual compiler (cc1plus), assembler and linker. It does not know how to parse or compile the sources.

    and should I ever call cc1plus directly?

    No.

    The cc1plus is internal implementation detail. The flags it accepts are neither documented, nor stable. The interface between g++ and cc1plus may involve more than just flags (e.g. there could be environment variables at play, and/or pipes/sockets).