<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>
<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
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@
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
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.
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
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
# 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
$(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 $<
* David Givone
* Doug Anderson
* Edward Z. Yang
+* Erik Johansson
* Francois Marier
* Gabriel Scherer
* Geert Bosch
<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>
</li>\r
<li>\r
<p>\r
+Erik Johansson\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
Francois Marier\r
</p>\r
</li>\r
<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
<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>
<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
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
<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>
</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
<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
<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
<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
<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
<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
</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
</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
</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
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 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
<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
<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
</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
<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
<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
<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
<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
</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
<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
</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
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_21">Bug fixes</h3>\r
+<h3 id="_bug_fixes_22">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 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
</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
<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
<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
</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
<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
</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
<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
</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
</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
<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
<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
<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
<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
</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
<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
</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
<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
.\" 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
.\" -----------------------------------------------------------------
// 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;
{
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;
}
}
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);
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) {
}
// 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;
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.
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);
}
*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);
// 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");
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);
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");
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);
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);
return mf;
error:
- if (!errmsg) {
+ if (!*errmsg) {
*errmsg = x_strdup("Corrupt manifest file");
}
free_manifest(mf);
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
-extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "3.7.4";
+extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "3.7.5";
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"
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);
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);
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);
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);
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);
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);
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);
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");
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);
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);
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);
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);
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);
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);
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_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);
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);
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);
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);
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);
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);
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);
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);