Bug 8118 - don't pass -D, -I, -U to compiler
Summary: don't pass -D, -I, -U to compiler
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: dev
Hardware: All All
: P5 normal
Target Milestone: 3.2
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-05 19:01 UTC by Peter Eisentraut
Modified: 2014-11-17 19:24 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Eisentraut 2011-05-05 19:01:57 UTC
clang is apparently quite picky about passing inappropriate options to preprocessor vs. compiler.  With 3.1.4 a call to 'ccache clang' spits out this::

clang: warning: argument unused during compilation: '-c'

This was fixed in commit f0db645c75a2c063526685b791a4afd7b2884d1d.

But the quasi-opposite problem still exists, of the sort

clang: warning: argument unused during compilation: '-I .'

and similar to -D and -U options.  You might want to exclude these from being passed to the stage that compiles the preprocessed output.

Btw., you can avoid these warnings by using the option -Qunused-arguments, and really they don't hurt, but by default behavior of the combination ccache and clang is quite "scary".
Comment 1 Joel Rosdahl 2012-11-08 20:33:53 UTC
David Givone made a patch (thanks!) that solves this. Applied in 1ea5033e2d0d8a53d16ba694cd8d5324e27dac2a.
Comment 2 Bryan Drewery 2013-04-23 10:51:20 UTC
(In reply to comment #1)
> David Givone made a patch (thanks!) that solves this. Applied in
> 1ea5033e2d0d8a53d16ba694cd8d5324e27dac2a.

For clang, both f0db645c75a2c063526685b791a4afd7b2884d1d and 1ea5033e2d0d8a53d16ba694cd8d5324e27dac2a work for me to fix this issue. It would be nice if this was released in 3.1.x
Comment 3 Joel Rosdahl 2013-08-08 19:41:53 UTC
(In reply to comment #2)
> For clang, both f0db645c75a2c063526685b791a4afd7b2884d1d and
> 1ea5033e2d0d8a53d16ba694cd8d5324e27dac2a work for me to fix this issue. It
> would be nice if this was released in 3.1.x

I think that this is a too large change of behavior for a bug fix release. (3.1 doesn't have official clang support, by the way.) The development version of ccache (which will become 3.2 eventually) has other clang-related fixes as well, and yes, it's really about time to release 3.2...
Comment 4 Joel Rosdahl 2014-11-17 19:24:06 UTC
Included in v3.2.