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

Joel Rosdahl joel at rosdahl.net
Sun Jan 23 09:22:59 MST 2011

On 2011-01-21 18:01, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote:
> CC: Invalid input file name /home/nkhosla/.ccache/tmp/FILENAME.ii, no
> output generated for this file.
> .
> Above is the error I get from ccache. I modified FILENAME part.
>>> Result: compiler produced no output
> .
> I found one post:
> http://www.mail-archive.com/distcc@lists.samba.org/msg02316.html That
> is that Sun CC apparently cannot correctly compile C++ templates when
> the file is preprocessed separately from compilation. Though that post
> is OLD. Is this still true regarding solaris CC compiler?

I tried /usr/bin/CC in Solaris 10 and I got it to work with a small test
program by setting CCACHE_EXTENSION=i. Does that work for you as well?

To get rid of the

    CC: Warning: "-E" redefines product from "object" to "source (stdout)"

warning, I had to make the following change as well:

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

 		/* we must have -c */
 		if (str_eq(argv[i], "-c")) {
-			args_add(stripped_args, argv[i]);
 			found_c_opt = true;
@@ -1687,6 +1686,10 @@ cc_process_args(struct args *orig_args, struct
args **preprocessor_args,
 		*compiler_args = args_copy(*preprocessor_args);

+	if (found_c_opt) {
+		args_add(*compiler_args, "-c");
+	}
 	 * Only pass dependency arguments to the preprocesor since Intel's C++
 	 * compiler doesn't produce a correct .d file when compiling preprocessed

-- Joel

More information about the ccache mailing list