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

2011-01-24 Thread NITIN KHOSLA, BLOOMBERG/ 731 LEXIN
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 ?

thanks,
Nitin


- Original Message -
From: Joel Rosdahl j...@rosdahl.net
To: ccache@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;
 continue;
 }
@@ -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@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


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

2011-01-21 Thread NITIN KHOSLA, BLOOMBERG/ 731 LEXIN
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?

Nitin

- Original Message -
From: NITIN KHOSLA (BLOOMBERG/ 731 LEXIN)
To: j...@rosdahl.net
Cc: ccache@lists.samba.org
At:  1/20 17:29:30

Thanks Joel. I made the change and it seems to be working.
Though it works even when I do 'not' use --ccache-skip flag at all.
a) Is that what you expect?
b) It works for simple files But for a heavily templatized source file(object 
size = 23mb). ccache returned compiler produced no output but object file is 
generated   
   In cache log
   [2011-01-20T17:10:13.149794 1100 ] Compiler didn't produce an object file
   Result: compiler produced no output
  === Any clues in debugging that?
.
Goal: I am trying to use ccache to reduce compilation time for heavily 
templatized code(10 lines of code = 20-30mb of object file and many of such 
files). I may have to increase default size of 1GB to more. but if there
are any other suggestions/limitations to be aware of, please let me know.

thanks,
Nitin

- Original Message -
From: Joel Rosdahl j...@rosdahl.net
To: ccache@lists.samba.org
At:  1/20 16:37:43

On 2011-01-20 21:01, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote:
 Facing an issue with solaris compiler options.
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] Issues using ccache

2011-01-20 Thread NITIN KHOSLA, BLOOMBERG/ 731 LEXIN
I am using first time. I have read documentation but not found my answers.
Simple command: ccache gcc -o 1.o 1.c
ccache -V
ccache version 3.1.4

a) Ran first time and then second time. What called for link means?
   called for link1
   called for link2

   It should find it from cache second time. It did not.
   cache hit (direct) 0
   cache miss 0

b) I created a ccache log file(log below is same for exactly same above 
mentioned gcc command called multiple times). :
   [2011-01-20T12:01:14.788191 10060] Hostname: sun15
[2011-01-20T12:01:14.788261 10060] Working directory: /home/nkhosla
[2011-01-20T12:01:14.788969 10060] No -c option found
[2011-01-20T12:01:14.789013 10060] Failed; falling back to running the real comp
iler
[2011-01-20T12:01:14.789038 10060] Executing /opt/swt/bin/gcc -o 1.o 1.c
[2011-01-20T12:01:14.790973 10060] Acquired lock /home/nkhosla/.ccache/a/stats.l
ock
[2011-01-20T12:01:14.798012 10060] Releasing lock /home/nkhosla/.ccache/a/stats.
lock
[2011-01-20T12:01:14.798080 10060] Unlink /home/nkhosla/.ccache/a/stats.lock (as
-tmp)
[2011-01-20T12:01:14.798677 10060] Result: called for link
 
c) Running with solaris compiler (CC) somewhere calls ccfe. And for that, 
ccache says 
unsupported source language1

Can someone please comment or let me know if I am doing something not right?

thank you all,
Nitin
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Issues using ccache

2011-01-20 Thread NITIN KHOSLA, BLOOMBERG/ 731 LEXIN
Ok. Found it. ccache only works with compiler. So -c option has to be there. 
Tried with solaris compiler.

a) CC compiler's one of the options are as -xprefetch=no%auto,explicit 
.
ccache log says:
.
[2011-01-20T13:45:30.259109 13240] Unsupported language: 
prefetch=no%auto,explicit
[2011-01-20T13:45:30.259199 13240] Failed; falling back to running the real 
compiler
[2011-01-20T13:49:05.281862 3809 ] Result: unsupported source language
.
I tried ccache PATH/CC --ccache-skip but that did not help.

Should not that --ccache-skip ignore interpretation of compiler option?

b) Manpage says it may not work with other compiler than gcc/g++. 
   Can anybody confirm that ccache will not work AIX/SunOS compiler suite.
 
thanks,  
Nitin
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


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

2011-01-20 Thread NITIN KHOSLA, BLOOMBERG/ 731 LEXIN
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

If I remove that flag, it will complain on code=pic32.
.
I used --ccache-skip but it seems I have to use this BEFORE every flag.
So this will work:
* ccache /bb/util/common/studio12-v4/SUNWspro/bin/CC --ccache-skip -xcode=pic32 
--ccache-skip -xdebugformat=stabs -c -o file.o file.c
BUT not this:
* ccache /bb/util/common/studio12-v4/SUNWspro/bin/CC --ccache-skip -xcode=pic32 
 -xdebugformat=stabs -c -o 1.o 1.c
.
Is there a way to make it work using ccache-skip?

Nitin
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


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

2011-01-20 Thread NITIN KHOSLA, BLOOMBERG/ 731 LEXIN
Thanks Joel. I made the change and it seems to be working.
Though it works even when I do 'not' use --ccache-skip flag at all.
a) Is that what you expect?
b) It works for simple files But for a heavily templatized source file(object 
size = 23mb). ccache returned compiler produced no output but object file is 
generated   
   In cache log
   [2011-01-20T17:10:13.149794 1100 ] Compiler didn't produce an object file
   Result: compiler produced no output
  === Any clues in debugging that?
.
Goal: I am trying to use ccache to reduce compilation time for heavily 
templatized code(10 lines of code = 20-30mb of object file and many of such 
files). I may have to increase default size of 1GB to more. but if there
are any other suggestions/limitations to be aware of, please let me know.

thanks,
Nitin

- Original Message -
From: Joel Rosdahl j...@rosdahl.net
To: ccache@lists.samba.org
At:  1/20 16:37:43

On 2011-01-20 21:01, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote:
 Facing an issue with solaris compiler options.
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache