[PATCH] D43109: LTO: Include live bit in ThinLTO cache key.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 10:43:01 PST 2018


pcc added a comment.

In https://reviews.llvm.org/D43109#1003417, @tejohnson wrote:

> Wondering whether there is a better way of proactively catching these issues - I assume it is currently ultimately detected through either linker failures or even worse, runtime failures. The only fully automated idea I have come up with is to have a debugging mode where we would force a native object to be produced even for cache hits, and would assert that the new and old objects are identical. Since that is expensive, the question would be how to run that broadly enough to catch bugs like this quickly, before it reaches the wild. Since the LLVM revision is used in the key, it would have to be using the same clang to build something large enough but at either different source revisions or with different enough options.
>
> Any other possibilities?


Generally in Chromium these types of bugs have resulted in cache entries being incorrectly shared between targets (i.e. executables or DSOs, not target architectures). In the past I have tried to identify them by giving each target its own cache directory, building all the targets in the project and using "diff" to identify files with identical keys but different content. I would imagine that that could be relatively easily automated given a project willing to support that configuration (perhaps Chromium would be a good candidate). The advantages are that it would not require compiler support and it would allow the names of the mismatching targets to be easily reported. The disadvantage is that it would require more disk space (which could be a problem for projects such as Chromium with a large number of targets) but perhaps it wouldn't be a problem in practice if we disable debug info.


Repository:
  rL LLVM

https://reviews.llvm.org/D43109





More information about the llvm-commits mailing list