]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Don't pass -v to the preprocessor
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 6 Jun 2023 19:42:12 +0000 (21:42 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 7 Jun 2023 06:47:32 +0000 (08:47 +0200)
The -v option tells the compiler to print various diagnostics to stdout,
including randomly generated filenames. When ccache calls the
preprocessor and -v is on the command line, the random information will
become part of the input hash, making the preprocessor mode always
produce cache misses.

Fix this by only passing -v when compiling, not preprocessing.

Closes #1293.

src/compopt.cpp

index a7ec8b22c54cec3391f2c5fdf1f3d1c08f0393e8..f381c75e06175d6dc7b1be35b822cfc4f67384eb 100644 (file)
@@ -151,6 +151,7 @@ const CompOpt compopts[] = {
   {"-stdlib=", AFFECTS_CPP | TAKES_CONCAT_ARG},
   {"-trigraphs", AFFECTS_CPP},
   {"-u", TAKES_ARG | TAKES_CONCAT_ARG},
+  {"-v", AFFECTS_COMP},
   {"-z", TAKES_ARG | TAKES_CONCAT_ARG | AFFECTS_COMP},
 };