[ccache] auto-disabling ccache when gcc gets plugins?

Basile Starynkevitch basile at starynkevitch.net
Wed Oct 17 09:59:02 MDT 2012

Hello All,

(I'm the main developer of MELT see http://gcc-melt.org for more; MELT is a domain specific language
to extend GCC and is implemented as a plugin to GCC; MELT, as a DSL, is translated to C with a bootrapped translator implemented in MELT.)

It would be nice if ccache could be automatically disabled when invoked (thru symlinks) as gcc -fplugin=... but I am not familiar enough with ccache source code to propose a patch.

The reason for that wish is that a GCC plugin can do anything, including querying or updating a database, so any GCC compilation with some -fplugin=... argument, should, in my opinion, not be ccache-d.

MELT is particularily sensitive to that, and really wants that any gcc compilation having -fplugin=melt
would never be ccache-d. The reason is that MELT is often run on an empty file, for side effects
(such as translation of MELT code to some .so binary module, or some bunch of .c files). These executions should be never ccache-d.

If you know well the ccache implementation, please direct me to files to look. I guess that ccache.c is the main file to patch.

Minimaly, I would like that every compilation going thru ccache which has some -fplugin= argument to GCC would never be ccached.

Ideally, we could imagine having more sophisticated options, where the cache of ccache would also contain plugins to cache or to never-cache. Eg ccache --disable-gcc-plugin=melt might be given once, and then any ccache-d compilation with -fplugin=melt would never be cached.


Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

More information about the ccache mailing list