Joel Rosdahl [Sun, 8 Jun 2014 15:29:44 +0000 (17:29 +0200)]
Create destination file and then copy into cache instead of the opposite
This simplifies the code so that there is no special case kicking in when
using --serialize-diagnostics (which requires the "-o" option to refer to
the destination instead of a temporary file in the cache).
Joel Rosdahl [Wed, 14 May 2014 20:03:53 +0000 (22:03 +0200)]
Merge branch 'maint'
* maint:
Fix clang build warning "shift count >= width of type"
Clean up stale files in internal tempdir once an hour
Add signal handler to clean up temporary files at unexpected program exit
Don't needlessly allocate empty counter_updates data in stats_flush()
Joel Rosdahl [Tue, 15 Apr 2014 20:31:21 +0000 (22:31 +0200)]
Merge branch 'maint'
* maint:
manifest file_info fix
Clean up dead code flagged by cppcheck and clang-analyzer
Mark fatal() with __attribute__((noreturn)) to please clang-analyzer
Fix bug in common_dir_prefix_length
Joel Rosdahl [Wed, 8 Jan 2014 20:28:40 +0000 (21:28 +0100)]
Merge branch 'maint'
* maint:
Require CCACHE_SLOPPINESS=pch_defines,time_macros opt-in to enable PCH handling
doc: Mention that --ccache-skip currently does not mean "skip hashing option"
Don't hash compiler option -fdebug-prefix-map=
Joel Rosdahl [Wed, 8 Jan 2014 20:13:22 +0000 (21:13 +0100)]
Require CCACHE_SLOPPINESS=pch_defines,time_macros opt-in to enable PCH handling
The background is that since ccache runs the preprocessor on the header to
be precompiled, the preprocessor removes #defines and ccache then hashes
the output, which means that changes in #defines are not detected even
though the resulting .gch file will have different behavior.
Joel Rosdahl [Thu, 8 Aug 2013 20:47:43 +0000 (22:47 +0200)]
Merge branch 'maint'
* maint:
Bail out on option -gsplit-dwarf which produces multiple output files
Treat zero length object files as invalid
Fix path canonicalization in make_relative_path when path doesn't exist
Handle some dirname() special cases as expected
Correct make_relative_path comment
Joel Rosdahl [Sat, 2 Mar 2013 20:17:17 +0000 (21:17 +0100)]
Include manifest version in the direct mode hash
This makes manifest file names unique per manifest version, thus avoiding
ccache versions with different manifest versions overwriting each other's
manifests.
Justin Lebar [Tue, 25 Dec 2012 04:09:38 +0000 (23:09 -0500)]
Allow mtime- and ctime-only matches.
If CCACHE_SLOPPINESS includes "file_stat_matches", ccache will consider
two files which match in name, size, mtime, and ctime to have the same
contents. This allows ccache to avoid reading the file, thus speeding
up cache hits.
David Givone [Wed, 30 Jan 2013 07:59:22 +0000 (23:59 -0800)]
Fix compile error with Xcode 4.6
static function ... is used in an inline function with external linkage
[-Werror,-Wstatic-in-inline] use 'static' to give inline function ... internal
linkage
David Givone [Mon, 7 Jan 2013 06:20:24 +0000 (22:20 -0800)]
Change -x language option to use new objective c standard for gcc and clang
When preprocessing objective-c[++] files, use -x objective-c-cpp-output or
-x objective-c++-cpp-output which is supported by gcc 4.0+ and clang.
Previously, -x objc-cpp-output or -x objc++-cpp-output was used, but not
supported by clang.
Andrew Stubbs [Tue, 1 Jan 2013 17:12:58 +0000 (18:12 +0100)]
Speed up copy4 and copy64 on little-endian systems
The copy64 function implements an endian-safe copy routine for an array of
16 32-bit integers, but this is sub-optimal on machines where the
byte-order is already correct. Likewise for copy4.
This patch replaces the implementation with a simple memcpy when
appropriate, and retains the old implementation otherwise.
Note that the compiler will always inline calls to memcpy for small
byte-counts, so this is a big win.
David Givone [Sat, 10 Nov 2012 17:43:11 +0000 (09:43 -0800)]
Add support for clang pth files
* ccache will now recognize pth (pretokenized header) files that are used by clang and xcode
* added/fixed pch tests for clang by separating tests for gcc and clang
David Givone [Mon, 10 Sep 2012 00:08:15 +0000 (17:08 -0700)]
Don't pass preprocessor options to compiler during second compilation phase
Fix for bug 8118.
Some (ie clang) give warnings for unused arguments. Arguments that are only
used during the preprocessing phase will cause warnings during the
compilation phase.
Andrew Stubbs [Tue, 9 Oct 2012 14:17:19 +0000 (15:17 +0100)]
Detect __DATE__ and __TIME__ correctly
The code to detect __DATE__ and __TIME__ was off-by-one, and therefore
totally failed to detect time macros unless by chance alignments (1 in eight
macros might be correctly aligned).
The problem is that the code expects that 'i' will point to the last
underscore, and the skip table expects 'i' to point to the point after
the end of the string. For example, if str[i] == 'E' then the skip table
moves 'i' on 3 bytes, whereas the code only works with a 2-byte skip.
I've corrected the problem by adjusting the table to match the code.
I've confirmed the tests still pass.
Signed-off-by: Andrew Stubbs <ams@codesourcery.com>
David Givone [Sun, 9 Sep 2012 23:55:37 +0000 (16:55 -0700)]
Add object file comparison check for numerous tests
Comparing the output of ccache and direct compilation is a useful check to
make sure we are creating the same object file. It is especially useful
when performing 2 stage compilation like ccache does when CCACHE_CPP2 is
not set.
Andrew Stubbs [Mon, 10 Sep 2012 13:57:23 +0000 (14:57 +0100)]
Fix bug testing with ecryptfs
The test script assumes that zero-length files take up zero disk space,
that the block size is 4k, and that the disk usage will be the file size
rounded up to the nearest block size. Unfortunately these were not true for
ecryptfs.
Additionally, running the test.sh from another directory did not work due
to a bad location assumption in another test.