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

NITIN KHOSLA, BLOOMBERG/ 731 LEXIN nkhosla1 at bloomberg.net
Mon Jan 24 11:44:05 MST 2011

Hi Joel - 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.
Also from a local compiler expert at my company, 
"As for the errors ... from what I remember, the output of -E is not meant for
recompilation, whereas the output of -P is.  That's what I use when I need to
preprocess a source file and submit it to Sun compiler support to demonstrate a
compiler problem with a test case that uses local headers."

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


----- Original Message -----
From: Joel Rosdahl <joel at rosdahl.net>
To: ccache at lists.samba.org
At:  1/23 11:23:07

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
ccache mailing list
ccache at lists.samba.org

More information about the ccache mailing list