Re: [ccache] Making ccache and clang compatible
On Wednesday 11 of July 2012, Max Horn wrote: On 11.07.2012, at 02:34, Martin Pool wrote: On 5 July 2012 21:35, Mike Frysinger vap...@gentoo.org wrote: On Wednesday 04 July 2012 09:53:46 Max Horn wrote: err, -I/-isystem/-D/-U/etc... are preprocessor flags and are valid when running in preprocessor mode (-E). i don't know if clang is broken, or your analysis is incorrect, but certainly that behavior you describe is wrong. -mike I agree with you there, Mike, As do I, actually -- sorry, my email was indeed nonsense and confused. What I *meant* was that on the second run (the one without -E, with preprocessed data as input), clang prints out warnings. Now, I am not saying that ccache is doing anything wrong here, But you probably could. -I, -D, -U etc. are preprocessor options and not compiler options, and the preprocessor is (at least in the separate compilation steps theory) not run when the driver is fed preprocessed source. but I think the bug originally described in https://bugzilla.samba.org/show_bug.cgi?id=8460 could possibly be valid. If you are compiling from a .i or .ii file, the -D and -I options can't have any effect. It's reasonable for clang to emit a warning about it, and it would be reasonable for ccache to strip those options when compiling a preprocessed file. Aye, if that would be acceptable for the ccache authors, that would be the best solution I think. The best option is to use CCACHE_CPP2 with Clang. Giving Clang preprocessed source causes a number of small problems, such as some warnings not being suppressed or error/warning messages quoting modified source code. As a side-effect, this problem with preprocessor options will not exist with CCACHE_CPP2 either. It is a question how much not using CCACHE_CPP2 with Clang would improve performance anyway. -- Lubos Lunak l.lu...@suse.cz ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache
Re: [ccache] Making ccache and clang compatible
On 5 July 2012 21:35, Mike Frysinger vap...@gentoo.org wrote: On Wednesday 04 July 2012 09:53:46 Max Horn wrote: Using ccache with clang tends to generate tons of warnings, which can range from simply being annoying, to causing autoconf failures. This is because ccache runs the compiler with -E on preprocessed input, but also passes -I, -isystem etc. flags on to the compiler. In clang, this triggers warnings about unused arguments. err, -I/-isystem/-D/-U/etc... are preprocessor flags and are valid when running in preprocessor mode (-E). i don't know if clang is broken, or your analysis is incorrect, but certainly that behavior you describe is wrong. -mike I agree with you there, Mike, but I think the bug originally described in https://bugzilla.samba.org/show_bug.cgi?id=8460 could possibly be valid. If you are compiling from a .i or .ii file, the -D and -I options can't have any effect. It's reasonable for clang to emit a warning about it, and it would be reasonable for ccache to strip those options when compiling a preprocessed file. -- Martin ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache
Re: [ccache] Making ccache and clang compatible
On Wednesday 04 July 2012 09:53:46 Max Horn wrote: Using ccache with clang tends to generate tons of warnings, which can range from simply being annoying, to causing autoconf failures. This is because ccache runs the compiler with -E on preprocessed input, but also passes -I, -isystem etc. flags on to the compiler. In clang, this triggers warnings about unused arguments. err, -I/-isystem/-D/-U/etc... are preprocessor flags and are valid when running in preprocessor mode (-E). i don't know if clang is broken, or your analysis is incorrect, but certainly that behavior you describe is wrong. -mike signature.asc Description: This is a digitally signed message part. ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache
[ccache] Making ccache and clang compatible
Hi there, I was wondering if anybody is looking into making ccache compatible with clang (or perhaps vice versa, making clang compatible with ccache -- but that seems harder to me right now). Or if somebody would be willing to look into it... I'd be happy to help, but am not familiar with the ccache code base... But let me first point out the issue: Using ccache with clang tends to generate tons of warnings, which can range from simply being annoying, to causing autoconf failures. This is because ccache runs the compiler with -E on preprocessed input, but also passes -I, -isystem etc. flags on to the compiler. In clang, this triggers warnings about unused arguments. I just see that this has been reported before, roughly a year ago: https://bugzilla.samba.org/show_bug.cgi?id=8118 https://bugzilla.samba.org/show_bug.cgi?id=8460 See also http://petereisentraut.blogspot.de/2011/05/ccache-and-clang.html From the outside, it seems to me that the simplest quick fix would be to detect clang and add -Qunused-arguments to the parameter list for it, to suppress these warnings. But of course that would effectively disable this warning completely, preventing it from triggering on actual issues. An alternative way would be to remove all -I, -isystem etc. from the arguments being passed to clang. Cheers, Max ___ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache