[ccache] Issues using ccache
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
On 20 January 2011 11:20, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote: > 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 link 1 > called for link 2 > > It should find it from cache second time. It did not. > cache hit (direct) 0 > cache miss 0 Linking is when the toolchain assembles the object files into an executable. [1] ccache doesn't cache these. Your command line is wrong; you need a -c option too, otherwise you're writing an executable into a .o file. [1] http://en.wikipedia.org/wiki/Linker_(computing) > 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 language 1" I don't know if it works with Solaris cc. -- Martin ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache
Re: [ccache] Issues using ccache
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
Re: [ccache] Issues using ccache
On 20 January 2011 12:52, NITIN KHOSLA, BLOOMBERG/ 731 LEXIN wrote: > 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. Apparently you can ;-) -- Martin ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache
[ccache] How to make ccache not interpret 'multiple' compiler options
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' compiler options
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: https://bugzilla.samba.org/show_bug.cgi?id=7556 > 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, continue; } +#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, } continue; } +#endif /* we need to work out where the output was meant to go */ if (str_eq(argv[i], "-o")) { -- Joel ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache
Re: [ccache] How to make ccache not interpret 'multiple'
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 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