Skip to content

Commit

Permalink
bug 1506848 - switch Windows debug flags from -Zi to -Z7. r=nalexander
Browse files Browse the repository at this point in the history
We default to -Zi for Windows debug flags, which is for generating debug info
into a PDB file, but clang-cl doesn't actually implement that so -Zi is
an alias for -Z7 in clang-cl:
http://clang.llvm.org/docs/UsersManual.html#id9

sccache has special handling for -Zi because multiple compiles writing
to the same PDB file is not cacheable, so we've always overridden -Zi with -Z7
in CI when using sccache.

Given that everyone should be using clang-cl nowadays and MSVC will no longer
be supported soon, this patch changes the default and removes some PDB
file name flag setting from rules.mk, as well as the no-longer-necessary
overrides from mozconfig.cache.

Differential Revision: https://phabricator.services.mozilla.com/D18264

--HG--
extra : moz-landing-system : lando
  • Loading branch information
luser committed Feb 1, 2019
1 parent 33dd1d5 commit 8a4288a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ def check_have_64_bit(have_64_bit, compiler_have_64_bit):
def default_debug_flags(compiler_info, target):
# Debug info is ON by default.
if compiler_info.type in ('msvc', 'clang-cl'):
return '-Zi'
return '-Z7'
elif target.kernel == 'WINNT' and compiler_info.type == 'clang':
return '-g -gcodeview'
return '-g'
Expand Down
9 changes: 0 additions & 9 deletions build/mozconfig.cache
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,4 @@ if test -n "$bucket"; then
export CCACHE="$topsrcdir/sccache2/sccache${suffix}"
export SCCACHE_VERBOSE_STATS=1
mk_add_options MOZBUILD_MANAGE_SCCACHE_DAEMON=${topsrcdir}/sccache2/sccache
case "$platform" in
win*)
# 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"
;;
esac
fi
17 changes: 1 addition & 16 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,11 @@ LINK_PDBFILE ?= $(basename $(@F)).pdb

ifndef GNU_CC

#
# Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
# directory. For parallel builds, this PDB file is shared and locked by
# MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
# without SP1, don't do parallel builds.
#
# The final PDB for libraries and programs is created by the linker and uses
# a different name from the single PDB file created by the compiler. See
# bug 462740.
#

ifdef SIMPLE_PROGRAMS
COMPILE_PDB_FLAG ?= -Fd$(basename $(@F)).pdb
else
COMPILE_PDB_FLAG ?= -Fdgenerated.pdb -FS
endif
COMPILE_CFLAGS += $(COMPILE_PDB_FLAG)
COMPILE_CXXFLAGS += $(COMPILE_PDB_FLAG)
endif

ifdef MOZ_DEBUG
CODFILE=$(basename $(@F)).cod
Expand All @@ -166,8 +153,6 @@ endif
ifeq ($(HOST_OS_ARCH),WINNT)
HOST_PDBFILE=$(basename $(@F)).pdb
HOST_PDB_FLAG ?= -Fd$(HOST_PDBFILE)
HOST_CFLAGS += $(HOST_PDB_FLAG)
HOST_CXXFLAGS += $(HOST_PDB_FLAG)
HOST_C_LDFLAGS += $(HOST_PDB_FLAG)
HOST_CXX_LDFLAGS += $(HOST_PDB_FLAG)
endif
Expand Down

0 comments on commit 8a4288a

Please sign in to comment.