bug 1318370 - stop using -Z7 for MSVC compilation with sccache. r=glandium
☠☠ backed out by a180b976c165 ☠ ☠
authorTed Mielczarek <ted@mielczarek.org>
Wed, 14 Dec 2016 14:58:26 -0500
changeset 393030 0848b3201c40dd75711aeb24d3ab7ca72a351eef
parent 393029 f135648694f203a184f1684424bcfb87ee3ad773
child 393031 a8032ae9cb2ad1c4574c6ac6f5c2778863cd71e0
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1318370 - stop using -Z7 for MSVC compilation with sccache. r=glandium We've been using -Z7 to make MSVC emit CodeView debug info directly in the object files instead of in PDB files because sccache can't cache PDB files if the same one is written to by multiple compiles, which was previously happening in our build system, and was hard to override in the NSS build. Now that those are fixed this should work fine. This adds a bit to the compile rule to remove the PDB file before compilation, since sccache won't cache a compilation if the PDB file it is supposed to generate already exists (for the aforementioned reason). MozReview-Commit-ID: rFlX0XfTGw
--- a/build/mozconfig.cache
+++ b/build/mozconfig.cache
@@ -126,18 +126,13 @@ else
     case "$platform" in
         # sccache supports a special flag to create depfiles.
         #TODO: bug 1318370 - move this all into toolchain.configure
         export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
         # Windows builds have a default wrapper that needs to be overridden
         mk_add_options "export CC_WRAPPER="
         mk_add_options "export CXX_WRAPPER="
-        # For now, sccache doesn't support separate PDBs so force debug info to be
-        # in object files.
-        mk_add_options "export COMPILE_PDB_FLAG="
-        mk_add_options "export HOST_PDB_FLAG="
-        mk_add_options "export MOZ_DEBUG_FLAGS=-Z7"
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -151,16 +151,20 @@ endif # FORCE_SHARED_LIB
 endif # LIBRARY
 ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CC
 COMPILE_PDB_FLAG ?= -Fd$(basename $(@F)).pdb
+# We remove the PDB file before compilation so that sccache knows it's safe to cache.
+RM_PDB_FILE = -$(RM) $(basename $(@F)).pdb
 LINK_PDBFILE ?= $(basename $(@F)).pdb
 ifdef MOZ_DEBUG
 CODFILE=$(basename $(@F)).cod
 ifdef DEFFILE
 OS_LDFLAGS += -DEF:$(call normalizepath,$(DEFFILE))
@@ -845,33 +849,38 @@ crate_src_libdep = $(call mk_global_crat
 $(foreach f,$(RSSRCS),$(eval $(call src_libdep,$(f))))
 $(foreach f,$(RS_STATICLIB_CRATE_SRC),$(eval $(call crate_src_libdep,$(f))))
 # Rules for building native targets must come first because of the host_ prefix
 	$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)
 # DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
 # 'moc' only knows about #defines it gets on the command line (-D...), not in
 # included headers like mozilla-config.h
 $(filter moc_%.cpp,$(CPPSRCS)): moc_%.cpp: %.h
@@ -993,24 +1002,27 @@ endif # MOZ_RUST
 	$(AS) -o $@ $(DEFINES) $(ASFLAGS) $($(notdir $<)_FLAGS) $(LOCAL_INCLUDES) -c $<
 	$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)
 	$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)
 	$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)
 $(filter %.s,$(CPPSRCS:%.cpp=%.s)): %.s: %.cpp $(call mkdir_deps,$(MDDEPDIR))
 	$(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)
 $(filter %.s,$(CPPSRCS:%.cc=%.s)): %.s: %.cc $(call mkdir_deps,$(MDDEPDIR))