summaryrefslogtreecommitdiffstats
path: root/core/combo
diff options
context:
space:
mode:
authorAndrew Boie <andrew.p.boie@intel.com>2012-08-13 13:45:50 -0700
committerAndrew Boie <andrew.p.boie@intel.com>2012-08-16 11:11:29 -0700
commit1f93043c86901cdd3e0852102aa5b74e93178e47 (patch)
tree047aead01d7aaca54882d6eff43b671c75746a40 /core/combo
parent20e713d151dde66058453ec822b6bca8793008a4 (diff)
downloadbuild-1f93043c86901cdd3e0852102aa5b74e93178e47.zip
build-1f93043c86901cdd3e0852102aa5b74e93178e47.tar.gz
build-1f93043c86901cdd3e0852102aa5b74e93178e47.tar.bz2
select.mk: Tune ccache options
With these adjustments, cached object files can now be shared across multiple Android trees on a single workstation: * Compiler binary modification time no longer causes cache misses, as a hash of the compiler binary is taken rather than looking at the mtime and size * Header file modification time no longer causes cache misses, the headers are now always hashed * Macros such as __DATE__ and __TIME__ no longer cause cache misses * All paths in preprocessed source (due to use of -g) are now relative These options require ccache 3.1 or later to be used; ccache 2.4 will ignore these. Change-Id: I7839637e9dacf7240bd9b7bfaa6406b1db423560 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Diffstat (limited to 'core/combo')
-rw-r--r--core/combo/select.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/combo/select.mk b/core/combo/select.mk
index 803cfc0..e485d00 100644
--- a/core/combo/select.mk
+++ b/core/combo/select.mk
@@ -60,6 +60,23 @@ $(combo_target)STATIC_LIB_SUFFIX := .a
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
ifneq ($(USE_CCACHE),)
+ # The default check uses size and modification time, causing false misses
+ # since the mtime depends when the repo was checked out
+ export CCACHE_COMPILERCHECK := content
+
+ # See man page, optimizations to get more cache hits
+ # implies that __DATE__ and __TIME__ are not critical for functionality.
+ # Ignore include file modification time since it will depend on when
+ # the repo was checked out
+ export CCACHE_SLOPPINESS := time_macros,include_file_mtime,file_macro
+
+ # Turn all preprocessor absolute paths into relative paths.
+ # Fixes absolute paths in preprocessed source due to use of -g.
+ # We don't really use system headers much so the rootdir is
+ # fine; ensures these paths are relative for all Android trees
+ # on a workstation.
+ export CCACHE_BASEDIR := /
+
CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
# If we are cross-compiling Windows binaries on Linux
# then use the linux ccache binary instead.