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.
David Givone [Mon, 10 Sep 2012 00:28:37 +0000 (17:28 -0700)]
Only clean dist generate targets when using distclean
Some file are only generated when making a distribute, such as docs, and should
only be cleaned when using the distclean target. If we clean the docs with the
normal clean target then when using the Makefile with the distributed source
code will lead to an error if you configure, make, make clean, and then make
again.
David Givone [Mon, 3 Sep 2012 22:09:52 +0000 (15:09 -0700)]
Improve dev.mk to be more platform independent
The dev.mk was improved to allow for the make dist to work on mac os x:
1) asciidoc may not always be install to /etc, so also check /usr/local/etc
2) --parents parameter for cp does not work on mac so use rsync --relative
3) replaced -a tar flag with somesomething that should work across
platforms
Alfred Landrum [Fri, 7 Sep 2012 18:39:26 +0000 (20:39 +0200)]
Handle EAGAIN during copy_fd
In util.c, write may return EAGAIN if the file descriptor is a full pipe.
Currently, if this occurs, the log message "ccache: FATAL: Failed to copy fd"
is printed and ccache exits. We've seen this locally when the recorded stderr
output was exceptionally large due to many compilation warnings.
Boie, Andrew P [Mon, 6 Aug 2012 23:30:55 +0000 (16:30 -0700)]
add support for '@' parameters
These indicate to the compiler that additional command line options
should be read from a text file. If encountered, read the file,
tokenize any arguments, and if any are found, do an in-place replacement
of the '@' parameter with the arguments within the file.
args_insert() added to insert a set of arguments into a position within
another set of arguments.
args_init_from_gcc_atfile() reads and processes the argument files using the
quoting/escape conventions that GCC expects.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Boie, Andrew P [Tue, 31 Jul 2012 00:50:33 +0000 (17:50 -0700)]
add support for '@' parameters
These indicate to the compiler that additional command line options
should be read from a text file. If encountered, read the file,
tokenize any arguments, and if any are found, do an in-place replacement
of the '@' parameter with the arguments within the file.
args_insert() added to insert a set of arguments into a position within
another set of arguments.
args_init_from_string() has been improved so that any character may be
included by prefixing that character with a backslash, and support for
quoted arguments which pass special characters within the quotation marks
unmodified.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Joel Rosdahl [Sun, 29 Jul 2012 21:27:31 +0000 (23:27 +0200)]
Merge branch 'maint'
* maint:
Simplify generation of relative automatic dependency target
Minor code cleanup
Add test for rewriting of absolute dependency arguments
Make dependency arguments relative to increase cache hits
Correct doc string of make_relative_path