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

index 2d4e9c1..bf9e4c0 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.2</span>\r
+<span id="revnumber">version 3.3.3</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>
@@ -1065,9 +1065,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.2<br />\r
+Version 3.3.3<br />\r
 Last updated\r
- 2016-09-28 22:29:23 CEST\r
+ 2016-10-26 23:04:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 497fb5e..65cebd1 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.2</span>\r
+<span id="revnumber">version 3.3.3</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.2<br />\r
+Version 3.3.3<br />\r
 Last updated\r
- 2016-09-28 22:29:23 CEST\r
+ 2016-10-26 23:04:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 8e4ddaa..1ac466f 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.2</span>\r
+<span id="revnumber">version 3.3.3</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>
@@ -2021,16 +2021,6 @@ invoke the other wrapper when doing preprocessing (normally by adding <strong>-E
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
-ccache doesn&#8217;t handle the GNU Assembler&#8217;s <strong>.incbin</strong> directive correctly. This\r
-  directive can be embedded in the source code inside an <strong><em>asm</em></strong> statement in\r
-  order to include a file verbatim in the object file. If the included file is\r
-  modified, ccache doesn&#8217;t pick up the change since the inclusion isn&#8217;t done by\r
-  the preprocessor. A workaround of this problem is to set\r
-  <strong>extra_files_to_hash</strong> to the path of the included file.\r
-</p>\r
-</li>\r
-<li>\r
-<p>\r
 The direct mode fails to pick up new header files in some rare scenarios. See\r
   <a href="#_the_direct_mode">THE DIRECT MODE</a> above.\r
 </p>\r
@@ -2232,9 +2222,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.2<br />\r
+Version 3.3.3<br />\r
 Last updated\r
- 2016-09-28 22:29:23 CEST\r
+ 2016-10-26 23:21:34 CEST\r
 </div>\r
 </div>\r
 </body>\r
index ab01886..dea2fdc 100644 (file)
@@ -800,13 +800,6 @@ invoke the other wrapper when doing preprocessing (normally by adding *-E*).
 Caveats
 -------
 
-* ccache doesn't handle the GNU Assembler's *.incbin* directive correctly. This
-  directive can be embedded in the source code inside an *__asm__* statement in
-  order to include a file verbatim in the object file. If the included file is
-  modified, ccache doesn't pick up the change since the inclusion isn't done by
-  the preprocessor. A workaround of this problem is to set
-  *extra_files_to_hash* to the path of the included file.
-
 * The direct mode fails to pick up new header files in some rare scenarios. See
   <<_the_direct_mode,THE DIRECT MODE>> above.
 
index c5f20ca..7689f65 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.2</span>\r
+<span id="revnumber">version 3.3.3</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,28 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\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
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+ccache now detects usage of <code>.incbin</code> assembler directives in the source code\r
+  and avoids caching such compilations.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_3_2">ccache 3.3.2</h2>\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">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -771,7 +788,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_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -953,7 +970,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_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -979,7 +996,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_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -997,7 +1014,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_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1021,7 +1038,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_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1044,7 +1061,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_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1094,7 +1111,7 @@ Made it harder to misinterpret documentation of boolean environment settings'
 </ul></div>\r
 </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
@@ -1154,7 +1171,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_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1209,7 +1226,7 @@ Added support for compiler option <code>-gsplit-dwarf</code>.
 </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
@@ -1263,7 +1280,7 @@ Add support for caching code coverage results (compiling for gcov).
 </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
@@ -1334,7 +1351,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_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1566,7 +1583,7 @@ Various other improvements of the test suite.
 </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
@@ -1597,7 +1614,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_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1615,7 +1632,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_15">Bug fixes</h3>\r
+<h3 id="_bug_fixes_16">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1698,7 +1715,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_16">Bug fixes</h3>\r
+<h3 id="_bug_fixes_17">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1738,7 +1755,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_17">Bug fixes</h3>\r
+<h3 id="_bug_fixes_18">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1809,7 +1826,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </ul></div>\r
 </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
@@ -1857,7 +1874,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_19">Bug fixes</h3>\r
+<h3 id="_bug_fixes_20">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1940,7 +1957,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_20">Bug fixes</h3>\r
+<h3 id="_bug_fixes_21">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1993,7 +2010,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_21">Bug fixes</h3>\r
+<h3 id="_bug_fixes_22">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2026,7 +2043,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_22">Bug fixes</h3>\r
+<h3 id="_bug_fixes_23">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2059,7 +2076,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_23">Bug fixes</h3>\r
+<h3 id="_bug_fixes_24">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2086,7 +2103,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_24">Bug fixes</h3>\r
+<h3 id="_bug_fixes_25">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2134,7 +2151,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_25">Bug fixes</h3>\r
+<h3 id="_bug_fixes_26">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2256,7 +2273,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_26">Bug fixes</h3>\r
+<h3 id="_bug_fixes_27">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2342,7 +2359,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_27">Bug fixes</h3>\r
+<h3 id="_bug_fixes_28">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2531,7 +2548,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_28">Bug fixes</h3>\r
+<h3 id="_bug_fixes_29">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2676,9 +2693,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.2<br />\r
+Version 3.3.3<br />\r
 Last updated\r
- 2016-09-28 22:44:16 CEST\r
+ 2016-10-26 23:30:56 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 2c95723..f24bc20 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,17 @@
 ccache news
 ===========
 
+ccache 3.3.3
+------------
+Release date: 2016-10-26
+
+Bug fixes
+~~~~~~~~~
+
+- ccache now detects usage of `.incbin` assembler directives in the source code
+  and avoids caching such compilations.
+
+
 ccache 3.3.2
 ------------
 Release date: 2016-09-28
index afa8a49..1af5191 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -1,13 +1,13 @@
 '\" t
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 09/28/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\"      Date: 10/26/2016
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.3.2
+.\"    Source: ccache 3.3.3
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "09/28/2016" "ccache 3\&.3\&.2" "ccache Manual"
+.TH "CCACHE" "1" "10/26/2016" "ccache 3\&.3\&.3" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1303,23 +1303,6 @@ Another minor thing is that if \fBprefix_command\fR is used, ccache will not inv
 .sp -1
 .IP \(bu 2.3
 .\}
-ccache doesn\(cqt handle the GNU Assembler\(cqs
-\fB\&.incbin\fR
-directive correctly\&. This directive can be embedded in the source code inside an
-\fB\fIasm\fR\fR
-statement in order to include a file verbatim in the object file\&. If the included file is modified, ccache doesn\(cqt pick up the change since the inclusion isn\(cqt done by the preprocessor\&. A workaround of this problem is to set
-\fBextra_files_to_hash\fR
-to the path of the included file\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
 The direct mode fails to pick up new header files in some rare scenarios\&. See
 THE DIRECT MODE
 above\&.
index c4070ad..b93e027 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -815,6 +815,15 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                        inc_path = make_relative_path(inc_path);
                        remember_include_file(inc_path, hash, system);
                        p = q;
+               } 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");
+                       stats_update(STATS_UNSUPPORTED_DIRECTIVE);
+                       failed();
                } else {
                        q++;
                }
@@ -2136,7 +2145,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                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);
+                               stats_update(STATS_UNSUPPORTED_OPTION);
                                result = false;
                                goto out;
                        }
@@ -2176,7 +2185,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                // These are always too hard.
                if (compopt_too_hard(argv[i]) || str_startswith(argv[i], "-fdump-")) {
                        cc_log("Compiler option %s is unsupported", argv[i]);
-                       stats_update(STATS_UNSUPPORTED);
+                       stats_update(STATS_UNSUPPORTED_OPTION);
                        result = false;
                        goto out;
                }
@@ -2190,7 +2199,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                // -Xarch_* options are too hard.
                if (str_startswith(argv[i], "-Xarch_")) {
                        cc_log("Unsupported compiler option :%s", argv[i]);
-                       stats_update(STATS_UNSUPPORTED);
+                       stats_update(STATS_UNSUPPORTED_OPTION);
                        result = false;
                        goto out;
                }
@@ -2200,7 +2209,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                        if (arch_args_size == MAX_ARCH_ARGS - 1) {
                                cc_log("Too many -arch compiler options; ccache supports at most %d",
                                       MAX_ARCH_ARGS);
-                               stats_update(STATS_UNSUPPORTED);
+                               stats_update(STATS_UNSUPPORTED_OPTION);
                                result = false;
                                goto out;
                        }
@@ -2422,7 +2431,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                                // file from compiling the preprocessed file will not be equal to the
                                // object file produced when compiling without ccache.
                                cc_log("Too hard option -Wp,-P detected");
-                               stats_update(STATS_UNSUPPORTED);
+                               stats_update(STATS_UNSUPPORTED_OPTION);
                                failed();
                        } else if (str_startswith(argv[i], "-Wp,-MD,")
                                   && !strchr(argv[i] + 8, ',')) {
index 7b29bb8..8b738ab 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -42,7 +42,7 @@ enum stats {
        STATS_NOINPUT = 17,
        STATS_MULTIPLE = 18,
        STATS_CONFTEST = 19,
-       STATS_UNSUPPORTED = 20,
+       STATS_UNSUPPORTED_OPTION = 20,
        STATS_OUTSTDOUT = 21,
        STATS_CACHEHIT_DIR = 22,
        STATS_NOOUTPUT = 23,
@@ -52,6 +52,7 @@ enum stats {
        STATS_CANTUSEPCH = 27,
        STATS_PREPROCESSING = 28,
        STATS_NUMCLEANUPS = 29,
+       STATS_UNSUPPORTED_DIRECTIVE = 30,
 
        STATS_END
 };
index 8195d47..86b124e 100755 (executable)
--- a/configure
+++ b/configure
@@ -666,6 +666,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -737,6 +738,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -989,6 +991,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1126,7 +1137,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
+               libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1279,6 +1290,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
diff --git a/stats.c b/stats.c
index 6eff3e1..5d9fc73 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -50,40 +50,192 @@ static struct {
        void (*fn)(uint64_t);
        unsigned flags;
 } stats_info[] = {
-       { STATS_CACHEHIT_DIR, "cache hit (direct)             ", NULL, FLAG_ALWAYS },
-       { STATS_CACHEHIT_CPP, "cache hit (preprocessed)       ", NULL, FLAG_ALWAYS },
-       { STATS_TOCACHE,      "cache miss                     ", NULL, FLAG_ALWAYS },
-       { STATS_LINK,         "called for link                ", NULL, 0 },
-       { STATS_PREPROCESSING, "called for preprocessing       ", NULL, 0 },
-       { STATS_MULTIPLE,     "multiple source files          ", NULL, 0 },
-       { STATS_STDOUT,       "compiler produced stdout       ", NULL, 0 },
-       { STATS_NOOUTPUT,     "compiler produced no output    ", NULL, 0 },
-       { STATS_EMPTYOUTPUT,  "compiler produced empty output ", NULL, 0 },
-       { STATS_STATUS,       "compile failed                 ", NULL, 0 },
-       { STATS_ERROR,        "ccache internal error          ", NULL, 0 },
-       { STATS_PREPROCESSOR, "preprocessor error             ", NULL, 0 },
-       { STATS_CANTUSEPCH,   "can't use precompiled header   ", NULL, 0 },
-       { STATS_COMPILER,     "couldn't find the compiler     ", NULL, 0 },
-       { STATS_MISSING,      "cache file missing             ", NULL, 0 },
-       { STATS_ARGS,         "bad compiler arguments         ", NULL, 0 },
-       { STATS_SOURCELANG,   "unsupported source language    ", NULL, 0 },
-       { STATS_COMPCHECK,    "compiler check failed          ", NULL, 0 },
-       { STATS_CONFTEST,     "autoconf compile/link          ", NULL, 0 },
-       { STATS_UNSUPPORTED,  "unsupported compiler option    ", NULL, 0 },
-       { STATS_OUTSTDOUT,    "output to stdout               ", NULL, 0 },
-       { STATS_DEVICE,       "output to a non-regular file   ", NULL, 0 },
-       { STATS_NOINPUT,      "no input file                  ", NULL, 0 },
-       { STATS_BADEXTRAFILE, "error hashing extra file       ", NULL, 0 },
-       { STATS_NUMCLEANUPS,  "cleanups performed             ", NULL, FLAG_ALWAYS },
-       { STATS_NUMFILES,     "files in cache                 ", NULL,
-               FLAG_NOZERO|FLAG_ALWAYS },
-       { STATS_TOTALSIZE,    "cache size                     ",
-               display_size_times_1024, FLAG_NOZERO|FLAG_ALWAYS },
-       { STATS_OBSOLETE_MAXFILES, "OBSOLETE",                   NULL,
-               FLAG_NOZERO|FLAG_NEVER},
-       { STATS_OBSOLETE_MAXSIZE, "OBSOLETE",                    NULL,
-               FLAG_NOZERO|FLAG_NEVER},
-       { STATS_NONE, NULL, NULL, 0 }
+       {
+               STATS_CACHEHIT_DIR,
+               "cache hit (direct)",
+               NULL,
+               FLAG_ALWAYS
+       },
+       {
+               STATS_CACHEHIT_CPP,
+               "cache hit (preprocessed)",
+               NULL,
+               FLAG_ALWAYS
+       },
+       {
+               STATS_TOCACHE,
+               "cache miss",
+               NULL,
+               FLAG_ALWAYS
+       },
+       {
+               STATS_LINK,
+               "called for link",
+               NULL,
+               0
+       },
+       {
+               STATS_PREPROCESSING,
+               "called for preprocessing",
+               NULL,
+               0
+       },
+       {
+               STATS_MULTIPLE,
+               "multiple source files",
+               NULL,
+               0
+       },
+       {
+               STATS_STDOUT,
+               "compiler produced stdout",
+               NULL,
+               0
+       },
+       {
+               STATS_NOOUTPUT,
+               "compiler produced no output",
+               NULL,
+               0
+       },
+       {
+               STATS_EMPTYOUTPUT,
+               "compiler produced empty output",
+               NULL,
+               0
+       },
+       {
+               STATS_STATUS,
+               "compile failed",
+               NULL,
+               0
+       },
+       {
+               STATS_ERROR,
+               "ccache internal error",
+               NULL,
+               0
+       },
+       {
+               STATS_PREPROCESSOR,
+               "preprocessor error",
+               NULL,
+               0
+       },
+       {
+               STATS_CANTUSEPCH,
+               "can't use precompiled header",
+               NULL,
+               0
+       },
+       {
+               STATS_COMPILER,
+               "couldn't find the compiler",
+               NULL,
+               0
+       },
+       {
+               STATS_MISSING,
+               "cache file missing",
+               NULL,
+               0
+       },
+       {
+               STATS_ARGS,
+               "bad compiler arguments",
+               NULL,
+               0
+       },
+       {
+               STATS_SOURCELANG,
+               "unsupported source language",
+               NULL,
+               0
+       },
+       {
+               STATS_COMPCHECK,
+               "compiler check failed",
+               NULL,
+               0
+       },
+       {
+               STATS_CONFTEST,
+               "autoconf compile/link",
+               NULL,
+               0
+       },
+       {
+               STATS_UNSUPPORTED_OPTION,
+               "unsupported compiler option",
+               NULL,
+               0
+       },
+       {
+               STATS_UNSUPPORTED_DIRECTIVE,
+               "unsupported code directive",
+               NULL,
+               0
+       },
+       {
+               STATS_OUTSTDOUT,
+               "output to stdout",
+               NULL,
+               0
+       },
+       {
+               STATS_DEVICE,
+               "output to a non-regular file",
+               NULL,
+               0
+       },
+       {
+               STATS_NOINPUT,
+               "no input file",
+               NULL,
+               0
+       },
+       {
+               STATS_BADEXTRAFILE,
+               "error hashing extra file",
+               NULL,
+               0
+       },
+       {
+               STATS_NUMCLEANUPS,
+               "cleanups performed",
+               NULL,
+               FLAG_ALWAYS
+       },
+       {
+               STATS_NUMFILES,
+               "files in cache",
+               NULL,
+               FLAG_NOZERO|FLAG_ALWAYS
+       },
+       {
+               STATS_TOTALSIZE,
+               "cache size",
+               display_size_times_1024,
+               FLAG_NOZERO|FLAG_ALWAYS
+       },
+       {
+               STATS_OBSOLETE_MAXFILES,
+               "OBSOLETE",
+               NULL,
+               FLAG_NOZERO|FLAG_NEVER
+       },
+       {
+               STATS_OBSOLETE_MAXSIZE,
+               "OBSOLETE",
+               NULL,
+               FLAG_NOZERO|FLAG_NEVER
+       },
+       {
+               STATS_NONE,
+               NULL,
+               NULL,
+               0
+       }
 };
 
 static void
@@ -297,7 +449,7 @@ stats_summary(struct conf *conf)
                        continue;
                }
 
-               printf("%s ", stats_info[i].message);
+               printf("%-31s ", stats_info[i].message);
                if (stats_info[i].fn) {
                        stats_info[i].fn(counters->data[stat]);
                        printf("\n");
diff --git a/test.sh b/test.sh
index 9c7314e..ada8697 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1101,6 +1101,18 @@ EOF
     if [ "$(./c)" != OK ]; then
         test_failed "Incorrect header file used"
     fi
+
+    # -------------------------------------------------------------------------
+    TEST ".incbin"
+
+    cat <<EOF >incbin.c
+char x[] = ".incbin";
+EOF
+
+    $CCACHE_COMPILE -c incbin.c
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 0
+    expect_stat 'unsupported code directive' 1
 }
 
 # =============================================================================
@@ -1614,15 +1626,19 @@ EOF
     # ccache could try to parse and make sense of -Wp, with multiple arguments,
     # but it currently doesn't, so we have to disable direct mode.
 
-    $CCACHE_COMPILE -c -Wp,-DFOO,-DGOO test.c 2>/dev/null
+    touch source.c
+
+    $CCACHE_COMPILE -c -Wp,-MMD,source.d,-MT,source.o source.c 2>/dev/null
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 1
+    expect_file_content source.d "source.o: source.c"
 
-    $CCACHE_COMPILE -c -Wp,-DFOO,-DGOO test.c 2>/dev/null
+    $CCACHE_COMPILE -c -Wp,-MMD,source.d,-MT,source.o source.c 2>/dev/null
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache hit (preprocessed)' 1
     expect_stat 'cache miss' 1
+    expect_file_content source.d "source.o: source.c"
 
     # -------------------------------------------------------------------------
     TEST "-MMD for different source files"
index f63c3af..80f23db 100644 (file)
@@ -81,7 +81,7 @@ TEST(dash_M_should_be_unsupported)
 
        create_file("foo.c", "");
        CHECK(!cc_process_args(orig, &preprocessed, &compiler));
-       CHECK_INT_EQ(1, stats_get_pending(STATS_UNSUPPORTED));
+       CHECK_INT_EQ(1, stats_get_pending(STATS_UNSUPPORTED_OPTION));
 
        args_free(orig);
 }
index df441b8..ba8a4da 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.3.2";
+const char CCACHE_VERSION[] = "3.3.3";