summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/make
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-01-25 18:01:27 +0000
committerVedant Kumar <vsk@apple.com>2018-01-25 18:01:27 +0000
commit801362f067ae8875c070cc2bfdbee512cadebab4 (patch)
tree1fcc141215b1785cbc588612e615b19fc53d78aa /lldb/packages/Python/lldbsuite/test/make
parentdb9dd5b43ecf066eea1f57569f230ee018cae0e6 (diff)
downloadbcm5719-llvm-801362f067ae8875c070cc2bfdbee512cadebab4.tar.gz
bcm5719-llvm-801362f067ae8875c070cc2bfdbee512cadebab4.zip
Use test-specific module caches to avoid stale header conflicts
Stale global module caches cause problems for the bots. The modules become invalid when clang headers are updated by version control, and tests which use these modules fail to compile, e.g: fatal error: file '.../__stddef_max_align_t.h' has been modified since the module file '/var/.../Darwin.pcm' was built note: please rebuild precompiled header '/var/.../Darwin.pcm' Eventually we should transition to having just a single module cache to speed tests up. This patch should be just enough to fix the spurious bot failures due to stale caches. rdar://36479805, also related to llvm.org/PR36048 Differential Revision: https://reviews.llvm.org/D42277 llvm-svn: 323450
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/make')
-rw-r--r--lldb/packages/Python/lldbsuite/test/make/Makefile.rules12
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 4870cd95f80..f59f486dd7f 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -237,13 +237,15 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
endif
+CLANG_MODULE_CACHE_DIR := module-cache
+
+MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules -fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)
+
ifeq "$(MAKE_GMODULES)" "YES"
- CFLAGS += -fmodules -gmodules
+ CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
endif
-CXXFLAGS += -std=c++11
-# FIXME: C++ modules aren't supported on all platforms.
-CXXFLAGS += $(subst -fmodules,, $(CFLAGS))
+CXXFLAGS += -std=c++11 $(CFLAGS)
LD = $(CC)
LDFLAGS ?= $(CFLAGS)
LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS)
@@ -636,7 +638,7 @@ endif
dsym: $(DSYM)
all: $(EXE) $(DSYM)
clean::
- $(RM) $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(DWOS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS)
+ $(RM) -rf $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(DWOS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) $(CLANG_MODULE_CACHE_DIR)
ifneq "$(DYLIB_NAME)" ""
$(RM) -r $(DYLIB_FILENAME).dSYM
$(RM) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_PREREQS:.d=.d.tmp) $(DYLIB_DWOS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).debug
OpenPOWER on IntegriCloud