Imported Upstream version 3.7.5 upstream/3.7.5
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:28:44 +0000 (16:28 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:28:44 +0000 (16:28 +0900)
19 files changed:
LICENSE.html
Makefile.in
configure
configure.ac
dev.mk.in
doc/AUTHORS.adoc
doc/AUTHORS.html
doc/MANUAL.html
doc/NEWS.adoc
doc/NEWS.html
doc/ccache.1
src/ccache.c
src/ccache.h
src/hashutil.c
src/manifest.c
src/util.c
src/version.c
test/suites/base.bash
unittest/test_argument_processing.c

index b2a15842c57cea7df13a4fba1682c18d2e3d28c9..9b5aed965484798746231cd487893dd106b47553 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.7.4</span>\r
+<span id="revnumber">version 3.7.5</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>
@@ -1235,9 +1235,9 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.7.4<br />\r
+Version 3.7.5<br />\r
 Last updated\r
- 2019-09-12 21:14:17 CEST\r
+ 2019-10-22 20:50:43 CEST\r
 </div>\r
 </div>\r
 </body>\r
index fba5e10e5dfcc4de8815d496194d573f23de07f3..b5a3ea5dd60dc4e2dd12dc0407c4d146a218cfec 100644 (file)
@@ -126,6 +126,8 @@ install: ccache$(EXEEXT) @disable_man@ccache.1
 clean:
        rm -rf $(files_to_clean)
 
+$(non_3pp_objs) $(test_objs): CFLAGS += @more_warnings@
+
 src/snprintf.o: CFLAGS += @no_implicit_fallthrough_warning@
 $(zlib_objs): CPPFLAGS += -include config.h
 $(zlib_objs): CFLAGS += @no_implicit_fallthrough_warning@
index dbec97523f5f0eca89b96524b0cfbe6dc548b2fb..92a67ab931d8467452d062e199bcb6303aac0d61 100755 (executable)
--- a/configure
+++ b/configure
@@ -4067,24 +4067,22 @@ else
     CFLAGS="$CFLAGS -O"
 fi
 
-more_warnings="-Wextra -Wpedantic"
-if test "$ac_compiler_clang" = yes; then
-    more_warnings="$more_warnings -Weverything"
-    more_warnings="$more_warnings -Wno-conversion"
-    more_warnings="$more_warnings -Wno-disabled-macro-expansion"
-    more_warnings="$more_warnings -Wno-format-nonliteral"
-    more_warnings="$more_warnings -Wno-padded"
-    more_warnings="$more_warnings -Wno-shorten-64-to-32"
-    more_warnings="$more_warnings -Wno-sign-conversion"
-fi
-
 # Check whether --enable-more_warnings was given.
 if test "${enable_more_warnings+set}" = set; then :
   enableval=$enable_more_warnings;
 fi
 
 if test x${enable_more_warnings} = xyes; then
-    CFLAGS="$CFLAGS $more_warnings"
+    more_warnings="-Wextra -Wpedantic"
+    if test "$ac_compiler_clang" = yes; then
+        more_warnings="$more_warnings -Weverything"
+        more_warnings="$more_warnings -Wno-conversion"
+        more_warnings="$more_warnings -Wno-disabled-macro-expansion"
+        more_warnings="$more_warnings -Wno-format-nonliteral"
+        more_warnings="$more_warnings -Wno-padded"
+        more_warnings="$more_warnings -Wno-shorten-64-to-32"
+        more_warnings="$more_warnings -Wno-sign-conversion"
+    fi
 fi
 
 
@@ -6343,6 +6341,7 @@ $as_echo "$as_me: developer mode enabled" >&6;}
 
     include_dev_mk='include dev.mk'
     version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
+    mkdir -p src
     echo "extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = \"$version\";" >src/version.c
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gperf", so it can be a program name with args.
index 45c47991ec918536b91f22a0453112c1593a26bb..01098842e992456aedf1bc0db49021cd7ccf2bb9 100644 (file)
@@ -56,22 +56,20 @@ else
     CFLAGS="$CFLAGS -O"
 fi
 
-more_warnings="-Wextra -Wpedantic"
-if test "$ac_compiler_clang" = yes; then
-    more_warnings="$more_warnings -Weverything"
-    more_warnings="$more_warnings -Wno-conversion"
-    more_warnings="$more_warnings -Wno-disabled-macro-expansion"
-    more_warnings="$more_warnings -Wno-format-nonliteral"
-    more_warnings="$more_warnings -Wno-padded"
-    more_warnings="$more_warnings -Wno-shorten-64-to-32"
-    more_warnings="$more_warnings -Wno-sign-conversion"
-fi
-
 AC_ARG_ENABLE(more_warnings,
   [AS_HELP_STRING([--enable-more-warnings],
     [enable more compiler warnings])])
 if test x${enable_more_warnings} = xyes; then
-    CFLAGS="$CFLAGS $more_warnings"
+    more_warnings="-Wextra -Wpedantic"
+    if test "$ac_compiler_clang" = yes; then
+        more_warnings="$more_warnings -Weverything"
+        more_warnings="$more_warnings -Wno-conversion"
+        more_warnings="$more_warnings -Wno-disabled-macro-expansion"
+        more_warnings="$more_warnings -Wno-format-nonliteral"
+        more_warnings="$more_warnings -Wno-padded"
+        more_warnings="$more_warnings -Wno-shorten-64-to-32"
+        more_warnings="$more_warnings -Wno-sign-conversion"
+    fi
 fi
 
 AC_HEADER_DIRENT
@@ -213,6 +211,7 @@ if test ! -f $srcdir/dev_mode_disabled; then
     AC_CONFIG_FILES([dev.mk])
     include_dev_mk='include dev.mk'
     version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
+    mkdir -p src
     echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
     AC_CHECK_TOOL(GPERF, gperf)
     if test -z "$GPERF"; then
index da76797c9f6945dde61846ce46095e2de6c3d1e5..dbe2a22a8ae0fe699d1e39452356a552583389a6 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -1,7 +1,7 @@
 # GNU make syntax reigns in this file.
 
 all_cflags += -Werror
-all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$(subst $(srcdir)/,,$<))).d
+all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$(subst $(srcdir)/,,$<))).d -MQ $@
 
 A2X = a2x
 ASCIIDOC = asciidoc
@@ -185,8 +185,6 @@ docs: $(generated_docs)
        $(Q)$(ASCIIDOC) -a revnumber=$(version) -d manpage -b docbook -o - $< | \
          perl -pe 's!<literal>(.*?)</literal>!<emphasis role="strong">\1</emphasis>!g' >$@
 
-$(non_3pp_objs) $(test_objs): CFLAGS += @more_warnings@
-
 doc/ccache.1: doc/MANUAL.xml
        $(if $(quiet),@echo "  A2X      $@")
        $(Q)$(A2X) --doctype manpage --format manpage $<
index c9a9921d6a953ce3a0bf4a78d0df234cd735d13c..f8bc0e6f907a8e6c790463cfb2ea4501ae3c6698 100644 (file)
@@ -24,6 +24,7 @@ ccache is a collective work with contributions from many people, including:
 * David Givone
 * Doug Anderson
 * Edward Z. Yang
+* Erik Johansson
 * Francois Marier
 * Gabriel Scherer
 * Geert Bosch
index e34d35ff9c88af2d982e5f827bee3162cf9b4f4c..06a8dd3169947abe25af3d07e1e0908f58bbdb0d 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.7.4</span>\r
+<span id="revnumber">version 3.7.5</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>
@@ -840,6 +840,11 @@ Edward Z. Yang
 </li>\r
 <li>\r
 <p>\r
+Erik Johansson\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Francois Marier\r
 </p>\r
 </li>\r
@@ -1246,9 +1251,9 @@ Yvan Janssens
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.7.4<br />\r
+Version 3.7.5<br />\r
 Last updated\r
- 2019-09-12 21:14:17 CEST\r
+ 2019-10-22 20:50:43 CEST\r
 </div>\r
 </div>\r
 </body>\r
index fc8b2e19567c463990cff0a05fcedbf67afb6e98..9dd91c3af85e3d20e33e127d5179addd8781e2da 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.7.4</span>\r
+<span id="revnumber">version 3.7.5</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>
@@ -2746,9 +2746,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.7.4<br />\r
+Version 3.7.5<br />\r
 Last updated\r
- 2019-09-12 21:14:17 CEST\r
+ 2019-10-22 20:50:43 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 7322475a59e1d23389a30361e3d1d233f01f2b8b..224ca7957f41847234d387a556539c25123e06b1 100644 (file)
@@ -1,6 +1,38 @@
 ccache news
 ===========
 
+ccache 3.7.5
+------------
+Release date: 2019-10-22
+
+New features
+~~~~~~~~~~~~
+
+- Added support for `-MF=arg` (with an extra equal sign) as understood by
+  EDG-based compilers.
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed a regression in 3.7.2 that could result in a warning message instead of
+  an error in an edge case related to usage of “-Werror”.
+
+- An implicit `-MQ` is now passed to the preprocessor only if the object file
+  extension is non-standard. This will make it easier to use EDG-based
+  compilers (e.g. GHS) which don’t understand `-MQ`. (This is a bug fix of the
+  corresponding improvement implemented in ccache 3.4.)
+
+- ccache now falls back to running the real compiler instead of failing fataly
+  if an internal temporary file is missing after compilation.
+
+- Fixed a crash if localtime returns null pointer in localtime_r replacement.
+
+- Fixed header file dependency tracking when building ccache itself.
+
+- Fixed warning during configure in out-of-tree build in developer mode.
+
+
 ccache 3.7.4
 ------------
 Release date: 2019-09-12
index e09eb5de4901a2b4290d2fe6272d30036198e0ff..9a96ed3908dc22a9d427a3752928cb9b6e7c5e7e 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.7.4</span>\r
+<span id="revnumber">version 3.7.5</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>
@@ -743,6 +743,63 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_7_5">ccache 3.7.5</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2019-10-22</p></div>\r
+<div class="sect2">\r
+<h3 id="_new_features">New features</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Added support for <code>-MF=arg</code> (with an extra equal sign) as understood by\r
+  EDG-based compilers.\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 3.7.2 that could result in a warning message instead of\r
+  an error in an edge case related to usage of “-Werror”.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+An implicit <code>-MQ</code> is now passed to the preprocessor only if the object file\r
+  extension is non-standard. This will make it easier to use EDG-based\r
+  compilers (e.g. GHS) which don’t understand <code>-MQ</code>. (This is a bug fix of the\r
+  corresponding improvement implemented in ccache 3.4.)\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+ccache now falls back to running the real compiler instead of failing fataly\r
+  if an internal temporary file is missing after compilation.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed a crash if localtime returns null pointer in localtime_r replacement.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed header file dependency tracking when building ccache itself.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed warning during configure in out-of-tree build in developer mode.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_7_4">ccache 3.7.4</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2019-09-12</p></div>\r
@@ -771,7 +828,7 @@ Added support for converting paths like “/c/users” into relative paths on
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2019-08-17</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
@@ -796,7 +853,7 @@ Fixed a regression in 3.7.2 when using the compiler option “-Werror” and the
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2019-07-19</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
@@ -1253,7 +1310,7 @@ Made “./configure --without-bundled-zlib” do what’s intended.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2018-09-02</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
@@ -1290,7 +1347,7 @@ Upgraded bundled zlib to version 1.2.11.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2018-03-25</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
@@ -1334,7 +1391,7 @@ Made it possible to perform out-of-source builds in dev mode again.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2018-02-11</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
@@ -1420,7 +1477,7 @@ Documented caveats related to colored warnings from compilers.
 </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
@@ -1458,7 +1515,7 @@ Improved instructions on how to get cache hits between different working
 </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
@@ -1484,7 +1541,7 @@ Documented how automatic cache cleanup works.
 </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
@@ -1567,7 +1624,7 @@ Documented the different cache statistics counters.
 </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
@@ -1597,7 +1654,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_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1614,7 +1671,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_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1639,7 +1696,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_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1821,7 +1878,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_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1847,7 +1904,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_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1865,7 +1922,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_15">Bug fixes</h3>\r
+<h3 id="_bug_fixes_16">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1889,7 +1946,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_16">Bug fixes</h3>\r
+<h3 id="_bug_fixes_17">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1912,7 +1969,7 @@ ccache now knows how to work around a glitch in the output of GCC 6’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_17">Bug fixes</h3>\r
+<h3 id="_bug_fixes_18">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1962,7 +2019,7 @@ Made it harder to misinterpret documentation of boolean environment settings’
 </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
@@ -2022,7 +2079,7 @@ The man page is now built when running “make install” from Git repository
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-10-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
@@ -2077,7 +2134,7 @@ Added support for compiler option <code>-gsplit-dwarf</code>.
 </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
@@ -2131,7 +2188,7 @@ Add support for caching code coverage results (compiling for gcov).
 </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
@@ -2201,7 +2258,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_22">Bug fixes</h3>\r
+<h3 id="_bug_fixes_23">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2433,7 +2490,7 @@ Various other improvements of the test suite.
 </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
@@ -2464,7 +2521,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_24">Bug fixes</h3>\r
+<h3 id="_bug_fixes_25">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2482,7 +2539,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_25">Bug fixes</h3>\r
+<h3 id="_bug_fixes_26">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2564,7 +2621,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_26">Bug fixes</h3>\r
+<h3 id="_bug_fixes_27">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2604,7 +2661,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_27">Bug fixes</h3>\r
+<h3 id="_bug_fixes_28">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2675,7 +2732,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </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
@@ -2723,7 +2780,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_29">Bug fixes</h3>\r
+<h3 id="_bug_fixes_30">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2806,7 +2863,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_30">Bug fixes</h3>\r
+<h3 id="_bug_fixes_31">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2859,7 +2916,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_31">Bug fixes</h3>\r
+<h3 id="_bug_fixes_32">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2892,7 +2949,7 @@ Systems that lack (and don’t need to be linked with) libm are now supported.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_32">Bug fixes</h3>\r
+<h3 id="_bug_fixes_33">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2925,7 +2982,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_33">Bug fixes</h3>\r
+<h3 id="_bug_fixes_34">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2952,7 +3009,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_34">Bug fixes</h3>\r
+<h3 id="_bug_fixes_35">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -3000,7 +3057,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_35">Bug fixes</h3>\r
+<h3 id="_bug_fixes_36">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -3122,7 +3179,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_36">Bug fixes</h3>\r
+<h3 id="_bug_fixes_37">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -3208,7 +3265,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_37">Bug fixes</h3>\r
+<h3 id="_bug_fixes_38">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -3397,7 +3454,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_38">Bug fixes</h3>\r
+<h3 id="_bug_fixes_39">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -3542,9 +3599,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.7.4<br />\r
+Version 3.7.5<br />\r
 Last updated\r
- 2019-09-12 21:14:17 CEST\r
+ 2019-10-22 20:50:43 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 7442b3788cacb401c4fb0c506761797c50126fc8..9a5ce364eaf5159faca80678d075b8f5146f50a5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 09/12/2019
+.\"      Date: 10/22/2019
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.7.4
+.\"    Source: ccache 3.7.5
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "09/12/2019" "ccache 3\&.7\&.4" "ccache Manual"
+.TH "CCACHE" "1" "10/22/2019" "ccache 3\&.7\&.5" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index f56445beef24bf4ca2a768e45b634d9513ae8c56..2ad1ed542946cd5d58027f75a134f48b44da17d4 100644 (file)
@@ -280,6 +280,10 @@ struct pending_tmp_file {
 // Temporary files to remove at program exit.
 static struct pending_tmp_file *pending_tmp_files = NULL;
 
+// How often (in seconds) to scan $CCACHE_DIR/tmp for left-over temporary
+// files.
+static const int k_tempdir_cleanup_interval = 2 * 24 * 60 * 60; // 2 days
+
 #ifndef _WIN32
 static sigset_t fatal_signal_set;
 
@@ -480,7 +484,8 @@ clean_up_internal_tempdir(void)
 {
        time_t now = time(NULL);
        struct stat st;
-       if (x_stat(conf->cache_dir, &st) != 0 || st.st_mtime + 3600 >= now) {
+       if (x_stat(conf->cache_dir, &st) != 0
+                       || st.st_mtime + k_tempdir_cleanup_interval >= now) {
                // No cleanup needed.
                return;
        }
@@ -499,7 +504,8 @@ clean_up_internal_tempdir(void)
                }
 
                char *path = format("%s/%s", temp_dir(), entry->d_name);
-               if (x_lstat(path, &st) == 0 && st.st_mtime + 3600 < now) {
+               if (x_lstat(path, &st) == 0
+                               && st.st_mtime + k_tempdir_cleanup_interval < now) {
                        tmp_unlink(path);
                }
                free(path);
@@ -1720,7 +1726,10 @@ get_object_name_from_cpp(struct args *args, struct hash *hash)
 
        hash_delimiter(hash, "cppstderr");
        if (!direct_i_file && !hash_file(hash, path_stderr)) {
-               fatal("Failed to open %s: %s", path_stderr, strerror(errno));
+               // Somebody removed the temporary file?
+               stats_update(STATS_ERROR);
+               cc_log("Failed to open %s: %s", path_stderr, strerror(errno));
+               failed();
        }
 
        if (direct_i_file) {
@@ -2492,10 +2501,15 @@ detect_pch(const char *option, const char *arg, bool *found_pch)
 }
 
 // Process the compiler options into options suitable for passing to the
-// preprocessor and the real compiler. The preprocessor options don't include
-// -E; this is added later. Returns true on success, otherwise false.
+// preprocessor and the real compiler. preprocessor_args doesn't include -E;
+// this is added later. extra_args_to_hash are the arguments that are not
+// included in preprocessor_args but that should be included in the hash.
+//
+// Returns true on success, otherwise false.
 bool
-cc_process_args(struct args *args, struct args **preprocessor_args,
+cc_process_args(struct args *args,
+                struct args **preprocessor_args,
+                struct args **extra_args_to_hash,
                 struct args **compiler_args)
 {
        bool found_c_opt = false;
@@ -2825,8 +2839,11 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                                arg = argv[i + 1];
                                i++;
                        } else {
-                               // -MFarg
+                               // -MFarg or -MF=arg (EDG-based compilers)
                                arg = &argv[i][3];
+                               if (arg[0] == '=') {
+                                       ++arg;
+                               }
                        }
                        output_dep = make_relative_path(x_strdup(arg));
                        // Keep the format of the args the same.
@@ -3517,7 +3534,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
 
                if (!dependency_target_specified
                    && !dependency_implicit_target_specified
-                   && !str_eq(get_extension(output_dep), ".o")) {
+                   && !str_eq(get_extension(output_obj), ".o")) {
                        args_add(dep_args, "-MQ");
                        args_add(dep_args, output_obj);
                }
@@ -3580,6 +3597,10 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
        *preprocessor_args = args_copy(common_args);
        args_extend(*preprocessor_args, cpp_args);
 
+       if (extra_args_to_hash) {
+               *extra_args_to_hash = compiler_only_args;
+       }
+
 out:
        args_free(expanded_args);
        args_free(common_args);
@@ -3918,10 +3939,14 @@ ccache(int argc, char *argv[])
 
        // Arguments (except -E) to send to the preprocessor.
        struct args *preprocessor_args;
+       // Arguments not sent to the preprocessor but that should be part of the
+       // hash.
+       struct args *extra_args_to_hash;
        // Arguments to send to the real compiler.
        struct args *compiler_args;
        MTR_BEGIN("main", "process_args");
-       if (!cc_process_args(orig_args, &preprocessor_args, &compiler_args)) {
+       if (!cc_process_args(
+             orig_args, &preprocessor_args, &extra_args_to_hash, &compiler_args)) {
                failed();
        }
        MTR_END("main", "process_args");
@@ -3980,13 +4005,16 @@ ccache(int argc, char *argv[])
        init_hash_debug(
                direct_hash, output_obj, 'd', "DIRECT MODE", debug_text_file);
 
+       struct args *args_to_hash = args_copy(preprocessor_args);
+       args_extend(args_to_hash, extra_args_to_hash);
+
        bool put_object_in_manifest = false;
        struct file_hash *object_hash = NULL;
        struct file_hash *object_hash_from_manifest = NULL;
        if (conf->direct_mode) {
                cc_log("Trying direct lookup");
                MTR_BEGIN("hash", "direct_hash");
-               object_hash = calculate_object_hash(preprocessor_args, direct_hash, 1);
+               object_hash = calculate_object_hash(args_to_hash, direct_hash, 1);
                MTR_END("hash", "direct_hash");
                if (object_hash) {
                        update_cached_result_globals(object_hash);
@@ -4018,7 +4046,7 @@ ccache(int argc, char *argv[])
                        cpp_hash, output_obj, 'p', "PREPROCESSOR MODE", debug_text_file);
 
                MTR_BEGIN("hash", "cpp_hash");
-               object_hash = calculate_object_hash(preprocessor_args, cpp_hash, 0);
+               object_hash = calculate_object_hash(args_to_hash, cpp_hash, 0);
                MTR_END("hash", "cpp_hash");
                if (!object_hash) {
                        fatal("internal error: object hash from cpp returned NULL");
index a2694d1a6112973e6a7aa10781e32ba5c3f8d97b..ac12a14b0e362d21403674d76c367ba7695e4c08 100644 (file)
@@ -270,8 +270,10 @@ extern time_t time_of_compilation;
 extern bool output_is_precompiled_header;
 void block_signals(void);
 void unblock_signals(void);
-bool cc_process_args(struct args *args, struct args **preprocessor_args,
-                    struct args **compiler_args);
+bool cc_process_args(struct args *args,
+                     struct args **preprocessor_args,
+                     struct args **extra_args_to_hash,
+                     struct args **compiler_args);
 void cc_reset(void);
 bool is_precompiled_header(const char *path);
 
index edf446c4cbef8964029b651daf9f83657c6f1f0e..482ce6b7f074af9181eea6e85cbc22217a0e7f5b 100644 (file)
@@ -104,13 +104,16 @@ hash_source_code_string(
        hash_string_buffer(hash, str, len);
 
        if (result & HASH_SOURCE_CODE_FOUND_DATE) {
+               cc_log("Found __DATE__ in %s", path);
+
                // Make sure that the hash sum changes if the (potential) expansion of
                // __DATE__ changes.
                time_t t = time(NULL);
                struct tm now;
-               localtime_r(&t, &now);
-               cc_log("Found __DATE__ in %s", path);
                hash_delimiter(hash, "date");
+               if (!localtime_r(&t, &now)) {
+                       return HASH_SOURCE_CODE_ERROR;
+               }
                hash_int(hash, now.tm_year);
                hash_int(hash, now.tm_mon);
                hash_int(hash, now.tm_mday);
index 0b85e90686a87415fb4bd6baddd1d41bc50ca0c6..603d85bbd1864679b3d90387d1ccbf0a6e55f9e1 100644 (file)
@@ -288,7 +288,7 @@ read_manifest(gzFile f, char **errmsg)
        return mf;
 
 error:
-       if (!errmsg) {
+       if (!*errmsg) {
                *errmsg = x_strdup("Corrupt manifest file");
        }
        free_manifest(mf);
index 8f4490ffc46df80c20f8d430a6559d492a089308..2dbe6652cc6d97b8446cd73a5c2c9ac2d7f774ac 100644 (file)
@@ -1224,8 +1224,14 @@ struct tm *
 localtime_r(const time_t *timep, struct tm *result)
 {
        struct tm *tm = localtime(timep);
-       *result = *tm;
-       return result;
+       if (tm) {
+               *result = *tm;
+               return result;
+       }
+       else {
+               memset(result, 0, sizeof(*result));
+               return NULL;
+       }
 }
 #endif
 
index 1945261887e55382b5653bff479a41ca04a6f724..0537aa78473532dcc6a0664825296719dccfd629 100644 (file)
@@ -1 +1 @@
-extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "3.7.4";
+extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "3.7.5";
index 5e9cd4d0c430c04ac1285759d830c161d12611a8..fac44ea670e83b8eacf715821ce03daf0a739add 100644 (file)
@@ -980,6 +980,26 @@ EOF
     expect_stat 'cache hit (preprocessed)' 1
     expect_stat 'cache miss' 1
 
+    # -------------------------------------------------------------------------
+    TEST "Handling of compiler-only arguments"
+
+    $CCACHE_COMPILE -c test1.c
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 1
+
+    $CCACHE_COMPILE -c test1.c
+    expect_stat 'cache hit (preprocessed)' 1
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 1
+
+    # Even though -Werror is not passed to the preprocessor, it should be part
+    # of the hash, so we expect a cache miss:
+    $CCACHE_COMPILE -c -Werror test1.c
+    expect_stat 'cache hit (preprocessed)' 1
+    expect_stat 'cache miss' 2
+    expect_stat 'files in cache' 2
+
     # -------------------------------------------------------------------------
     TEST "Buggy GCC 6 cpp"
 
index 6993e42354cac6076cad9e82ef16a2e63a180d48..3a2d0ed37adbca5ae66cbe8984b9bb90689e5acf 100644 (file)
@@ -68,7 +68,7 @@ TEST(dash_E_should_result_in_called_for_preprocessing)
        struct args *preprocessed, *compiler;
 
        create_file("foo.c", "");
-       CHECK(!cc_process_args(orig, &preprocessed, &compiler));
+       CHECK(!cc_process_args(orig, &preprocessed, NULL, &compiler));
        CHECK_INT_EQ(1, stats_get_pending(STATS_PREPROCESSING));
 
        args_free(orig);
@@ -80,7 +80,7 @@ TEST(dash_M_should_be_unsupported)
        struct args *preprocessed, *compiler;
 
        create_file("foo.c", "");
-       CHECK(!cc_process_args(orig, &preprocessed, &compiler));
+       CHECK(!cc_process_args(orig, &preprocessed, NULL, &compiler));
        CHECK_INT_EQ(1, stats_get_pending(STATS_UNSUPPORTED_OPTION));
 
        args_free(orig);
@@ -98,7 +98,7 @@ TEST(dependency_flags_should_only_be_sent_to_the_preprocessor)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -123,7 +123,7 @@ TEST(cpp_only_flags_to_preprocessor_if_run_second_cpp_is_false)
        create_file("foo.c", "");
 
        conf->run_second_cpp = false;
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -149,7 +149,7 @@ TEST(cpp_only_flags_to_preprocessor_and_compiler_if_run_second_cpp_is_true)
        create_file("foo.c", "");
 
        conf->run_second_cpp = true;
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -166,7 +166,52 @@ TEST(dependency_flags_that_take_an_argument_should_not_require_space_delimiter)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
+       CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
+       CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
+
+       args_free(orig);
+}
+
+TEST(MQ_flag_should_not_be_added_for_standard_obj_extension)
+{
+       struct args *orig = args_init_from_string("cc -c -MD foo.c -o foo.o");
+       struct args *exp_cpp = args_init_from_string("cc -MD -MF foo.d");
+       struct args *exp_cc = args_init_from_string("cc -c");
+       struct args *act_cpp = NULL, *act_cc = NULL;
+       create_file("foo.c", "");
+
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
+       CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
+       CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
+
+       args_free(orig);
+}
+
+TEST(MQ_flag_should_be_added_for_non_standard_obj_extension)
+{
+       struct args *orig = args_init_from_string("cc -c -MD foo.c -o foo.obj");
+       struct args *exp_cpp = args_init_from_string("cc -MD -MF foo.d -MQ foo.obj");
+       struct args *exp_cc = args_init_from_string("cc -c");
+       struct args *act_cpp = NULL, *act_cc = NULL;
+       create_file("foo.c", "");
+
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
+       CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
+       CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
+
+       args_free(orig);
+}
+
+TEST(equal_sign_after_MF_should_be_removed)
+{
+       struct args *orig = args_init_from_string("cc -c -MF=path foo.c -o foo.o");
+       struct args *exp_cpp = args_init_from_string("cc -MFpath");
+       struct args *exp_cc = args_init_from_string("cc -c");
+       struct args *act_cpp = NULL, *act_cc = NULL;
+       create_file("foo.c", "");
+
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -188,7 +233,7 @@ TEST(sysroot_should_be_rewritten_if_basedir_is_used)
        orig = args_init_from_string(arg_string);
        free(arg_string);
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_STR_EQ(act_cpp->argv[1], "--sysroot=./foo/bar");
 
        args_free(orig);
@@ -211,7 +256,7 @@ TEST(sysroot_with_separate_argument_should_be_rewritten_if_basedir_is_used)
        orig = args_init_from_string(arg_string);
        free(arg_string);
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_STR_EQ(act_cpp->argv[1], "--sysroot");
        CHECK_STR_EQ(act_cpp->argv[2], "./foo");
 
@@ -230,7 +275,7 @@ TEST(MF_flag_with_immediate_argument_should_work_as_last_argument)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -247,7 +292,7 @@ TEST(MT_flag_with_immediate_argument_should_work_as_last_argument)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -264,7 +309,7 @@ TEST(MQ_flag_with_immediate_argument_should_work_as_last_argument)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -281,7 +326,7 @@ TEST(MQ_flag_without_immediate_argument_should_not_add_MQobj)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -298,7 +343,7 @@ TEST(MT_flag_without_immediate_argument_should_not_add_MTobj)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -315,7 +360,7 @@ TEST(MQ_flag_with_immediate_argument_should_not_add_MQobj)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -332,7 +377,7 @@ TEST(MT_flag_with_immediate_argument_should_not_add_MQobj)
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -359,7 +404,7 @@ TEST(fprofile_flag_with_existing_dir_should_be_rewritten_to_real_path)
        args_add(exp_cc, "-c");
        free(s);
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -378,7 +423,7 @@ TEST(fprofile_flag_with_nonexistent_dir_should_not_be_rewritten)
 
        create_file("foo.c", "");
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -400,7 +445,7 @@ TEST(isystem_flag_with_separate_arg_should_be_rewritten_if_basedir_is_used)
        orig = args_init_from_string(arg_string);
        free(arg_string);
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_STR_EQ("./foo", act_cpp->argv[2]);
 
        args_free(orig);
@@ -426,7 +471,7 @@ TEST(isystem_flag_with_concat_arg_should_be_rewritten_if_basedir_is_used)
        orig = args_init_from_string(arg_string);
        free(arg_string);
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_STR_EQ("-isystem./foo", act_cpp->argv[1]);
 
        free(cwd);
@@ -453,7 +498,7 @@ TEST(I_flag_with_concat_arg_should_be_rewritten_if_basedir_is_used)
        orig = args_init_from_string(arg_string);
        free(arg_string);
 
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_STR_EQ("-I./foo", act_cpp->argv[1]);
 
        free(cwd);
@@ -471,7 +516,7 @@ TEST(debug_flag_order_with_known_option_first)
        struct args *act_cc = NULL;
 
        create_file("foo.c", "");
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -487,7 +532,7 @@ TEST(debug_flag_order_with_known_option_last)
        struct args *act_cc = NULL;
 
        create_file("foo.c", "");
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
@@ -499,14 +544,19 @@ TEST(options_not_to_be_passed_to_the_preprocesor)
        struct args *orig = args_init_from_string(
                "cc -Wa,foo foo.c -g -c -DX -Werror -Xlinker fie -Xlinker,fum -Wno-error");
        struct args *exp_cpp = args_init_from_string("cc -g -DX");
+       struct args *exp_extra =
+               args_init_from_string(
+                       " -Wa,foo -Werror -Xlinker fie -Xlinker,fum -Wno-error");
        struct args *exp_cc = args_init_from_string(
                "cc -g -Wa,foo -Werror -Xlinker fie -Xlinker,fum -Wno-error -DX -c");
        struct args *act_cpp = NULL;
+       struct args *act_extra = NULL;
        struct args *act_cc = NULL;
 
        create_file("foo.c", "");
-       CHECK(cc_process_args(orig, &act_cpp, &act_cc));
+       CHECK(cc_process_args(orig, &act_cpp, &act_extra, &act_cc));
        CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
+       CHECK_ARGS_EQ_FREE12(exp_extra, act_extra);
        CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
 
        args_free(orig);