[ccache] How to make ccache not interpret 'multiple'

Joel Rosdahl joel at rosdahl.net
Mon Jan 24 14:47:07 MST 2011


On 2011-01-24 19:44, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote:
> what i have been able to figure out is: solaris CC compiler uses
> another option(-P) to generate preprocessor file. If I compile the
> file with -P and then compile the generated .i file, it works!! The
> problem is the -P option doesn't obey the -o option. And ccache
> generates that -E output into a special tmp file.

ccache doesn't need -o, but it does currently need the preprocessed
output sent to stdout.

> [...]
> -P generates a .i file with same filename as original. So is there
> anyway to incorporate this into ccache.c ?

It looks like -P doesn't include information on which include files were
used, which means that the manifest mode can't be used. It would be
possible to make ccache use -P instead of -E (and restrict it to the
preprocessor mode), but to do that it must somehow know that the
compiler is Sun Studio. The prerequisite for that is the same as for
fixing <https://bugzilla.samba.org/show_bug.cgi?id=7556>: teaching
ccache how to do compiler detection.

There's actually another option as well: You can set CCACHE_CPP2 to make
ccache only use the -E output for identification but not for
compilation. This will make cache misses somewhat slower, but it should
work well otherwise.

-- Joel


More information about the ccache mailing list