+
* If the resulting file is modified, the file in the cache will also be
modified since they share content, which corrupts the cache entry. As of
- version 4.0, ccache performs a simple integrity check for cached files by
- verifying that their sizes are correct. This means that mistakes like `strip
- file.o` or `echo >file.o` will be detected, but a modification that doesn't
- change the file size will not.
+ version 4.0, ccache makes stored and fetched object files read-only as a
+ safety measure guard. Furthermore, a simple integrity check is made for
+ cached object files by verifying that their sizes are correct. This means
+ that mistakes like `strip file.o` or `echo >file.o` will be detected even if
+ the object file is made writeable, but a modification that doesn't change the
+ file size will not.
* Programs that don't expect that files from two different identical
compilations are hard links to each other can fail.
* Programs that rely on modification times (like ``make'') can be confused if
cc_log("Hard linking %s to %s", source.c_str(), dest.c_str());
int ret = link(source.c_str(), dest.c_str());
if (ret == 0) {
+ if (chmod(dest.c_str(), 0444) != 0) {
+ cc_log("Failed to chmod: %s", strerror(errno));
+ }
return true;
}
cc_log("Failed to hard link: %s", strerror(errno));