aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/ccache_flag.go
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2020-03-13 11:05:26 -0700
committerManoj Gupta <manojgupta@chromium.org>2020-03-13 21:57:55 +0000
commit28979264d4c945fcd9a3f09b385a7b67f051419f (patch)
tree3b6b4df4b4058d3286dcc5230bca3f3e5c8b7ea5 /compiler_wrapper/ccache_flag.go
parent99b3ff928b1c000980d331f30174614484095d37 (diff)
downloadtoolchain-utils-28979264d4c945fcd9a3f09b385a7b67f051419f.tar.gz
compiler_wrapper: Stop setting CCACHE_BASEDIR
CCACHE_BASEDIR used to be set to sysroot so that ccache can reuse compilation results across different boards. This is not useful on builders and also less useful for board builds since we set closer to target CFLAGS now. It also breaks use of -fmacro-prefix-map option in clang/gcc. So rip it out and simplify the rest of code. BUG=chromium:983759 TEST=go test Change-Id: Ia99ca994c976ee1137c3d904a78f7e25931c70f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2103170 Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/ccache_flag.go')
-rw-r--r--compiler_wrapper/ccache_flag.go22
1 files changed, 3 insertions, 19 deletions
diff --git a/compiler_wrapper/ccache_flag.go b/compiler_wrapper/ccache_flag.go
index 312d0f02..265b8fc2 100644
--- a/compiler_wrapper/ccache_flag.go
+++ b/compiler_wrapper/ccache_flag.go
@@ -4,7 +4,7 @@
package main
-func processCCacheFlag(sysroot string, builder *commandBuilder) {
+func processCCacheFlag(builder *commandBuilder) {
// We should be able to share the objects across compilers as
// the pre-processed output will differ. This allows boards
// that share compiler flags (like x86 boards) to share caches.
@@ -20,24 +20,8 @@ func processCCacheFlag(sysroot string, builder *commandBuilder) {
})
if builder.cfg.useCCache && useCCache {
- // We need to get ccache to make relative paths from within the
- // sysroot. This lets us share cached files across boards (if
- // all other things are equal of course like CFLAGS) as well as
- // across versions. A quick test is something like:
- // $ export CFLAGS='-O2 -g -pipe' CXXFLAGS='-O2 -g -pipe'
- // $ BOARD=x86-alex
- // $ cros_workon-$BOARD stop cros-disks
- // $ emerge-$BOARD cros-disks
- // $ cros_workon-$BOARD start cros-disks
- // $ emerge-$BOARD cros-disks
- // $ BOARD=amd64-generic
- // $ cros_workon-$BOARD stop cros-disks
- // $ emerge-$BOARD cros-disks
- // $ cros_workon-$BOARD start cros-disks
- // $ emerge-$BOARD cros-disks
- // All of those will get cache hits (ignoring the first one
- // which will seed the cache) due to this setting.
- builder.updateEnv("CCACHE_BASEDIR=" + sysroot)
+ // Note: we used to also set CCACHE_BASEDIR but don't do it
+ // anymore for reasons outlined in crrev.com/c/2103170.
if _, present := builder.env.getenv("CCACHE_DISABLE"); present {
// Portage likes to set this for us when it has FEATURES=-ccache.
// The other vars we need to setup manually because of tools like