[ccache] @file arguments to ccache - Intel Compiler

Joel Rosdahl joel at rosdahl.net
Tue Oct 20 20:49:27 UTC 2015


>
> I was wondering why in ccache we are expanding @file
>
> https://github.com/venkrao/ccache-1/blob/59e5244dd79b0fc7df682c8f3c05b778a3d00f91/ccache.c#L1951


@file is expanded so that ccache can inspect the options in the file just
like options given on the command line. The alternative is to not expand
@file arguments and instead just fall back to running the compiler without
caching. (This was how ccache behaved before support for @file was added in
2012, see commit 0da6ddc169f1edfcfb1c37d8aa45c4257cf6c5c5.)

Essentially, the arguments that are to be listed in @file are those that affect
> the preprocessor.


How do you come to that conclusion? @file can, at least for GCC, contain
any options.

So, is it safe to just pass on the @file as-is to compiler, without
letting ccache
> read and expand the arguments?


In general: no.

I'm unable to decide how to go about supporting Intel compiler, especially with
> the @file. Intel compiler apparently even accepts special char like
> hello.h$ or regex based input args inside the @file which might make
> ccache handle them more difficult.


Well, if you want to use ccache with the Intel compiler, don't put comments
and other non-GCC-compatible stuff in @files. :-) But perhaps it would be
possible to parse @files in a way that is backward compatible with how GCC
works?

-- Joel


More information about the ccache mailing list