summaryrefslogtreecommitdiff
path: root/doc/MANUAL.adoc
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2022-04-03 08:59:46 +0200
committerJoel Rosdahl <joel@rosdahl.net>2022-04-03 09:06:17 +0200
commit492f3e4ab3f06694cf7cc86ead49fc7876080cc6 (patch)
treedb231d457370742aa181e27753caef043dccacd4 /doc/MANUAL.adoc
parent836f76e9c02acc00925f0b3ed2ba9ae9d379b823 (diff)
downloadccache-492f3e4ab3f06694cf7cc86ead49fc7876080cc6.tar.gz
fix: Improve handling of .gcno files
When support for caching a compilation with coverage (producing a .gcno file), the commit[1] made sure to avoid rewriting the input path to relative with the motivation “also make sure to use the source file path, since this is in the notes”. However, this seems to be unnecessary since a relative input file path will be written as is to the .gcno, not the absolute path. This is the case for at least GCC 4.7+ and Clang 3.6+. Fix this by potentially converting the input path to relative even when generating coverage. When investigating the above issue, I noticed that GCC 9+ includes the current working directory (CWD) in the .gcno file. This means that we have include the CWD in the hash when compiling with -ftest-coverage/--coverage in order to replicate what the compiler would produce. Since this makes it impossible get cache hits when compiling in different directories, a new gcno_cwd sloppiness has been added for opting out of hashing the CWD, with the tradeoff of potentially getting an incorrect directory in the .gcno file. [1]: 02d3f078bd2495b8db2264ae0b2c692b4c5ba1bd Fixes #1032.
Diffstat (limited to 'doc/MANUAL.adoc')
-rw-r--r--doc/MANUAL.adoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/MANUAL.adoc b/doc/MANUAL.adoc
index 0cf11e62..05bb97d7 100644
--- a/doc/MANUAL.adoc
+++ b/doc/MANUAL.adoc
@@ -913,6 +913,14 @@ Examples:
*file_stat_matches_ctime*::
Ignore ctimes when *file_stat_matches* is enabled. This can be useful when
backdating files' mtimes in a controlled way.
+*gcno_cwd*::
+ By default, ccache will include the current working directory in the hash
+ when producing a `.gcno` file (when compiling with `-ftest-coverage` or
+ `--coverage`). This is because GCC 9+ includes the current working directory
+ in the `.gcno` file. The *gcno_cwd* sloppiness makes ccache not hash the
+ current working directory so that you can get cache hits when compiling in
+ different directories, with the tradeoff of potentially getting an incorrect
+ directory in the `.gcno` file.
*include_file_ctime*::
By default, ccache will not cache a file if it includes a header whose ctime
is too new. This sloppiness disables that check. See also