diff options
Diffstat (limited to 'core/ccache.mk')
-rw-r--r-- | core/ccache.mk | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/core/ccache.mk b/core/ccache.mk index d67bce6c7b..d10aceb01c 100644 --- a/core/ccache.mk +++ b/core/ccache.mk @@ -14,39 +14,48 @@ # limitations under the License. # +# We no longer provide a ccache prebuilt. +# +# Ours was old, and had a number of issues that triggered non-reproducible +# results and other failures. Newer ccache versions may fix some of those +# issues, but at the large scale of our build servers, we weren't seeing +# significant performance gains from using ccache -- you end up needing very +# good locality and/or very large caches if you're building many different +# configurations. +# +# Local no-change full rebuilds were showing better results, but why not just +# use incremental builds at that point? +# +# So if you still want to use ccache, continue setting USE_CCACHE, but also set +# the CCACHE_EXEC environment variable to the path to your ccache executable. +ifneq ($(CCACHE_EXEC),) ifneq ($(filter-out false,$(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 + 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 + 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_BASEDIR := / # Workaround for ccache with clang. # See http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html - export CCACHE_CPP2 := true + CCACHE_CPP2 := true - CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG) - ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache - # Check that the executable is here. - ccache := $(strip $(wildcard $(ccache))) - ifdef ccache - ifndef CC_WRAPPER - CC_WRAPPER := $(ccache) - endif - ifndef CXX_WRAPPER - CXX_WRAPPER := $(ccache) - endif - ccache = + ifndef CC_WRAPPER + CC_WRAPPER := $(CCACHE_EXEC) endif + ifndef CXX_WRAPPER + CXX_WRAPPER := $(CCACHE_EXEC) + endif +endif endif |