[llvm] [CMake] Make precompiled headers opt-in for ccache builds (PR #141927)

Kajetan Puchalski via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 08:52:34 PDT 2025


mrkajetanp wrote:

> What happened with the `-fno-pch-timestamp` solution?

That part is fine, but this is a different problem. From what I understand the compiler handling of pch is supposed to be based on either the timestamp or the file size. The timestamp causes obvious ccache problems because it gets out of sync. That is solved by `-fno-pch-timestamp`.

In this case, the errors are:
```
has been modified since the precompiled header '(..)/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/cmake_pch.hxx.pch' was built: size changed (was 25444, now 25753)
```

So this is an actual size mismatch. If the header in question has actually changed, then CMake should have rebuilt it prior to rebuilding its users and this should not happen. But somehow it seems to irregularly pop up on some build bots. I am yet to see it on a local build, though that doesn't mean nobody else has.

https://github.com/llvm/llvm-project/pull/141927


More information about the llvm-commits mailing list