Imported Upstream version 3.2.7 upstream/3.2.7
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:17:23 +0000 (16:17 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:17:23 +0000 (16:17 +0900)
INSTALL.html
LICENSE.html
MANUAL.html
NEWS.html
NEWS.txt
README.html
ccache.1
ccache.c
compopt.c
test.sh
version.c

index e6c0459..721acf6 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache installation</h1>\r
-<span id="revnumber">version 3.2.6</span>\r
+<span id="revnumber">version 3.2.7</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>
@@ -848,9 +848,9 @@ above.</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2.6<br />\r
+Version 3.2.7<br />\r
 Last updated\r
- 2016-07-12 21:36:01 CEST\r
+ 2016-07-20 18:01:48 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 19b4375..856a7ae 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.2.6</span>\r
+<span id="revnumber">version 3.2.7</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.2.6<br />\r
+Version 3.2.7<br />\r
 Last updated\r
- 2016-07-12 21:36:01 CEST\r
+ 2016-07-20 18:01:48 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 725e73b..89c8720 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.2.6</span>\r
+<span id="revnumber">version 3.2.7</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>
@@ -2167,9 +2167,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.2.6<br />\r
+Version 3.2.7<br />\r
 Last updated\r
- 2016-07-12 21:36:01 CEST\r
+ 2016-07-20 18:01:48 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 42f28a0..872c6ce 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.2.6</span>\r
+<span id="revnumber">version 3.2.7</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,27 +742,44 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
-<h2 id="_ccache_3_2_6">ccache 3.2.6</h2>\r
+<h2 id="_ccache_3_2_7">ccache 3.2.7</h2>\r
 <div class="sectionbody">\r
-<div class="paragraph"><p>Release date: 2016-07-12</p></div>\r
+<div class="paragraph"><p>Release date: 2016-07-20</p></div>\r
 <div class="sect2">\r
 <h3 id="_bug_fixes">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
-Fixed build problem on QNX, which lacks &#8220;SA_RESTART&#8221;.\r
+Fixed a bug which could lead to false cache hits for compiler command lines\r
+  with a missing argument to an option that takes an argument.\r
 </p>\r
 </li>\r
 <li>\r
 <p>\r
-Bail out on compiler option <code>-fstack-usage</code> since it creates a <code>.su</code> file\r
-  which ccache currently doesn&#8217;t handle.\r
+ccache now knows how to work around a glitch in the output of GCC 6&#8217;s\r
+  preprocessor.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_ccache_3_2_6">ccache 3.2.6</h2>\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_2">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed build problem on QNX, which lacks &#8220;SA_RESTART&#8221;.\r
 </p>\r
 </li>\r
 <li>\r
 <p>\r
-ccache now knows how to work around a glitch in the output of GCC 6&#8217;s\r
-  preprocessor.\r
+Bail out on compiler option <code>-fstack-usage</code> since it creates a <code>.su</code> file\r
+  which ccache currently doesn&#8217;t handle.\r
 </p>\r
 </li>\r
 <li>\r
@@ -802,7 +819,7 @@ Made it harder to misinterpret documentation of boolean environment settings'
 </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
@@ -862,7 +879,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_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -917,7 +934,7 @@ Added support for compiler option <code>-gsplit-dwarf</code>.
 </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
@@ -971,7 +988,7 @@ Add support for caching code coverage results (compiling for gcov).
 </ul></div>\r
 </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
@@ -1042,7 +1059,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_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1274,7 +1291,7 @@ Various other improvements of the test suite.
 </ul></div>\r
 </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
@@ -1305,7 +1322,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_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1323,7 +1340,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_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1406,7 +1423,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_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1446,7 +1463,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_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1517,7 +1534,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </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
@@ -1565,7 +1582,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_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1648,7 +1665,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_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1701,7 +1718,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_15">Bug fixes</h3>\r
+<h3 id="_bug_fixes_16">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1734,7 +1751,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_16">Bug fixes</h3>\r
+<h3 id="_bug_fixes_17">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1767,7 +1784,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_17">Bug fixes</h3>\r
+<h3 id="_bug_fixes_18">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1794,7 +1811,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_18">Bug fixes</h3>\r
+<h3 id="_bug_fixes_19">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1842,7 +1859,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_19">Bug fixes</h3>\r
+<h3 id="_bug_fixes_20">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1964,7 +1981,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_20">Bug fixes</h3>\r
+<h3 id="_bug_fixes_21">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2050,7 +2067,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_21">Bug fixes</h3>\r
+<h3 id="_bug_fixes_22">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2239,7 +2256,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_22">Bug fixes</h3>\r
+<h3 id="_bug_fixes_23">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2384,9 +2401,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.2.6<br />\r
+Version 3.2.7<br />\r
 Last updated\r
- 2016-07-12 21:36:01 CEST\r
+ 2016-07-20 18:01:48 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 4b2d144..b56707e 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -2,6 +2,20 @@ ccache news
 ===========
 
 
+ccache 3.2.7
+------------
+Release date: 2016-07-20
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed a bug which could lead to false cache hits for compiler command lines
+  with a missing argument to an option that takes an argument.
+
+- ccache now knows how to work around a glitch in the output of GCC 6's
+  preprocessor.
+
+
 ccache 3.2.6
 ------------
 Release date: 2016-07-12
@@ -14,9 +28,6 @@ Bug fixes
 - Bail out on compiler option `-fstack-usage` since it creates a `.su` file
   which ccache currently doesn't handle.
 
-- ccache now knows how to work around a glitch in the output of GCC 6's
-  preprocessor.
-
 - Fixed a bug where (due to ccache rewriting paths) the compiler could choose
   incorrect include files if `CCACHE_BASEDIR` is used and the source file path
   is absolute and is a symlink.
index de56289..fb29d26 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache README</h1>\r
-<span id="revnumber">version 3.2.6</span>\r
+<span id="revnumber">version 3.2.7</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>
@@ -830,9 +830,9 @@ Thiele&#8217;s &#8220;compilercache&#8221; (see <a href="http://www.erikyyy.de/c
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2.6<br />\r
+Version 3.2.7<br />\r
 Last updated\r
- 2016-07-12 21:36:01 CEST\r
+ 2016-07-20 18:01:48 CEST\r
 </div>\r
 </div>\r
 </body>\r
index ea5cb34..30f4a79 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 07/12/2016
+.\"      Date: 07/20/2016
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.2.6
+.\"    Source: ccache 3.2.7
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "07/12/2016" "ccache 3\&.2\&.6" "ccache Manual"
+.TH "CCACHE" "1" "07/20/2016" "ccache 3\&.2\&.7" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index 014c5a0..49b2092 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -755,9 +755,11 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                                if (str_startswith(q, "# 31 \"<command-line>\"\n")) {
                                        /* Bogus extra line with #31, after the regular #1:
                                           Ignore the whole line, and continue parsing */
+                                       hash_buffer(hash, p, q - p);
                                        while (q < end && *q != '\n') {
                                                q++;
                                        }
+                                       q++;
                                        p = q;
                                        continue;
                                } else if (str_startswith(q, "# 32 \"<command-line>\" 2\n")) {
@@ -1623,6 +1625,11 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                /* All other arguments are included in the hash. */
                hash_delimiter(hash, "arg");
                hash_string(hash, args->argv[i]);
+               if (i + 1 < args->argc && compopt_takes_arg(args->argv[i])) {
+                       i++;
+                       hash_delimiter(hash, "arg");
+                       hash_string(hash, args->argv[i]);
+               }
        }
 
        /*
index 1b8dc70..78d6467 100644 (file)
--- a/compopt.c
+++ b/compopt.c
@@ -36,6 +36,7 @@ static const struct compopt compopts[] = {
        {"--save-temps",    TOO_HARD},
        {"--serialize-diagnostics", TAKES_ARG | TAKES_PATH},
        {"-A",              TAKES_ARG},
+       {"-B",              TAKES_ARG | TAKES_CONCAT_ARG},
        {"-D",              AFFECTS_CPP | TAKES_ARG | TAKES_CONCAT_ARG},
        {"-E",              TOO_HARD},
        {"-F",              AFFECTS_CPP | TAKES_ARG | TAKES_CONCAT_ARG | TAKES_PATH},
diff --git a/test.sh b/test.sh
index 27895a9..30aa3eb 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1477,6 +1477,27 @@ EOF
     else
         test_failed "unexpected output of --dump-manifest"
     fi
+
+    ##################################################################
+    testname="argument-less -B and -L"
+    $CCACHE -Cz > /dev/null
+    cat <<EOF >test.c
+#include <stdio.h>
+int main(void)
+{
+#ifdef FOO
+    puts("FOO");
+#endif
+    return 0;
+}
+EOF
+
+    $CCACHE $COMPILER -A -L -DFOO -c test.c
+    checkstat 'cache hit (direct)' 0
+    checkstat 'cache miss' 1
+    $CCACHE $COMPILER -A -L -DBAR -c test.c
+    checkstat 'cache hit (direct)' 0
+    checkstat 'cache miss' 2
 }
 
 basedir_suite() {
@@ -2411,6 +2432,38 @@ b"
 b"
 }
 
+buggy_cpp_suite() {
+    testname="buggy_cpp"
+    $CCACHE -Cz >/dev/null
+    cat >buggy-cpp <<EOF
+#!/bin/sh
+CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
+export CCACHE_DISABLE
+if echo "\$*" | grep -- -D >/dev/null; then
+  $COMPILER "\$@"
+else
+  # mistreat the preprocessor output in the same way as gcc6 does
+  $COMPILER "\$@" |
+    sed -e '/^# 1 "<command-line>"$/ a # 31 "<command-line>"' \\
+        -e 's/^# 1 "<command-line>" 2$/# 32 "<command-line>" 2/'
+fi
+exit 0
+EOF
+    cat <<'EOF' >file.c
+int foo;
+EOF
+    chmod +x buggy-cpp
+    backdate buggy-cpp
+    $CCACHE ./buggy-cpp -c file.c
+    checkstat 'cache hit (direct)' 0
+    checkstat 'cache hit (preprocessed)' 0
+    checkstat 'cache miss' 1
+    $CCACHE ./buggy-cpp -DNOT_AFFECTING=1 -c file.c
+    checkstat 'cache hit (direct)' 0
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 1
+}
+
 symlinks_suite() {
     ##################################################################
     testname="symlink to source directory"
@@ -2577,6 +2630,7 @@ pch
 symlinks
 upgrade
 prefix
+buggy_cpp
 "
 
 case $host_os in
index 71912ab..eb16b4f 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.2.6";
+const char CCACHE_VERSION[] = "3.2.7";