[ccache] ccache and precompiled headers

Joel Rosdahl joel at rosdahl.net
Tue Jul 13 09:31:01 MDT 2010

On 2010-07-03 14:22, Tor Arne Vestbø wrote:
> [...]
> Right, that would be a solution. I assume GCC does not barf it passed
> -fpch-preprocess in non-preprocess mode.

Yes, it works fine.

> [...]
> If that kind of compiler-feature-inspection is on the roadmap anyways
> that would indeed be an option, but I'm not sure it makes sense alone
> for this particular usecase since there is another workaround.

Yes, I think that we need to do compiler feature detection eventually.
The bug <https://bugzilla.samba.org/show_bug.cgi?id=7556>, which showed
up just a week ago, is a good example of a case where compiler-specific
behaviour would nice.

> [...]
> Hmm, this one worries me a bit. How are we going to figure out if the
> precompiled header contains __TIME__?

I don't think we can figure it out in a reasonable way, which is why we
need to always assume that __TIME__ is used if a preprocessed header is

> [...]
> As you can see removing pch from the build increases the total build
> time for the initial build (empty cache), but speeds up builds when
> there's something in the cache since we're hitting direct mode in
> almost all cases. When pch and ccache is used together the initial
> build time decreases, _but_ builds with a filled cache now take
> longer.
> Seems like we're hitting a lot more preprocessed cases for some
> reason. Dunno why that might be?

Please run with CCACHE_LOGFILE and check if the log says why direct mode
gets disabled.

-- Joel

More information about the ccache mailing list