Imported Upstream version 3.3.6 upstream/3.3.6
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:18:22 +0000 (16:18 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:18:22 +0000 (16:18 +0900)
12 files changed:
AUTHORS.html
AUTHORS.txt
LICENSE.html
MANUAL.html
MANUAL.txt
NEWS.html
NEWS.txt
ccache.1
ccache.c
mdfour.c
test.sh
version.c

index 8894164517b8ab094e4dc7630fc6076302d14787..b0d38b3e0e5082ae92b626719d0df325b9213e82 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.3.5</span>\r
+<span id="revnumber">version 3.3.6</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>
@@ -924,7 +924,7 @@ Leanid Chaika &lt;<a href="mailto:leanid.chaika@gmail.com">leanid.chaika@gmail.c
 </li>\r
 <li>\r
 <p>\r
-Luboš Luňák &lt;<a href="mailto:l.lunak@suse.cz">l.lunak@suse.cz</a>&gt;\r
+Luboš Luňák &lt;<a href="mailto:l.lunak@centrum.cz">l.lunak@centrum.cz</a>&gt;\r
 </p>\r
 </li>\r
 <li>\r
@@ -1105,9 +1105,9 @@ Yiding Jia &lt;<a href="mailto:yiding@fb.com">yiding@fb.com</a>&gt;
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.3.5<br />\r
+Version 3.3.6<br />\r
 Last updated\r
- 2018-01-13 19:31:06 CET\r
+ 2018-01-28 16:21:55 CET\r
 </div>\r
 </div>\r
 </body>\r
index 0dc06706ebcb88222de3b07369ca6a605ec520b2..dc2cec4e6be52d3923aedff0eb5d716878689aa1 100644 (file)
@@ -41,7 +41,7 @@ ccache is a collective work with contributions from many people, including:
 * Lalit Chhabra <lchhabra@linuxmail.org>
 * Lars Gustäbel <lars@gustaebel.de>
 * Leanid Chaika <leanid.chaika@gmail.com>
-* Luboš Luňák <l.lunak@suse.cz>
+* Luboš Luňák <l.lunak@centrum.cz>
 * Mark Starovoytov <starovoytov.mark@googlemail.com>
 * Martin Pool <mbp@sourcefrog.net>
 * Matthias Kretz <kretz@kde.org>
index 3f7ee3131901f48498f8266e6fdb192975f9fb67..0673b9c522deafbbf517895ceed843fc74db7ebf 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.3.5</span>\r
+<span id="revnumber">version 3.3.5+dirty</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>
@@ -1205,9 +1205,9 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.3.5<br />\r
+Version 3.3.5+dirty<br />\r
 Last updated\r
- 2018-01-13 19:31:27 CET\r
+ 2018-01-13 19:38:26 CET\r
 </div>\r
 </div>\r
 </body>\r
index 3bf053d1bf9c6ccdabc88f38b39fc437f1de8b39..5b0c1056f8e02bf2daa7ac076c17ff0bf245d1a8 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.3.5</span>\r
+<span id="revnumber">version 3.3.6</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>
@@ -1087,12 +1087,12 @@ setting key.</p></div>
     rewrites absolute paths into relative paths before computing the hash that\r
     identifies the compilation, but only for paths under the specified\r
     directory. If set to the empty string (which is the default), no rewriting\r
-    is done. See also the discussion under\r
-    <a href="#_compiling_in_different_directories">COMPILING IN DIFFERENT DIRECTORIES</a>.\r
-    If using GCC or newer versions of Clang, you might want to look into the\r
-    <strong>-fdebug-prefix-map=old=new</strong> option for relocating debug info to a common\r
-    prefix (mapping prefix with old=new).\r
+    is done. A typical path to use as the base directory is your home directory\r
+    or another directory that is a parent of your build directories. Don&#8217;t use\r
+    <code>/</code> as the base directory since that will make ccache also rewrite paths to\r
+    system header files, which doesn&#8217;t gain anything.\r
 </p>\r
+<div class="paragraph"><p>See also the discussion under <a href="#_compiling_in_different_directories">COMPILING IN DIFFERENT DIRECTORIES</a>.</p></div>\r
 </dd>\r
 <dt class="hdlist1">\r
 <strong>cache_dir</strong> (<strong>CCACHE_DIR</strong>)\r
@@ -1302,6 +1302,8 @@ the <strong>prefix_command</strong> setting if possible. See
     when generating debug info (compiler option <strong>-g</strong> with variations).\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
+    See also the discussion under\r
+    <a href="#_compiling_in_different_directories">COMPILING IN DIFFERENT DIRECTORIES</a>.\r
 </p>\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
@@ -1991,7 +1993,7 @@ the cache.</p></div>
 <div class="sect1">\r
 <h2 id="_compiling_in_different_directories">Compiling in different directories</h2>\r
 <div class="sectionbody">\r
-<div class="paragraph"><p>Some information included in the hash that identifies a unique compilation may\r
+<div class="paragraph"><p>Some information included in the hash that identifies a unique compilation can\r
 contain absolute paths:</p></div>\r
 <div class="ulist"><ul>\r
 <li>\r
@@ -2003,8 +2005,8 @@ The preprocessed source code may contain absolute paths to include files if
 </li>\r
 <li>\r
 <p>\r
-Paths specified by compiler options (such as <strong>-I</strong>, <strong>-MF</strong>, etc) may be\r
-  absolute.\r
+Paths specified by compiler options (such as <strong>-I</strong>, <strong>-MF</strong>, etc) on the command\r
+  line may be absolute.\r
 </p>\r
 </li>\r
 <li>\r
@@ -2018,29 +2020,39 @@ The source code file path may be absolute, and that path may substituted for
 <div class="paragraph"><p>This means that if you compile the same code in different locations, you can&#8217;t\r
 share compilation results between the different build directories since you get\r
 cache misses because of the absolute build directory paths that are part of the\r
-hash. To mitigate this problem, you can specify a &#8220;base directory&#8221; in the\r
-configuration setting <strong>base_dir</strong> to an absolute path to the directory. ccache\r
-will then rewrite absolute paths that are under the base directory (i.e., paths\r
-that have the base directory as a prefix) to relative paths when constructing\r
-the hash. A typical path to use as the base directory is your home directory or\r
-another directory that is a parent of your build directories. (Don&#8217;t use <code>/</code> as\r
-the base directory since that will make ccache also rewrite paths to system\r
-header files, which doesn&#8217;t gain anything.)</p></div>\r
-<div class="paragraph"><p>The drawbacks of using a base directory are:</p></div>\r
+hash.</p></div>\r
+<div class="paragraph"><p>Here&#8217;s what can be done to enable cache hits between different build\r
+directories:</p></div>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+If you build with <strong>-g</strong> (or similar) to add debug information to the object\r
+  file, you must either:\r
+</p>\r
+<div class="openblock">\r
+<div class="content">\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
-If you specify an absolute path to the source code file, <strong>__FILE__</strong> macros\r
-  will be expanded to a relative path instead.\r
+use the <strong>-fdebug-prefix-map=<em>old</em>=<em>new</em></strong> option for relocating debug info to\r
+   a common prefix (e.g. <strong>-fdebug-prefix-map=$PWD=.</strong>); or\r
 </p>\r
 </li>\r
 <li>\r
 <p>\r
-If you specify an absolute path to the source code file and compile with\r
-  <strong>-g</strong>, the source code path stored in the object file may point to the wrong\r
-  directory, which may prevent debuggers like GDB from finding the source code.\r
-  Sometimes, a work-around is to change the directory explicitly with the\r
-  &#8220;cd&#8221; command in GDB.\r
+set <strong>hash_dir = false</strong>.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div></div>\r
+</li>\r
+<li>\r
+<p>\r
+If you use absolute paths anywhere on the command line (e.g. the source code\r
+  file path or an argument to compiler options like <strong>-I</strong> and <strong>-MF</strong>), you must\r
+  to set <strong>base_dir</strong> to an absolute path to a &#8220;base directory&#8221;. ccache will\r
+  then rewrite absolute paths under that directory to relative before computing\r
+  the hash.\r
 </p>\r
 </li>\r
 </ul></div>\r
@@ -2419,9 +2431,9 @@ maintained by Joel Rosdahl. See AUTHORS.txt or AUTHORS.html and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.3.5<br />\r
+Version 3.3.6<br />\r
 Last updated\r
- 2018-01-13 17:47:38 CET\r
+ 2018-01-28 16:20:40 CET\r
 </div>\r
 </div>\r
 </body>\r
index 1d4127d02d43f2cd558b6e970cd87908628ad480..c6ebca32f29ad07c9b5fbfc029bdf58092f0927c 100644 (file)
@@ -242,11 +242,13 @@ setting key.
     rewrites absolute paths into relative paths before computing the hash that
     identifies the compilation, but only for paths under the specified
     directory. If set to the empty string (which is the default), no rewriting
-    is done. See also the discussion under
-    <<_compiling_in_different_directories,COMPILING IN DIFFERENT DIRECTORIES>>.
-    If using GCC or newer versions of Clang, you might want to look into the
-    *-fdebug-prefix-map=old=new* option for relocating debug info to a common
-    prefix (mapping prefix with old=new).
+    is done. A typical path to use as the base directory is your home directory
+    or another directory that is a parent of your build directories. Don't use
+    +/+ as the base directory since that will make ccache also rewrite paths to
+    system header files, which doesn't gain anything.
++
+See also the discussion under <<_compiling_in_different_directories,COMPILING
+IN DIFFERENT DIRECTORIES>>.
 
 *cache_dir* (*CCACHE_DIR*)::
 
@@ -381,6 +383,8 @@ WRAPPERS>>.
     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.
+    See also the discussion under
+    <<_compiling_in_different_directories,COMPILING IN DIFFERENT DIRECTORIES>>.
 +
 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
@@ -822,14 +826,14 @@ the cache.
 Compiling in different directories
 ----------------------------------
 
-Some information included in the hash that identifies a unique compilation may
+Some information included in the hash that identifies a unique compilation can
 contain absolute paths:
 
 * The preprocessed source code may contain absolute paths to include files if
   the compiler option *-g* is used or if absolute paths are given to *-I* and
   similar compiler options.
-* Paths specified by compiler options (such as *-I*, *-MF*, etc) may be
-  absolute.
+* Paths specified by compiler options (such as *-I*, *-MF*, etc) on the command
+  line may be absolute.
 * The source code file path may be absolute, and that path may substituted for
   *\_\_FILE__* macros in the source code or included in warnings emitted to
   standard error by the preprocessor.
@@ -837,24 +841,24 @@ contain absolute paths:
 This means that if you compile the same code in different locations, you can't
 share compilation results between the different build directories since you get
 cache misses because of the absolute build directory paths that are part of the
-hash. To mitigate this problem, you can specify a ``base directory'' in the
-configuration setting *base_dir* to an absolute path to the directory. ccache
-will then rewrite absolute paths that are under the base directory (i.e., paths
-that have the base directory as a prefix) to relative paths when constructing
-the hash. A typical path to use as the base directory is your home directory or
-another directory that is a parent of your build directories. (Don't use +/+ as
-the base directory since that will make ccache also rewrite paths to system
-header files, which doesn't gain anything.)
-
-The drawbacks of using a base directory are:
-
-* If you specify an absolute path to the source code file, *\_\_FILE__* macros
-  will be expanded to a relative path instead.
-* If you specify an absolute path to the source code file and compile with
-  *-g*, the source code path stored in the object file may point to the wrong
-  directory, which may prevent debuggers like GDB from finding the source code.
-  Sometimes, a work-around is to change the directory explicitly with the
-  ``cd'' command in GDB.
+hash.
+
+Here's what can be done to enable cache hits between different build
+directories:
+
+* If you build with *-g* (or similar) to add debug information to the object
+  file, you must either:
++
+--
+** use the *-fdebug-prefix-map=_old_=_new_* option for relocating debug info to
+   a common prefix (e.g. *-fdebug-prefix-map=$PWD=.*); or
+** set *hash_dir = false*.
+--
+* If you use absolute paths anywhere on the command line (e.g. the source code
+  file path or an argument to compiler options like *-I* and *-MF*), you must
+  to set *base_dir* to an absolute path to a ``base directory''. ccache will
+  then rewrite absolute paths under that directory to relative before computing
+  the hash.
 
 
 Precompiled headers
index 24de53dbdcdfb13556a066106b070c591dd7bed2..396f60d10e3a2fb4aefe18c6283620a472a947cb 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.3.5</span>\r
+<span id="revnumber">version 3.3.6</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>
@@ -742,11 +742,38 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_3_6">ccache 3.3.6</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2018-01-28</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
+Improved instructions on how to get cache hits between different working\r
+  directories.\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 regression in ccache 3.3.5 related to the <code>UNCACHED_ERR_FD</code> feature.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_3_5">ccache 3.3.5</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2018-01-13</p></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
@@ -756,7 +783,7 @@ Documented how automatic cache cleanup works.
 </ul></div>\r
 </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
@@ -829,7 +856,7 @@ Fixed a bug where ccache would skip hashing the compiler argument following a
 <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_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
@@ -839,7 +866,7 @@ Documented the different cache statistics counters.
 </ul></div>\r
 </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
@@ -869,7 +896,7 @@ Fixed undefined behavior warnings in ccache found by <code>-fsanitize=undefined<
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-10-26</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
@@ -886,7 +913,7 @@ ccache now detects usage of <code>.incbin</code> assembler directives in the sou
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-09-28</p></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
@@ -911,7 +938,7 @@ Fixed a regression in ccache 3.3.1: ccache could get confused when using the
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-09-07</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
@@ -946,7 +973,7 @@ A C99-compatible compiler is now required to build ccache.
 </ul></div>\r
 </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
@@ -1093,7 +1120,7 @@ Increased buffer size used when reading file data. This improves performance
 </ul></div>\r
 </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
@@ -1119,7 +1146,7 @@ Fixed build and test for MinGW32 and Windows.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-09-28</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
@@ -1137,7 +1164,7 @@ Fixed a regression in ccache 3.2.8: ccache could get confused when using the
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-09-07</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
@@ -1161,7 +1188,7 @@ ccache now understands the undocumented <code>-coverage</code> (only one dash) G
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-07-20</p></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
@@ -1184,7 +1211,7 @@ ccache now knows how to work around a glitch in the output of GCC 6&#8217;s
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-07-12</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
@@ -1213,7 +1240,7 @@ Fixed a bug where (due to ccache rewriting paths) the compiler could choose
 <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_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
@@ -1234,7 +1261,7 @@ Made it harder to misinterpret documentation of boolean environment settings'
 </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
@@ -1294,7 +1321,7 @@ The man page is now built when running &#8220;make install&#8221; from Git repos
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-10-08</p></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
@@ -1339,7 +1366,7 @@ Fixed a bug where cache cleanup could be run too early for caches larger than
 <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_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
@@ -1349,7 +1376,7 @@ Added support for compiler option <code>-gsplit-dwarf</code>.
 </ul></div>\r
 </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
@@ -1386,7 +1413,7 @@ Only log "Disabling direct mode" once when failing to read potential include
 <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_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
@@ -1403,7 +1430,7 @@ Add support for caching code coverage results (compiling for gcov).
 </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
@@ -1474,7 +1501,7 @@ Fixed build error when compiling ccache with recent clang versions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2014-12-10</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
@@ -1515,7 +1542,7 @@ Added missing documentation for <code>max_files</code> and <code>max_size</code>
 <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_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
@@ -1706,7 +1733,7 @@ Various other improvements of the test suite.
 </ul></div>\r
 </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
@@ -1737,7 +1764,7 @@ Fixed test suite failures when <code>CC</code> is a ccache-wrapped compiler.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2016-07-12</p></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
@@ -1755,7 +1782,7 @@ Fixed a bug where (due to ccache rewriting paths) the compiler could choose
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-03-07</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
@@ -1786,7 +1813,7 @@ Don&#8217;t try to reset a non-existing stats file. This avoids &#8220;No such f
 <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_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
@@ -1838,7 +1865,7 @@ Stale files in the internal temporary directory (<code>&lt;ccache_dir&gt;/tmp</c
 </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
@@ -1878,7 +1905,7 @@ Fixed problem with logging of current working directory.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2013-01-06</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
@@ -1928,7 +1955,7 @@ Fixed test suite to work on ecryptfs.
 <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_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
@@ -1949,7 +1976,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </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
@@ -1997,7 +2024,7 @@ Fixed <code>static_assert</code> macro definition clash with GCC 4.7.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-01-08</p></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
@@ -2070,7 +2097,7 @@ Improved documentation on how to fix bad object files in the cache.
 <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_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
@@ -2080,7 +2107,7 @@ Rewrite argument to <code>--sysroot</code> if <code>CCACHE_BASEDIR</code> is use
 </ul></div>\r
 </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
@@ -2101,7 +2128,7 @@ Fixed alignment of &#8220;called for preprocessing&#8221; counter.
 <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_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
@@ -2133,7 +2160,7 @@ Improved order of statistics counters in <code>ccache -s</code> output.
 </ul></div>\r
 </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
@@ -2166,7 +2193,7 @@ Systems that lack (and don&#8217;t need to be linked with) libm are now supporte
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-01-09</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
@@ -2199,7 +2226,7 @@ The file handle in now correctly closed on write error when trying to create
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-28</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
@@ -2226,7 +2253,7 @@ Portability fixes for HP-UX 11.00 and other esoteric systems.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-21</p></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
@@ -2274,7 +2301,7 @@ The test suite now also works on systems that lack a /dev/zero.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-07</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
@@ -2328,7 +2355,7 @@ Minor debug log message improvements.
 <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_12">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_13">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2396,7 +2423,7 @@ Added <code>-install_name</code> as an option known to take an argument. (This i
 </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
@@ -2482,7 +2509,7 @@ New <code>HACKING.txt</code> file with some notes about ccache code conventions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_30">Bug fixes</h3>\r
+<h3 id="_bug_fixes_31">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2528,7 +2555,7 @@ The way the hashes are calculated has changed, so you won&#8217;t get cache hits
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_13">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_14">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2671,7 +2698,7 @@ The following options are no longer hashed in the preprocessor mode:
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_31">Bug fixes</h3>\r
+<h3 id="_bug_fixes_32">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2816,9 +2843,9 @@ Statistics counters are now correctly updated for -E option failures and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.3.5<br />\r
+Version 3.3.6<br />\r
 Last updated\r
- 2018-01-13 17:52:20 CET\r
+ 2018-01-28 16:21:15 CET\r
 </div>\r
 </div>\r
 </body>\r
index 96bdd04e5d2a66de96ba12a019e8c7bb085351af..7c6f042bb58463b1057950cc8d3ed24893260008 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,23 @@
 ccache news
 ===========
 
+ccache 3.3.6
+------------
+Release date: 2018-01-28
+
+New features and improvements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Improved instructions on how to get cache hits between different working
+  directories.
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed regression in ccache 3.3.5 related to the `UNCACHED_ERR_FD` feature.
+
+
 ccache 3.3.5
 ------------
 Release date: 2018-01-13
index 433cf395f34921a99d0de7080cc212bfcc2b664a..03398d6e1aadef04a6e7f67b29b66fec4b648569 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 01/13/2018
+.\"      Date: 01/28/2018
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.3.5
+.\"    Source: ccache 3.3.6
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "01/13/2018" "ccache 3\&.3\&.5" "ccache Manual"
+.TH "CCACHE" "1" "01/28/2018" "ccache 3\&.3\&.6" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -371,10 +371,12 @@ Below is a list of available configuration settings\&. The corresponding environ
 .PP
 \fBbase_dir\fR (\fBCCACHE_BASEDIR\fR)
 .RS 4
-This setting should be an absolute path to a directory\&. ccache then rewrites absolute paths into relative paths before computing the hash that identifies the compilation, but only for paths under the specified directory\&. If set to the empty string (which is the default), no rewriting is done\&. See also the discussion under
-COMPILING IN DIFFERENT DIRECTORIES\&. If using GCC or newer versions of Clang, you might want to look into the
-\fB\-fdebug\-prefix\-map=old=new\fR
-option for relocating debug info to a common prefix (mapping prefix with old=new)\&.
+This setting should be an absolute path to a directory\&. ccache then rewrites absolute paths into relative paths before computing the hash that identifies the compilation, but only for paths under the specified directory\&. If set to the empty string (which is the default), no rewriting is done\&. A typical path to use as the base directory is your home directory or another directory that is a parent of your build directories\&. Don\(cqt use
+/
+as the base directory since that will make ccache also rewrite paths to system header files, which doesn\(cqt gain anything\&.
+.sp
+See also the discussion under
+COMPILING IN DIFFERENT DIRECTORIES\&.
 .RE
 .PP
 \fBcache_dir\fR (\fBCCACHE_DIR\fR)
@@ -511,7 +513,8 @@ with variations)\&. Exception: The CWD will not be included in the hash if
 \fBbase_dir\fR
 is set (and matches the CWD) and the compiler option
 \fB\-fdebug\-prefix\-map\fR
-is used\&.
+is used\&. See also the discussion under
+COMPILING IN DIFFERENT DIRECTORIES\&.
 .sp
 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
@@ -1294,7 +1297,7 @@ any standard error output generated by the preprocessor
 Based on the hash, the cached compilation result can be looked up directly in the cache\&.
 .SH "COMPILING IN DIFFERENT DIRECTORIES"
 .sp
-Some information included in the hash that identifies a unique compilation may contain absolute paths:
+Some information included in the hash that identifies a unique compilation can contain absolute paths:
 .sp
 .RS 4
 .ie n \{\
@@ -1321,7 +1324,7 @@ and similar compiler options\&.
 .\}
 Paths specified by compiler options (such as
 \fB\-I\fR,
-\fB\-MF\fR, etc) may be absolute\&.
+\fB\-MF\fR, etc) on the command line may be absolute\&.
 .RE
 .sp
 .RS 4
@@ -1337,9 +1340,9 @@ The source code file path may be absolute, and that path may substituted for
 macros in the source code or included in warnings emitted to standard error by the preprocessor\&.
 .RE
 .sp
-This means that if you compile the same code in different locations, you can\(cqt share compilation results between the different build directories since you get cache misses because of the absolute build directory paths that are part of the hash\&. To mitigate this problem, you can specify a \(lqbase directory\(rq in the configuration setting \fBbase_dir\fR to an absolute path to the directory\&. ccache will then rewrite absolute paths that are under the base directory (i\&.e\&., paths that have the base directory as a prefix) to relative paths when constructing the hash\&. A typical path to use as the base directory is your home directory or another directory that is a parent of your build directories\&. (Don\(cqt use / as the base directory since that will make ccache also rewrite paths to system header files, which doesn\(cqt gain anything\&.)
+This means that if you compile the same code in different locations, you can\(cqt share compilation results between the different build directories since you get cache misses because of the absolute build directory paths that are part of the hash\&.
 .sp
-The drawbacks of using a base directory are:
+Here\(cqs what can be done to enable cache hits between different build directories:
 .sp
 .RS 4
 .ie n \{\
@@ -1349,9 +1352,22 @@ The drawbacks of using a base directory are:
 .sp -1
 .IP \(bu 2.3
 .\}
-If you specify an absolute path to the source code file,
-\fB__FILE__\fR
-macros will be expanded to a relative path instead\&.
+If you build with
+\fB\-g\fR
+(or similar) to add debug information to the object file, you must either:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+use the
+\fB\-fdebug\-prefix\-map=\fR\fB\fIold\fR\fR\fB=\fR\fB\fInew\fR\fR
+option for relocating debug info to a common prefix (e\&.g\&.
+\fB\-fdebug\-prefix\-map=$PWD=\&.\fR); or
 .RE
 .sp
 .RS 4
@@ -1362,8 +1378,25 @@ macros will be expanded to a relative path instead\&.
 .sp -1
 .IP \(bu 2.3
 .\}
-If you specify an absolute path to the source code file and compile with
-\fB\-g\fR, the source code path stored in the object file may point to the wrong directory, which may prevent debuggers like GDB from finding the source code\&. Sometimes, a work\-around is to change the directory explicitly with the \(lqcd\(rq command in GDB\&.
+set
+\fBhash_dir = false\fR\&.
+.RE
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+If you use absolute paths anywhere on the command line (e\&.g\&. the source code file path or an argument to compiler options like
+\fB\-I\fR
+and
+\fB\-MF\fR), you must to set
+\fBbase_dir\fR
+to an absolute path to a \(lqbase directory\(rq\&. ccache will then rewrite absolute paths under that directory to relative before computing the hash\&.
 .RE
 .SH "PRECOMPILED HEADERS"
 .sp
index f72a9bda2fa35e9793b1a608208be1bdb50ba9af..d863a5a9d3c8d29d11fc63272bd759aacc7de542 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -844,11 +844,11 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                        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
-                       // assembly) refers to an external file. If the file changes, the hash
-                       // should change as well, but finding out what file to hash is too hard
-                       // for ccache, so just bail out.
-                       cc_log("Found unsupported .incbin directive in source code");
+                       // An assembler .inc bin (without the space) statement, which could be
+                       // part of inline assembly, refers to an external file. If the file
+                       // changes, the hash should change as well, but finding out what file to
+                       // hash is too hard for ccache, so just bail out.
+                       cc_log("Found unsupported .inc" "bin directive in source code");
                        stats_update(STATS_UNSUPPORTED_DIRECTIVE);
                        failed();
                } else {
@@ -3138,11 +3138,11 @@ static void
 setup_uncached_err(void)
 {
        int uncached_fd = dup(2);
-       set_cloexec_flag(uncached_fd);
        if (uncached_fd == -1) {
                cc_log("dup(2) failed: %s", strerror(errno));
                failed();
        }
+       // Leak the file descriptor.
 
        // Leak a pointer to the environment.
        char *buf = format("UNCACHED_ERR_FD=%d", uncached_fd);
index 36b55fe84dcddb7d4df5514a0793f701b0ba6dde..f557a20fb8322124b1e0d06ecfa1579bc96af671 100644 (file)
--- a/mdfour.c
+++ b/mdfour.c
@@ -1,5 +1,5 @@
 // Copyright (C) 1997-1998 Andrew Tridgell
-// Copyright (C) 2009-2016 Joel Rosdahl
+// Copyright (C) 2009-2018 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
@@ -162,7 +162,7 @@ void
 mdfour_update(struct mdfour *md, const unsigned char *in, size_t n)
 {
 #ifdef CCACHE_DEBUG_HASH
-       if (getenv("CCACHE_DEBUG_HASH")) {
+       if (n > 0 && getenv("CCACHE_DEBUG_HASH")) {
                FILE *f = fopen("ccache-debug-hash.bin", "a");
                fwrite(in, 1, n, f);
                fclose(f);
diff --git a/test.sh b/test.sh
index b2d6bf9f007ae29c3ea5121904a861b100894e86..d750afebd3475741ff638ff529b95ccccbe379c8 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1076,6 +1076,38 @@ EOF
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 0
     expect_stat 'unsupported code directive' 1
+
+    # -------------------------------------------------------------------------
+    TEST "UNCACHED_ERR_FD"
+
+    cat >compiler.sh <<'EOF'
+#!/bin/sh
+if [ "$1" = "-E" ]; then
+    echo preprocessed
+    printf ${N}Pu >&$UNCACHED_ERR_FD
+else
+    echo compiled >test1.o
+    printf ${N}Cc >&2
+    printf ${N}Cu >&$UNCACHED_ERR_FD
+fi
+EOF
+    chmod +x compiler.sh
+
+    N=1 $CCACHE ./compiler.sh -c test1.c 2>stderr.txt
+    stderr=$(cat stderr.txt)
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    if [ "$stderr" != "1Pu1Cu1Cc" ]; then
+        test_failed "Unexpected stderr: $stderr != 1Pu1Cu1Cc"
+    fi
+
+    N=2 $CCACHE ./compiler.sh -c test1.c 2>stderr.txt
+    stderr=$(cat stderr.txt)
+    expect_stat 'cache hit (preprocessed)' 1
+    expect_stat 'cache miss' 1
+    if [ "$stderr" != "2Pu1Cc" ]; then
+        test_failed "Unexpected stderr: $stderr != 2Pu1Cc"
+    fi
 }
 
 # =============================================================================
index 21b8c7605d773d2d495ec11b950f41336315681f..6bce7fa9872ec9d5b802c322afb2ef2d1c6f2573 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.3.5";
+const char CCACHE_VERSION[] = "3.3.6";