Joel Rosdahl [Wed, 28 Sep 2016 20:17:16 +0000 (22:17 +0200)]
Disable direct mode for "-Wp," with multiple preprocessor options
This fixes a regression in ccache 3.2.8/3.3.1 (commit 026ba6b9): ccache
could get confused when using the compiler option -Wp, to pass multiple
options to the preprocessor, resulting in missing dependency files from
direct mode cache hits.
Joel Rosdahl [Wed, 7 Sep 2016 18:46:18 +0000 (20:46 +0200)]
Only pass -Wp,-MT and similar to the preprocessor
This fixes an issue when compiler option -Wp,-MT,path is used instead of
-MT path (and similar for -MF, -MP and -MQ) and run_second_cpp
(CCACHE_CPP2) is enabled.
Anders Björklund [Thu, 14 Jul 2016 21:22:25 +0000 (23:22 +0200)]
Make sure to hash the trailing quote when skipping
Turns out that 3.2-maint hashes preprocessor output a bit differently,
so the workaround for skipping certain lines was broken in backport.
When skipping the "extra line", the trailing quotes were missing from
the output causing the hash to be different from the normal output.
Joel Rosdahl [Tue, 12 Jul 2016 19:14:01 +0000 (21:14 +0200)]
Merge branch '3.1-maint' into 3.2-maint
* 3.1-maint:
Prepare for v3.1.12
Disable mingw32 build on v3.1.x
Add .travis.yml
Mark 3.1.12 as still unreleased
Prepare for v3.1.12
Don't rewrite source file path if it's absolute and a symlink
Anders Björklund [Sun, 26 Jun 2016 21:03:59 +0000 (23:03 +0200)]
Work around preprocessor bugs in gcc version 6
Before hashing the output of the preprocessor (gcc -E):
- Ignore extra line `# 31 "<command-line>"` completely.
- Replace `# 32 "<command-line>" 2` with the regular # 1.
For some reason this only happens with gcc without macros.
Matthias Kretz [Fri, 30 Oct 2015 15:53:37 +0000 (16:53 +0100)]
Pass -stdlib= only to preprocessor
Clang warns about an unused -stdlib=libc++ argument if the argument is
passed to the second clang invocation. The -stdlib= argument is only
necessary on preprocessing (to set the system include paths) and on
linking (which is not cached anyway)
Joel Rosdahl [Sat, 29 Aug 2015 16:09:37 +0000 (18:09 +0200)]
Improve signal handling
* Block signals while manipulating data read by the signal handler.
* If ccache receives SIGTERM, kill compiler as well. (Other signals like
SIGINT are sent to the whole process group.)
* Die appropriately at the end of the signal handler by resending the
signal instead of exiting.
Joel Rosdahl [Mon, 17 Aug 2015 17:05:14 +0000 (19:05 +0200)]
Fix regression in recent change related to zlib in nonstandard location
To allow for specifying a -L flag in LDFLAGS and have it take effect for
-lz, 0220de9c8ebfb18caae2ac1aa163d060e98ceade put -lz in extra_libs
instead of extra_ldflags. However, extra_libs is supposed to contain
paths to libraries which are prerequisites of the ccache link rule, and
some older versions of make got confused by seeing -lz as a
prerequisite.
Joel Rosdahl [Sun, 9 Aug 2015 20:07:11 +0000 (22:07 +0200)]
Exit properly from exit handler
This fixes a problem where two SIGINT (Ctrl+C) signals were needed to
terminate an ongoing compilation. (The first SIGINT terminated the
compiler which exited with non-zero status, which ccache then went on
interpreting as an ordinary failed compilation, leading to rerunning the
compiler via failed().)
Store the coverage notes (.gcno file) in the cache, next to the object.
If called on a file without actual code, like a header, then generate an
empty file in the cache to be able to separate this case from file missing.
Newer versions of gcc will generate a small file instead of not generating.
In the object file generated with -fprofile-arcs, the runtime output file
for the coverage data (.gcda file) is created from the output filename.
Make sure to hash this path to avoid cache hits with another absolute path.
Also make sure to use the source file path, since this is in the notes.