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

Joel Rosdahl joel at rosdahl.net
Thu Jan 20 14:37:33 MST 2011

On 2011-01-20 21:01, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote:
> Facing an issue with solaris compiler options.
> Our solaris compiler command takes many -xflags.
> Command: ccache CC -xcode=pic32 -xdebugformat=stabs  -c -o file.o file.c
> [2011-01-20T14:54:50.499872 9962 ] Unsupported language: debugformat=stabs
> [2011-01-20T14:54:50.509438 9962 ] Result: unsupported source language

As you have noticed, ccache currently interprets -x flags like GCC does,
which does not work well with compilers that use -x for other things.
There's a bug report about it here:

> I used --ccache-skip but it seems I have to use this BEFORE every flag.

Yes, that's correct, and there's currently no other way, unless it's OK
for you to patch your locally built ccache like this:

--- a/ccache.c
+++ b/ccache.c
@@ -1323,6 +1323,7 @@ cc_process_args(struct args *orig_args, struct args **preprocessor_args,

+#if 0
                 * Special handling for -x: remember the last specified language before the
                 * input file and strip all -x options from the arguments.
@@ -1346,6 +1347,7 @@ cc_process_args(struct args *orig_args, struct args **preprocessor_args,

                /* we need to work out where the output was meant to go */
                if (str_eq(argv[i], "-o")) {

-- Joel

More information about the ccache mailing list