<body class="article">\r
<div id="header">\r
<h1>ccache authors</h1>\r
-<span id="revnumber">version 3.3.3</span>\r
+<span id="revnumber">version 3.3.4</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</li>\r
<li>\r
<p>\r
-Anders Björklund <<a href="mailto:anders@itension.se">anders@itension.se</a>>\r
+Anders Björklund <<a href="mailto:anders@psqr.se">anders@psqr.se</a>>\r
</p>\r
</li>\r
<li>\r
</li>\r
<li>\r
<p>\r
+Philippe Proulx <<a href="mailto:eeppeliteloop@gmail.com">eeppeliteloop@gmail.com</a>>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
RW <<a href="mailto:fbsd06@mlists.homeunix.com">fbsd06@mlists.homeunix.com</a>>\r
</p>\r
</li>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.3.3<br />\r
+Version 3.3.4<br />\r
Last updated\r
- 2016-10-26 23:04:27 CEST\r
+ 2017-02-17 22:27:14 CET\r
</div>\r
</div>\r
</body>\r
ccache is a collective work with contributions from many people, including:
* Alfred Landrum <alfred.landrum@riverbed.com>
-* Anders Björklund <anders@itension.se>
+* Anders Björklund <anders@psqr.se>
* Andrea Bittau <a.bittau@cs.ucl.ac.uk>
* Andrew P Boie <andrew.p.boie@intel.com>
* Andrew Stubbs <ams@codesourcery.com>
* Patrick von Reth <vonreth@kde.org>
* Paul Griffith <paulg@cse.yorku.ca>
* Pavel Boldin <pboldin@cloudlinux.com>
+* Philippe Proulx <eeppeliteloop@gmail.com>
* RW <fbsd06@mlists.homeunix.com>
* Ramiro Polla <ramiro.polla@gmail.com>
* Robin H. Johnson <robbat2@gentoo.org>
<body class="article">\r
<div id="header">\r
<h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.3.3</span>\r
+<span id="revnumber">version 3.3.4</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
<div class="listingblock">\r
<div class="content">\r
<pre><code> Copyright (C) 2002-2007 Andrew Tridgell\r
- Copyright (C) 2009-2016 Joel Rosdahl</code></pre>\r
+ Copyright (C) 2009-2017 Joel Rosdahl</code></pre>\r
</div></div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.3.3<br />\r
+Version 3.3.4<br />\r
Last updated\r
- 2016-10-26 23:04:27 CEST\r
+ 2017-02-17 22:27:14 CET\r
</div>\r
</div>\r
</body>\r
-------------------------------------------------------------------------------
Copyright (C) 2002-2007 Andrew Tridgell
- Copyright (C) 2009-2016 Joel Rosdahl
+ Copyright (C) 2009-2017 Joel Rosdahl
-------------------------------------------------------------------------------
<body class="article">\r
<div id="header">\r
<h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.3.3</span>\r
+<span id="revnumber">version 3.3.4</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
<div class="paragraph"><p>When run as a compiler, ccache usually just takes the same command line options\r
as the compiler you are using. The only exception to this is the option\r
<strong>--ccache-skip</strong>. That option can be used to tell ccache to avoid interpreting\r
-the next option in any way and to pass it along to the compiler as-is. <strong>Note</strong>:\r
-<strong>--ccache-skip</strong> currently only tells ccache not to interpret the next option as\r
-a special compiler option — the option will still be included in the direct\r
-mode hash.</p></div>\r
+the next option in any way and to pass it along to the compiler as-is.</p></div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content"><strong>--ccache-skip</strong> currently only tells ccache not to interpret the next\r
+option as a special compiler option — the option will still be included in the\r
+direct mode hash.</td>\r
+</tr></table>\r
+</div>\r
<div class="paragraph"><p>The reason this can be important is that ccache does need to parse the command\r
line and determine what is an input filename and what is a compiler option, as\r
it needs the input filename to determine the name of the resulting object file\r
</p>\r
<div class="openblock">\r
<div class="content">\r
-<div class="ulist"><ul>\r
-<li>\r
-<p>\r
-<code>%compiler% -v</code>\r
-</p>\r
-</li>\r
-<li>\r
-<p>\r
-<code>%compiler% -dumpmachine; %compiler% -dumpversion</code>\r
-</p>\r
-</li>\r
-</ul></div>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><code>%compiler% -v</code></pre>\r
+</div></div>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><code>%compiler% -dumpmachine; %compiler% -dumpversion</code></pre>\r
+</div></div>\r
<div class="paragraph"><p>You should make sure that the specified command is as fast as possible since it\r
will be run once for each ccache invocation.</p></div>\r
<div class="paragraph"><p>Identifying the compiler using a command is useful if you want to avoid cache\r
Exception: The CWD will not be included in the hash if <strong>base_dir</strong> is set\r
(and matches the CWD) and the compiler option <strong>-fdebug-prefix-map</strong> is used.\r
</p>\r
-<div class="literalblock">\r
-<div class="content">\r
-<pre><code>The reason for including the CWD in the hash by default is to prevent a\r
-problem with the storage of the current working directory in the debug info\r
-of an object file, which can lead ccache to return a cached object file\r
-that has the working directory in the debug info set incorrectly.</code></pre>\r
-</div></div>\r
-<div class="literalblock">\r
-<div class="content">\r
-<pre><code>You can disable this setting to get cache hits when compiling the same\r
-source code in different directories if you don't mind that CWD in the\r
-debug info might be incorrect.</code></pre>\r
-</div></div>\r
+<div class="paragraph"><p>The reason for including the CWD in the hash by default is to prevent a problem\r
+with the storage of the current working directory in the debug info of an\r
+object file, which can lead ccache to return a cached object file that has the\r
+working directory in the debug info set incorrectly.</p></div>\r
+<div class="paragraph"><p>You can disable this setting to get cache hits when compiling the same source\r
+code in different directories if you don’t mind that CWD in the debug info\r
+might be incorrect.</p></div>\r
</dd>\r
<dt class="hdlist1">\r
<strong>ignore_headers_in_manifest</strong> (<strong>CCACHE_IGNOREHEADERS</strong>)\r
cache miss run the compiler on the source code to get hold of the object\r
file. This is the default.\r
</p>\r
-<div class="literalblock">\r
-<div class="content">\r
-<pre><code>If false, ccache will first run preprocessor to preprocess the source code\r
-and then on a cache miss run the compiler on the _preprocessed source code_\r
-instead of the original source code. This makes cache misses slightly\r
-faster since the source code only has to be preprocessed once. The downside\r
-is that some compilers won't produce the same result (for instance\r
-diagnostics warnings) when compiling preprocessed source code.</code></pre>\r
-</div></div>\r
+<div class="paragraph"><p>If false, ccache will first run preprocessor to preprocess the source code and\r
+then on a cache miss run the compiler on the <em>preprocessed source code</em> instead\r
+of the original source code. This makes cache misses slightly faster since the\r
+source code only has to be preprocessed once. The downside is that some\r
+compilers won’t produce the same result (for instance diagnostics warnings)\r
+when compiling preprocessed source code.</p></div>\r
</dd>\r
<dt class="hdlist1">\r
<strong>sloppiness</strong> (<strong>CCACHE_SLOPPINESS</strong>)\r
</div>\r
</div>\r
<div class="sect1">\r
+<h2 id="_cache_statistics">Cache statistics</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>ccache -s/--show-stats</strong> can show the following statistics:</p></div>\r
+<div class="tableblock">\r
+<table rules="all"\r
+width="100%"\r
+frame="border"\r
+cellspacing="0" cellpadding="4">\r
+<col width="30%" />\r
+<col width="70%" />\r
+<thead>\r
+<tr>\r
+<th align="left" valign="top">Name </th>\r
+<th align="left" valign="top"> Description</th>\r
+</tr>\r
+</thead>\r
+<tbody>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">autoconf compile/link</p></td>\r
+<td align="left" valign="top"><p class="table">Uncachable compilation or linking by an autoconf test.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">bad compiler arguments</p></td>\r
+<td align="left" valign="top"><p class="table">Malformed compiler argument, e.g. missing a value for an option that requires\r
+an argument or failure to read a file specified by an option argument.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">cache file missing</p></td>\r
+<td align="left" valign="top"><p class="table">A file was unexpectedly missing from the cache. This only happens in rare\r
+situations, e.g. if one ccache instance is about to get a file from the cache\r
+while another instance removed the file as part of cache cleanup.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">cache hit (direct)</p></td>\r
+<td align="left" valign="top"><p class="table">A result was successfully found using <a href="#_the_direct_mode">the direct mode</a>.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">cache hit (preprocessed)</p></td>\r
+<td align="left" valign="top"><p class="table">A result was successfully found using <a href="#_the_preprocessor_mode">the preprocessor mode</a>.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">cache miss</p></td>\r
+<td align="left" valign="top"><p class="table">No result was found.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">cache size</p></td>\r
+<td align="left" valign="top"><p class="table">Current size of the cache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">called for link</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler was called for linking, not compiling.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">called for preprocessing</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler was called for preprocessing, not compiling.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">can’t use precompiled header</p></td>\r
+<td align="left" valign="top"><p class="table">Preconditions for using <a href="#_precompiled_headers">precompiled headers</a> were not\r
+fulfilled.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">ccache internal error</p></td>\r
+<td align="left" valign="top"><p class="table">Unexpected failure, e.g. due to problems reading/writing the cache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">cleanups performed</p></td>\r
+<td align="left" valign="top"><p class="table">Number of cleanups performed, either implicitly due to the cache size limit\r
+being reached or due to explicit <strong>ccache -c/--cleanup</strong> calls.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">compile failed</p></td>\r
+<td align="left" valign="top"><p class="table">The compilation failed. No result stored in the cache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">compiler check failed</p></td>\r
+<td align="left" valign="top"><p class="table">A compiler check program specified by <strong>compiler_check</strong> (<strong>CCACHE_COMPILERCHECK</strong>)\r
+failed.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">compiler produced empty output</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler’s output file (typically an object file) was empty after\r
+compilation.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">compiler produced no output</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler’s output file (typically an object file) was missing after\r
+compilation.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">compiler produced stdout</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler wrote data to standard output. This is something that compilers\r
+normally never do, so ccache is not designed to store such output in the cache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">couldn’t find the compiler</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler to execute could not be found.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">error hashing extra file</p></td>\r
+<td align="left" valign="top"><p class="table">Failure reading a file specified by <strong>extra_files_to_hash</strong>\r
+(<strong>CCACHE_EXTRAFILES</strong>).</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">files in cache</p></td>\r
+<td align="left" valign="top"><p class="table">Current number of files in the cache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">multiple source files</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler was called to compile multiple source files in one go. This is not\r
+supported by ccache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">no input file</p></td>\r
+<td align="left" valign="top"><p class="table">No input file was specified to the compiler.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">output to a non-regular file</p></td>\r
+<td align="left" valign="top"><p class="table">The output path specified with <strong>-o</strong> is not a file (e.g. a directory or a device\r
+node).</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">output to stdout</p></td>\r
+<td align="left" valign="top"><p class="table">The compiler was instructed to write its output to standard output using <strong>-o\r
+-</strong>. This is not supported by ccache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">preprocessor error</p></td>\r
+<td align="left" valign="top"><p class="table">Preprocessing the source code using the compiler’s <strong>-E</strong> option failed.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">unsupported code directive</p></td>\r
+<td align="left" valign="top"><p class="table">Code like the assembler “.incbin” directive was found. This is not supported\r
+by ccache.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">unsupported compiler option</p></td>\r
+<td align="left" valign="top"><p class="table">A compiler option not supported by ccache was found.</p></td>\r
+</tr>\r
+<tr>\r
+<td align="left" valign="top"><p class="table">unsupported source language</p></td>\r
+<td align="left" valign="top"><p class="table">A source language e.g. specified with <strong>-x</strong> was unsupported by ccache.</p></td>\r
+</tr>\r
+</tbody>\r
+</table>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
<h2 id="_how_ccache_works">How ccache works</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p>The basic idea is to detect when you are compiling exactly the same code a\r
<p>\r
Make sure that the setgid bit is set on all directories in the cache. This\r
tells the filesystem to inherit group ownership for new directories. The\r
- command “find $CCACHE_DIR -type d | xargs chmod g+s” might be useful for\r
- this.\r
+ following command might be useful for this:\r
</p>\r
+<div class="openblock">\r
+<div class="content">\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><code>find $CCACHE_DIR -type d | xargs chmod g+s</code></pre>\r
+</div></div>\r
+</div></div>\r
</li>\r
</ul></div>\r
<div class="paragraph"><p>The reason to avoid the hard link mode is that the hard links cause unwanted\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.3.3<br />\r
+Version 3.3.4<br />\r
Last updated\r
- 2016-10-26 23:21:34 CEST\r
+ 2017-02-12 14:58:39 CET\r
</div>\r
</div>\r
</body>\r
When run as a compiler, ccache usually just takes the same command line options
as the compiler you are using. The only exception to this is the option
*--ccache-skip*. That option can be used to tell ccache to avoid interpreting
-the next option in any way and to pass it along to the compiler as-is. *Note*:
-*--ccache-skip* currently only tells ccache not to interpret the next option as
-a special compiler option -- the option will still be included in the direct
-mode hash.
+the next option in any way and to pass it along to the compiler as-is.
+
+NOTE: *--ccache-skip* currently only tells ccache not to interpret the next
+option as a special compiler option -- the option will still be included in the
+direct mode hash.
The reason this can be important is that ccache does need to parse the command
line and determine what is an input filename and what is a compiler option, as
separator. Examples:
+
--
-* +%compiler% -v+
-* +%compiler% -dumpmachine; %compiler% -dumpversion+
+
+----
+%compiler% -v
+----
+
+----
+%compiler% -dumpmachine; %compiler% -dumpversion
+----
You should make sure that the specified command is as fast as possible since it
will be run once for each ccache invocation.
when generating debug info (compiler option *-g* with variations).
Exception: The CWD will not be included in the hash if *base_dir* is set
(and matches the CWD) and the compiler option *-fdebug-prefix-map* is used.
-
- The reason for including the CWD in the hash by default is to prevent a
- problem with the storage of the current working directory in the debug info
- of an object file, which can lead ccache to return a cached object file
- that has the working directory in the debug info set incorrectly.
-
- You can disable this setting to get cache hits when compiling the same
- source code in different directories if you don't mind that CWD in the
- debug info might be incorrect.
++
+The reason for including the CWD in the hash by default is to prevent a problem
+with the storage of the current working directory in the debug info of an
+object file, which can lead ccache to return a cached object file that has the
+working directory in the debug info set incorrectly.
++
+You can disable this setting to get cache hits when compiling the same source
+code in different directories if you don't mind that CWD in the debug info
+might be incorrect.
*ignore_headers_in_manifest* (*CCACHE_IGNOREHEADERS*)::
code (see <<_the_preprocessor_mode,THE PREPROCESSOR MODE>>) and then on a
cache miss run the compiler on the source code to get hold of the object
file. This is the default.
-
- If false, ccache will first run preprocessor to preprocess the source code
- and then on a cache miss run the compiler on the _preprocessed source code_
- instead of the original source code. This makes cache misses slightly
- faster since the source code only has to be preprocessed once. The downside
- is that some compilers won't produce the same result (for instance
- diagnostics warnings) when compiling preprocessed source code.
++
+If false, ccache will first run preprocessor to preprocess the source code and
+then on a cache miss run the compiler on the _preprocessed source code_ instead
+of the original source code. This makes cache misses slightly faster since the
+source code only has to be preprocessed once. The downside is that some
+compilers won't produce the same result (for instance diagnostics warnings)
+when compiling preprocessed source code.
*sloppiness* (*CCACHE_SLOPPINESS*)::
the compression level with *compression_level*.
+Cache statistics
+----------------
+
+*ccache -s/--show-stats* can show the following statistics:
+
+[options="header",cols="30%,70%"]
+|==============================================================================
+|Name | Description
+| autoconf compile/link |
+Uncachable compilation or linking by an autoconf test.
+
+| bad compiler arguments |
+Malformed compiler argument, e.g. missing a value for an option that requires
+an argument or failure to read a file specified by an option argument.
+
+| cache file missing |
+A file was unexpectedly missing from the cache. This only happens in rare
+situations, e.g. if one ccache instance is about to get a file from the cache
+while another instance removed the file as part of cache cleanup.
+
+| cache hit (direct) |
+A result was successfully found using <<_the_direct_mode,the direct mode>>.
+
+| cache hit (preprocessed) |
+A result was successfully found using <<_the_preprocessor_mode,the preprocessor
+mode>>.
+
+| cache miss |
+No result was found.
+
+| cache size |
+Current size of the cache.
+
+| called for link |
+The compiler was called for linking, not compiling.
+
+| called for preprocessing |
+The compiler was called for preprocessing, not compiling.
+
+| can't use precompiled header |
+Preconditions for using <<_precompiled_headers,precompiled headers>> were not
+fulfilled.
+
+| ccache internal error |
+Unexpected failure, e.g. due to problems reading/writing the cache.
+
+| cleanups performed |
+Number of cleanups performed, either implicitly due to the cache size limit
+being reached or due to explicit *ccache -c/--cleanup* calls.
+
+| compile failed |
+The compilation failed. No result stored in the cache.
+
+| compiler check failed |
+A compiler check program specified by *compiler_check* (*CCACHE_COMPILERCHECK*)
+failed.
+
+| compiler produced empty output |
+The compiler's output file (typically an object file) was empty after
+compilation.
+
+| compiler produced no output |
+The compiler's output file (typically an object file) was missing after
+compilation.
+
+| compiler produced stdout |
+The compiler wrote data to standard output. This is something that compilers
+normally never do, so ccache is not designed to store such output in the cache.
+
+| couldn't find the compiler |
+The compiler to execute could not be found.
+
+| error hashing extra file |
+Failure reading a file specified by *extra_files_to_hash*
+(*CCACHE_EXTRAFILES*).
+
+| files in cache |
+Current number of files in the cache.
+
+| multiple source files |
+The compiler was called to compile multiple source files in one go. This is not
+supported by ccache.
+
+| no input file |
+No input file was specified to the compiler.
+
+| output to a non-regular file |
+The output path specified with *-o* is not a file (e.g. a directory or a device
+node).
+
+| output to stdout |
+The compiler was instructed to write its output to standard output using *-o
+-*. This is not supported by ccache.
+
+| preprocessor error |
+Preprocessing the source code using the compiler's *-E* option failed.
+
+| unsupported code directive |
+Code like the assembler ``.incbin'' directive was found. This is not supported
+by ccache.
+
+| unsupported compiler option |
+A compiler option not supported by ccache was found.
+
+| unsupported source language |
+A source language e.g. specified with *-x* was unsupported by ccache.
+
+|==============================================================================
+
+
How ccache works
----------------
(and that you trust all users of the shared cache).
* Make sure that the setgid bit is set on all directories in the cache. This
tells the filesystem to inherit group ownership for new directories. The
- command ``find $CCACHE_DIR -type d | xargs chmod g+s'' might be useful for
- this.
+ following command might be useful for this:
++
+--
+----
+find $CCACHE_DIR -type d | xargs chmod g+s
+----
+--
The reason to avoid the hard link mode is that the hard links cause unwanted
side effects, as all links to a cached file share the file's modification
<body class="article">\r
<div id="header">\r
<h1>ccache news</h1>\r
-<span id="revnumber">version 3.3.3</span>\r
+<span id="revnumber">version 3.3.4</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>\r
<div id="content">\r
<div class="sect1">\r
+<h2 id="_ccache_3_3_4">ccache 3.3.4</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2017-02-17</p></div>\r
+<div class="sect2">\r
+<h3 id="_new_features_and_improvements">New features and improvements</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Documented the different cache statistics counters.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed a regression in ccache 3.3 related to potentially bad content of\r
+ dependency files when compiling identical source code but with different\r
+ source paths. This was only partially fixed in 3.3.2 and reverts the new\r
+ “Names of included files are no longer included in the hash of the\r
+ compiler’s preprocessed output” feature in 3.3.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Corrected statistics counter for <code>-optf</code>/<code>--options-file</code> failure.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed undefined behavior warnings in ccache found by <code>-fsanitize=undefined</code>.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
<h2 id="_ccache_3_3_3">ccache 3.3.3</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-10-26</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-09-28</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-09-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_2">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-09-28</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-09-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-07-20</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-07-12</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-04-17</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_2">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_3">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2015-10-08</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2015-08-16</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_3">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_4">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2015-05-10</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_4">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_5">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2014-12-10</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2014-11-17</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_5">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_6">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2016-07-12</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_15">Bug fixes</h3>\r
+<h3 id="_bug_fixes_16">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2015-03-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_16">Bug fixes</h3>\r
+<h3 id="_bug_fixes_17">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2014-10-19</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_6">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_7">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_17">Bug fixes</h3>\r
+<h3 id="_bug_fixes_18">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_18">Bug fixes</h3>\r
+<h3 id="_bug_fixes_19">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2012-08-11</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_7">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_8">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_19">Bug fixes</h3>\r
+<h3 id="_bug_fixes_20">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_20">Bug fixes</h3>\r
+<h3 id="_bug_fixes_21">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2011-08-21</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_8">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_9">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_21">Bug fixes</h3>\r
+<h3 id="_bug_fixes_22">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2011-05-29</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_9">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_10">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_22">Bug fixes</h3>\r
+<h3 id="_bug_fixes_23">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_23">Bug fixes</h3>\r
+<h3 id="_bug_fixes_24">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_24">Bug fixes</h3>\r
+<h3 id="_bug_fixes_25">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_25">Bug fixes</h3>\r
+<h3 id="_bug_fixes_26">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_26">Bug fixes</h3>\r
+<h3 id="_bug_fixes_27">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-09-16</p></div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_10">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_11">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_27">Bug fixes</h3>\r
+<h3 id="_bug_fixes_28">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_28">Bug fixes</h3>\r
+<h3 id="_bug_fixes_29">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_new_features_and_improvements_11">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_12">New features and improvements</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_29">Bug fixes</h3>\r
+<h3 id="_bug_fixes_30">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.3.3<br />\r
+Version 3.3.4<br />\r
Last updated\r
- 2016-10-26 23:30:56 CEST\r
+ 2017-02-17 22:28:35 CET\r
</div>\r
</div>\r
</body>\r
ccache news
===========
+ccache 3.3.4
+------------
+Release date: 2017-02-17
+
+New features and improvements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Documented the different cache statistics counters.
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed a regression in ccache 3.3 related to potentially bad content of
+ dependency files when compiling identical source code but with different
+ source paths. This was only partially fixed in 3.3.2 and reverts the new
+ ``Names of included files are no longer included in the hash of the
+ compiler's preprocessed output'' feature in 3.3.
+
+- Corrected statistics counter for `-optf`/`--options-file` failure.
+
+- Fixed undefined behavior warnings in ccache found by `-fsanitize=undefined`.
+
+
ccache 3.3.3
------------
Release date: 2016-10-26
.\" Title: ccache
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 10/26/2016
+.\" Date: 02/17/2017
.\" Manual: ccache Manual
-.\" Source: ccache 3.3.3
+.\" Source: ccache 3.3.4
.\" Language: English
.\"
-.TH "CCACHE" "1" "10/26/2016" "ccache 3\&.3\&.3" "ccache Manual"
+.TH "CCACHE" "1" "02/17/2017" "ccache 3\&.3\&.4" "ccache Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.RE
.SH "EXTRA OPTIONS"
.sp
-When run as a compiler, ccache usually just takes the same command line options as the compiler you are using\&. The only exception to this is the option \fB\-\-ccache\-skip\fR\&. That option can be used to tell ccache to avoid interpreting the next option in any way and to pass it along to the compiler as\-is\&. \fBNote\fR: \fB\-\-ccache\-skip\fR currently only tells ccache not to interpret the next option as a special compiler option \(em the option will still be included in the direct mode hash\&.
+When run as a compiler, ccache usually just takes the same command line options as the compiler you are using\&. The only exception to this is the option \fB\-\-ccache\-skip\fR\&. That option can be used to tell ccache to avoid interpreting the next option in any way and to pass it along to the compiler as\-is\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+\fB\-\-ccache\-skip\fR currently only tells ccache not to interpret the next option as a special compiler option \(em the option will still be included in the direct mode hash\&.
+.sp .5v
+.RE
.sp
The reason this can be important is that ccache does need to parse the command line and determine what is an input filename and what is a compiler option, as it needs the input filename to determine the name of the resulting object file (among other things)\&. The heuristic ccache uses when parsing the command line is that any argument that exists as a file is treated as an input file name\&. By using \fB\-\-ccache\-skip\fR you can force an option to not be treated as an input file name and instead be passed along to the compiler as a command line option\&.
.sp
\fB%compiler%\fR
will be replaced with the path to the compiler\&. Several commands can be specified with semicolon as separator\&. Examples:
.sp
+.if n \{\
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
.\}
+.nf
%compiler% \-v
+.fi
+.if n \{\
.RE
+.\}
.sp
+.if n \{\
.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
.\}
+.nf
%compiler% \-dumpmachine; %compiler% \-dumpversion
+.fi
+.if n \{\
.RE
+.\}
.sp
You should make sure that the specified command is as fast as possible since it will be run once for each ccache invocation\&.
.sp
\fB\-fdebug\-prefix\-map\fR
is used\&.
.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-The reason for including the CWD in the hash by default is to prevent a
-problem with the storage of the current working directory in the debug info
-of an object file, which can lead ccache to return a cached object file
-that has the working directory in the debug info set incorrectly\&.
-.fi
-.if n \{\
-.RE
-.\}
+The reason for including the CWD in the hash by default is to prevent a problem with the storage of the current working directory in the debug info of an object file, which can lead ccache to return a cached object file that has the working directory in the debug info set incorrectly\&.
.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-You can disable this setting to get cache hits when compiling the same
-source code in different directories if you don\*(Aqt mind that CWD in the
-debug info might be incorrect\&.
-.fi
-.if n \{\
-.RE
-.\}
+You can disable this setting to get cache hits when compiling the same source code in different directories if you don\(cqt mind that CWD in the debug info might be incorrect\&.
.RE
.PP
\fBignore_headers_in_manifest\fR (\fBCCACHE_IGNOREHEADERS\fR)
If true, ccache will first run the preprocessor to preprocess the source code (see
THE PREPROCESSOR MODE) and then on a cache miss run the compiler on the source code to get hold of the object file\&. This is the default\&.
.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-If false, ccache will first run preprocessor to preprocess the source code
-and then on a cache miss run the compiler on the _preprocessed source code_
-instead of the original source code\&. This makes cache misses slightly
-faster since the source code only has to be preprocessed once\&. The downside
-is that some compilers won\*(Aqt produce the same result (for instance
-diagnostics warnings) when compiling preprocessed source code\&.
-.fi
-.if n \{\
-.RE
-.\}
+If false, ccache will first run preprocessor to preprocess the source code and then on a cache miss run the compiler on the
+\fIpreprocessed source code\fR
+instead of the original source code\&. This makes cache misses slightly faster since the source code only has to be preprocessed once\&. The downside is that some compilers won\(cqt produce the same result (for instance diagnostics warnings) when compiling preprocessed source code\&.
.RE
.PP
\fBsloppiness\fR (\fBCCACHE_SLOPPINESS\fR)
.SH "CACHE COMPRESSION"
.sp
ccache can optionally compress all files it puts into the cache using the compression library zlib\&. While this may involve a tiny performance slowdown, it increases the number of files that fit in the cache\&. You can turn on compression with the \fBcompression\fR configuration setting and you can also tweak the compression level with \fBcompression_level\fR\&.
+.SH "CACHE STATISTICS"
+.sp
+\fBccache \-s/\-\-show\-stats\fR can show the following statistics:
+.TS
+allbox tab(:);
+ltB ltB.
+T{
+Name
+T}:T{
+Description
+T}
+.T&
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+.sp
+autoconf compile/link
+T}:T{
+.sp
+Uncachable compilation or linking by an autoconf test\&.
+T}
+T{
+.sp
+bad compiler arguments
+T}:T{
+.sp
+Malformed compiler argument, e\&.g\&. missing a value for an option that requires an argument or failure to read a file specified by an option argument\&.
+T}
+T{
+.sp
+cache file missing
+T}:T{
+.sp
+A file was unexpectedly missing from the cache\&. This only happens in rare situations, e\&.g\&. if one ccache instance is about to get a file from the cache while another instance removed the file as part of cache cleanup\&.
+T}
+T{
+.sp
+cache hit (direct)
+T}:T{
+.sp
+A result was successfully found using the direct mode\&.
+T}
+T{
+.sp
+cache hit (preprocessed)
+T}:T{
+.sp
+A result was successfully found using the preprocessor mode\&.
+T}
+T{
+.sp
+cache miss
+T}:T{
+.sp
+No result was found\&.
+T}
+T{
+.sp
+cache size
+T}:T{
+.sp
+Current size of the cache\&.
+T}
+T{
+.sp
+called for link
+T}:T{
+.sp
+The compiler was called for linking, not compiling\&.
+T}
+T{
+.sp
+called for preprocessing
+T}:T{
+.sp
+The compiler was called for preprocessing, not compiling\&.
+T}
+T{
+.sp
+can\(cqt use precompiled header
+T}:T{
+.sp
+Preconditions for using precompiled headers were not fulfilled\&.
+T}
+T{
+.sp
+ccache internal error
+T}:T{
+.sp
+Unexpected failure, e\&.g\&. due to problems reading/writing the cache\&.
+T}
+T{
+.sp
+cleanups performed
+T}:T{
+.sp
+Number of cleanups performed, either implicitly due to the cache size limit being reached or due to explicit \fBccache \-c/\-\-cleanup\fR calls\&.
+T}
+T{
+.sp
+compile failed
+T}:T{
+.sp
+The compilation failed\&. No result stored in the cache\&.
+T}
+T{
+.sp
+compiler check failed
+T}:T{
+.sp
+A compiler check program specified by \fBcompiler_check\fR (\fBCCACHE_COMPILERCHECK\fR) failed\&.
+T}
+T{
+.sp
+compiler produced empty output
+T}:T{
+.sp
+The compiler\(cqs output file (typically an object file) was empty after compilation\&.
+T}
+T{
+.sp
+compiler produced no output
+T}:T{
+.sp
+The compiler\(cqs output file (typically an object file) was missing after compilation\&.
+T}
+T{
+.sp
+compiler produced stdout
+T}:T{
+.sp
+The compiler wrote data to standard output\&. This is something that compilers normally never do, so ccache is not designed to store such output in the cache\&.
+T}
+T{
+.sp
+couldn\(cqt find the compiler
+T}:T{
+.sp
+The compiler to execute could not be found\&.
+T}
+T{
+.sp
+error hashing extra file
+T}:T{
+.sp
+Failure reading a file specified by \fBextra_files_to_hash\fR (\fBCCACHE_EXTRAFILES\fR)\&.
+T}
+T{
+.sp
+files in cache
+T}:T{
+.sp
+Current number of files in the cache\&.
+T}
+T{
+.sp
+multiple source files
+T}:T{
+.sp
+The compiler was called to compile multiple source files in one go\&. This is not supported by ccache\&.
+T}
+T{
+.sp
+no input file
+T}:T{
+.sp
+No input file was specified to the compiler\&.
+T}
+T{
+.sp
+output to a non\-regular file
+T}:T{
+.sp
+The output path specified with \fB\-o\fR is not a file (e\&.g\&. a directory or a device node)\&.
+T}
+T{
+.sp
+output to stdout
+T}:T{
+.sp
+The compiler was instructed to write its output to standard output using \fB\-o \-\fR\&. This is not supported by ccache\&.
+T}
+T{
+.sp
+preprocessor error
+T}:T{
+.sp
+Preprocessing the source code using the compiler\(cqs \fB\-E\fR option failed\&.
+T}
+T{
+.sp
+unsupported code directive
+T}:T{
+.sp
+Code like the assembler \(lq\&.incbin\(rq directive was found\&. This is not supported by ccache\&.
+T}
+T{
+.sp
+unsupported compiler option
+T}:T{
+.sp
+A compiler option not supported by ccache was found\&.
+T}
+T{
+.sp
+unsupported source language
+T}:T{
+.sp
+A source language e\&.g\&. specified with \fB\-x\fR was unsupported by ccache\&.
+T}
+.TE
+.sp 1
.SH "HOW CCACHE WORKS"
.sp
The basic idea is to detect when you are compiling exactly the same code a second time and reuse the previously produced output\&. The detection is done by hashing different kinds of information that should be unique for the compilation and then using the hash sum to identify the cached output\&. ccache uses MD4, a very fast cryptographic hash algorithm, for the hashing\&. (MD4 is nowadays too weak to be useful in cryptographic contexts, but it should be safe enough to be used to identify recompilations\&.) On a cache hit, ccache is able to supply all of the correct compiler outputs (including all warnings, dependency file, etc) from the cache\&.
.sp -1
.IP \(bu 2.3
.\}
-Make sure that the setgid bit is set on all directories in the cache\&. This tells the filesystem to inherit group ownership for new directories\&. The command \(lqfind $CCACHE_DIR \-type d | xargs chmod g+s\(rq might be useful for this\&.
+Make sure that the setgid bit is set on all directories in the cache\&. This tells the filesystem to inherit group ownership for new directories\&. The following command might be useful for this:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+find $CCACHE_DIR \-type d | xargs chmod g+s
+.fi
+.if n \{\
+.RE
+.\}
.RE
.sp
The reason to avoid the hard link mode is that the hard links cause unwanted side effects, as all links to a cached file share the file\(cqs modification timestamp\&. This results in false dependencies to be triggered by timestamp\-based build systems whenever another user links to an existing file\&. Typically, users will see that their libraries and binaries are relinked without reason\&.
// ccache -- a fast C/C++ compiler cache
//
// Copyright (C) 2002-2007 Andrew Tridgell
-// Copyright (C) 2009-2016 Joel Rosdahl
+// Copyright (C) 2009-2017 Joel Rosdahl
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
MYNAME " version %s\n"
"\n"
"Copyright (C) 2002-2007 Andrew Tridgell\n"
- "Copyright (C) 2009-2016 Joel Rosdahl\n"
+ "Copyright (C) 2009-2017 Joel Rosdahl\n"
"\n"
"This program is free software; you can redistribute it and/or modify it under\n"
"the terms of the GNU General Public License as published by the Free Software\n"
}
}
- // Let's hash the include file.
if (!(conf->sloppiness & SLOPPY_INCLUDE_FILE_MTIME)
&& st.st_mtime >= time_of_compilation) {
cc_log("Include file %s too new", path);
goto failure;
}
+ // Let's hash the include file content.
struct mdfour fhash;
hash_start(&fhash);
has_absolute_include_headers = is_absolute_path(inc_path);
}
inc_path = make_relative_path(inc_path);
+
+ bool should_hash_inc_path = true;
+ if (!conf->hash_dir) {
+ char *cwd = gnu_getcwd();
+ if (str_startswith(inc_path, cwd) && str_endswith(inc_path, "//")) {
+ // When compiling with -g or similar, GCC adds the absolute path to
+ // CWD like this:
+ //
+ // # 1 "CWD//"
+ //
+ // If the user has opted out of including the CWD in the hash, don't
+ // hash it. See also how debug_prefix_map is handled.
+ should_hash_inc_path = false;
+ }
+ free(cwd);
+ }
+ if (should_hash_inc_path) {
+ hash_string(hash, inc_path);
+ }
+
remember_include_file(inc_path, hash, system);
- p = q;
+ p = q; // Everything of interest between p and q has been hashed now.
} else if (q[0] == '.' && q[1] == 'i' && q[2] == 'n' && q[3] == 'c'
&& q[4] == 'b' && q[5] == 'i' && q[6] == 'n') {
// An assembler .incbin statement (which could be part of inline
if (tmp_cov) {
tmp_unlink(tmp_cov);
}
- tmp_unlink(tmp_dwo);
+ if (tmp_dwo) {
+ tmp_unlink(tmp_dwo);
+ }
failed();
}
if (st.st_size != 0) {
if (tmp_cov) {
tmp_unlink(tmp_cov);
}
- tmp_unlink(tmp_dwo);
+ if (tmp_dwo) {
+ tmp_unlink(tmp_dwo);
+ }
failed();
}
tmp_unlink(tmp_stdout);
if (tmp_cov) {
tmp_unlink(tmp_cov);
}
- tmp_unlink(tmp_dwo);
+ if (tmp_dwo) {
+ tmp_unlink(tmp_dwo);
+ }
failed();
}
}
}
- // Possibly hash input file location to avoid false positive cache hits since
- // the dependency file includes the source file path.
- if (generating_dependencies) {
- hash_delimiter(hash, "inputfile");
- hash_string(hash, input_file);
- }
-
// Possibly hash the coverage data file path.
if (generating_coverage && profile_arcs) {
char *dir = dirname(output_obj);
if (str_eq(argv[i], "-optf") || str_eq(argv[i], "--options-file")) {
if (i > argc) {
cc_log("Expected argument after -optf/--options-file");
- stats_update(STATS_UNSUPPORTED_OPTION);
+ stats_update(STATS_ARGS);
result = false;
goto out;
}
+
+# The later defininition of _XOPEN_SOURCE disables certain features
+# on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
+
+$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
+# them.
+
+$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
+
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
+# them.
+
+$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h
+
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
+
+$as_echo "#define _BSD_TYPES 1" >>confdefs.h
+
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
+# them.
+
+$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+
+define_xopen_source=yes
+
+ac_sys_system=`uname -s`
+if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
+ -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
+ ac_sys_release=`uname -v`
+else
+ ac_sys_release=`uname -r`
+fi
+
+# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
+# disable features if it is defined, without any means to access these
+# features as extensions. For these systems, we skip the definition of
+# _XOPEN_SOURCE. Before adding a system to the list to gain access to
+# some feature, make sure there is no alternative way to access this
+# feature. Also, when using wildcards, make sure you have verified the
+# need for not defining _XOPEN_SOURCE on all systems matching the
+# wildcard, and that the wildcard does not include future systems
+# (which may remove their limitations).
+case $ac_sys_system/$ac_sys_release in
+ # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
+ # even though select is a POSIX function. Reported by J. Ribbens.
+ # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
+ OpenBSD/2.* | OpenBSD/3.[0123456789] | OpenBSD/4.[0123])
+ define_xopen_source=no
+ # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
+ # also defined. This can be overridden by defining _BSD_SOURCE
+ # As this has a different meaning on Linux, only define it on OpenBSD
+
+$as_echo "#define _BSD_SOURCE 1" >>confdefs.h
+
+ ;;
+ # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
+ # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
+ # Marc Recht
+ NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
+ define_xopen_source=no;;
+ # On Solaris 2.6, sys/wait.h is inconsistent in the usage
+ # of union __?sigval. Reported by Stuart Bishop.
+ SunOS/5.6)
+ define_xopen_source=no;;
+ # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
+ # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
+ # Reconfirmed for 7.1.4 by Martin v. Loewis.
+ OpenUNIX/8.0.0| UnixWare/7.1.[0-4])
+ define_xopen_source=no;;
+ # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
+ # but used in struct sockaddr.sa_family. Reported by Tim Rice.
+ SCO_SV/3.2)
+ define_xopen_source=no;;
+ # On FreeBSD 4, the math functions C89 does not cover are never defined
+ # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
+ FreeBSD/4.*)
+ define_xopen_source=no;;
+ # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
+ # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
+ # identifies itself as Darwin/7.*
+ # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
+ # disables platform specific features beyond repair.
+ # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
+ # has no effect, don't bother defining them
+ Darwin/[6789].*)
+ define_xopen_source=no;;
+ # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
+ # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
+ # or has another value. By not (re)defining it, the defaults come in place.
+ AIX/4)
+ define_xopen_source=no;;
+ AIX/5|AIX/7)
+ if test `uname -r` -eq 1; then
+ define_xopen_source=no
+ fi
+ ;;
+ # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
+ # defining NI_NUMERICHOST.
+ QNX/6.3.2)
+ define_xopen_source=no
+ ;;
+
+esac
+
+if test $define_xopen_source = yes
+then
+ # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
+ # defined precisely as g++ defines it
+ # Furthermore, on Solaris 10, XPG6 requires the use of a C99
+ # compiler
+ case $ac_sys_system/$ac_sys_release in
+ SunOS/5.8|SunOS/5.9|SunOS/5.10)
+
+$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+ ;;
+ *)
+
+$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
+
+ ;;
+ esac
+
+ # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
+ # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
+ # several APIs are not declared. Since this is also needed in some
+ # cases for HP-UX, we define it globally.
+ # except for Solaris 10, where it must not be defined,
+ # as it implies XPG4.2
+ case $ac_sys_system/$ac_sys_release in
+ SunOS/5.10|SunOS/5.11)
+
+$as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ ;;
+ *)
+
+$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
+
+ ;;
+ esac
+
+
+$as_echo "#define _POSIX_C_SOURCE 200112L" >>confdefs.h
+
+
+fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
as_fn_error $? "cannot find ar" "$LINENO" 5
fi
-
-# The later defininition of _XOPEN_SOURCE disables certain features
-# on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
-
-$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
-
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
-# certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
-# them.
-
-$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
-
-
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
-# them.
-
-$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h
-
-
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
-# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
-
-$as_echo "#define _BSD_TYPES 1" >>confdefs.h
-
-
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
-# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
-# them.
-
-$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
-
-
-define_xopen_source=yes
-
-ac_sys_system=`uname -s`
-if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
- -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
- ac_sys_release=`uname -v`
-else
- ac_sys_release=`uname -r`
-fi
-
-# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
-# disable features if it is defined, without any means to access these
-# features as extensions. For these systems, we skip the definition of
-# _XOPEN_SOURCE. Before adding a system to the list to gain access to
-# some feature, make sure there is no alternative way to access this
-# feature. Also, when using wildcards, make sure you have verified the
-# need for not defining _XOPEN_SOURCE on all systems matching the
-# wildcard, and that the wildcard does not include future systems
-# (which may remove their limitations).
-case $ac_sys_system/$ac_sys_release in
- # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
- # even though select is a POSIX function. Reported by J. Ribbens.
- # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
- OpenBSD/2.* | OpenBSD/3.[0123456789] | OpenBSD/4.[0123])
- define_xopen_source=no
- # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
- # also defined. This can be overridden by defining _BSD_SOURCE
- # As this has a different meaning on Linux, only define it on OpenBSD
-
-$as_echo "#define _BSD_SOURCE 1" >>confdefs.h
-
- ;;
- # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
- # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
- # Marc Recht
- NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
- define_xopen_source=no;;
- # On Solaris 2.6, sys/wait.h is inconsistent in the usage
- # of union __?sigval. Reported by Stuart Bishop.
- SunOS/5.6)
- define_xopen_source=no;;
- # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
- # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
- # Reconfirmed for 7.1.4 by Martin v. Loewis.
- OpenUNIX/8.0.0| UnixWare/7.1.[0-4])
- define_xopen_source=no;;
- # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
- # but used in struct sockaddr.sa_family. Reported by Tim Rice.
- SCO_SV/3.2)
- define_xopen_source=no;;
- # On FreeBSD 4, the math functions C89 does not cover are never defined
- # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
- FreeBSD/4.*)
- define_xopen_source=no;;
- # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
- # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
- # identifies itself as Darwin/7.*
- # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
- # disables platform specific features beyond repair.
- # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
- # has no effect, don't bother defining them
- Darwin/[6789].*)
- define_xopen_source=no;;
- # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
- # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
- # or has another value. By not (re)defining it, the defaults come in place.
- AIX/4)
- define_xopen_source=no;;
- AIX/5|AIX/7)
- if test `uname -r` -eq 1; then
- define_xopen_source=no
- fi
- ;;
- # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
- # defining NI_NUMERICHOST.
- QNX/6.3.2)
- define_xopen_source=no
- ;;
-
-esac
-
-if test $define_xopen_source = yes
-then
- # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
- # defined precisely as g++ defines it
- # Furthermore, on Solaris 10, XPG6 requires the use of a C99
- # compiler
- case $ac_sys_system/$ac_sys_release in
- SunOS/5.8|SunOS/5.9|SunOS/5.10)
-
-$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
-
- ;;
- *)
-
-$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
-
- ;;
- esac
-
- # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
- # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
- # several APIs are not declared. Since this is also needed in some
- # cases for HP-UX, we define it globally.
- # except for Solaris 10, where it must not be defined,
- # as it implies XPG4.2
- case $ac_sys_system/$ac_sys_release in
- SunOS/5.10|SunOS/5.11)
-
-$as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
- ;;
- *)
-
-$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
-
- ;;
- esac
-
-
-$as_echo "#define _POSIX_C_SOURCE 200112L" >>confdefs.h
-
-
-fi
-
-
# If GCC, turn on warnings.
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall -W"
AC_SUBST(include_dev_mk)
AC_SUBST(test_suites)
+m4_include(m4/feature_macros.m4)
+
dnl Checks for programs.
AC_PROG_CC_C99
if test "$ac_cv_prog_cc_c99" = no; then
AC_MSG_ERROR(cannot find ar)
fi
-m4_include(m4/feature_macros.m4)
-
# If GCC, turn on warnings.
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall -W"
#define READ_INT(size, var) \
do { \
- (var) = 0; \
+ uint64_t u_ = 0; \
for (size_t i_ = 0; i_ < (size); i_++) { \
int ch_ = gzgetc(f); \
if (ch_ == EOF) { \
goto error; \
} \
- (var) <<= 8; \
- (var) |= ch_ & 0xFF; \
+ u_ <<= 8; \
+ u_ |= ch_ & 0xFF; \
} \
+ (var) = u_; \
} while (false)
#define READ_STR(var) \
#define WRITE_INT(size, var) \
do { \
+ uint64_t u_ = (var); \
uint8_t ch_; \
size_t i_; \
for (i_ = 0; i_ < (size); i_++) { \
- ch_ = ((var) >> (8 * ((size) - i_ - 1))); \
+ ch_ = (u_ >> (8 * ((size) - i_ - 1))); \
if (gzputc(f, ch_) == EOF) { \
goto error; \
} \
while (len >= 4) {
unsigned int k = data[0];
- k |= data[1] << 8;
- k |= data[2] << 16;
- k |= data[3] << 24;
+ k |= ((unsigned int) data[1]) << 8;
+ k |= ((unsigned int) data[2]) << 16;
+ k |= ((unsigned int) data[3]) << 24;
k *= m;
k ^= k >> r;
switch (len)
{
- case 3: h ^= data[2] << 16;
- case 2: h ^= data[1] << 8;
- case 1: h ^= data[0];
+ case 3: h ^= ((unsigned int) data[2]) << 16;
+ case 2: h ^= ((unsigned int) data[1]) << 8;
+ case 1: h ^= ((unsigned int) data[0]);
h *= m;
};
# A simple test suite for ccache.
#
# Copyright (C) 2002-2007 Andrew Tridgell
-# Copyright (C) 2009-2016 Joel Rosdahl
+# Copyright (C) 2009-2017 Joel Rosdahl
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
expect_stat 'cache miss' 0
expect_stat 'unsupported compiler option' 1
- # -------------------------------------------------------------------------
- TEST "-MMD for different source files"
-
- mkdir a b
- touch a/source.c b/source.c
- $CCACHE_COMPILE -MMD -c a/source.c
- expect_file_content source.d "source.o: a/source.c"
-
- $CCACHE_COMPILE -MMD -c b/source.c
- expect_file_content source.d "source.o: b/source.c"
-
- $CCACHE_COMPILE -MMD -c a/source.c
- expect_file_content source.d "source.o: a/source.c"
-
# -------------------------------------------------------------------------
TEST "-Wp,-P"
# -------------------------------------------------------------------------
TEST "CCACHE_NODIRECT"
- $CCACHE_COMPILE -c test.c
+ CCACHE_NODIRECT=1 $CCACHE_COMPILE -c test.c
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
done
expect_stat 'files in cache' 12
+ # -------------------------------------------------------------------------
+ TEST "-MMD for different source files"
+
+ mkdir a b
+ touch a/source.c b/source.c
+ backdate a/source.h b/source.h
+ $CCACHE_COMPILE -MMD -c a/source.c
+ expect_file_content source.d "source.o: a/source.c"
+
+ $CCACHE_COMPILE -MMD -c b/source.c
+ expect_file_content source.d "source.o: b/source.c"
+
+ $CCACHE_COMPILE -MMD -c a/source.c
+ expect_file_content source.d "source.o: a/source.c"
+
+ # -------------------------------------------------------------------------
+ TEST "-MMD for different include file paths"
+
+ mkdir a b
+ touch a/source.h b/source.h
+ backdate a/source.h b/source.h
+ echo '#include <source.h>' >source.c
+ $CCACHE_COMPILE -MMD -Ia -c source.c
+ expect_file_content source.d "source.o: source.c a/source.h"
+
+ $CCACHE_COMPILE -MMD -Ib -c source.c
+ expect_file_content source.d "source.o: source.c b/source.h"
+
+ $CCACHE_COMPILE -MMD -Ia -c source.c
+ expect_file_content source.d "source.o: source.c a/source.h"
+
# -------------------------------------------------------------------------
TEST "-Wp,-MD"
$CCACHE_COMPILE -c `pwd`/file.c
expect_stat 'cache hit (direct)' 1
- expect_stat 'cache hit (preprocessed)' 1
- expect_stat 'cache miss' 1
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 2
# -------------------------------------------------------------------------
TEST "__FILE__ in include file disables direct mode"
$CCACHE_COMPILE -c `pwd`/file2_h.c
expect_stat 'cache hit (direct)' 1
- expect_stat 'cache hit (preprocessed)' 1
- expect_stat 'cache miss' 1
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 2
# -------------------------------------------------------------------------
TEST "__FILE__ in source file ignored if sloppy"
CPATH=subdir2 $CCACHE_COMPILE -c foo.c
expect_stat 'cache hit (direct)' 1
- expect_stat 'cache hit (preprocessed)' 1
- expect_stat 'cache miss' 1
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 2 # subdir2 is part of the preprocessor output
CPATH=subdir2 $CCACHE_COMPILE -c foo.c
expect_stat 'cache hit (direct)' 2
- expect_stat 'cache hit (preprocessed)' 1
- expect_stat 'cache miss' 1
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 2
# -------------------------------------------------------------------------
TEST "Comment in strings"
# CCACHE_BASEDIR="" is the default:
$CCACHE_COMPILE -I`pwd`/include -c src/test.c
expect_stat 'cache hit (direct)' 0
- expect_stat 'cache hit (preprocessed)' 1
- expect_stat 'cache miss' 1
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 2
# -------------------------------------------------------------------------
TEST "Path normalization"
-const char CCACHE_VERSION[] = "3.3.3";
+const char CCACHE_VERSION[] = "3.3.4";