From ec65f12dd8746fdecc40c5052686a1db6bf5e576 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 8 Mar 2016 14:07:28 -0800 Subject: [PATCH] Bug 623183 - Build dump_syms on Windows when using VS2015; r=ted MozReview-Commit-ID: LCvipO5FXdR --HG-- extra : source : e68a8c608182025bac53dcbb48b0c0d474931f90 extra : amend_source : 3113865fb4be93db6b51ce55514cd2a55e577df9 --- Makefile.in | 4 +++ old-configure.in | 4 +++ .../src/tools/windows/dump_syms/moz.build | 31 +++++++++++++++++++ toolkit/crashreporter/moz.build | 7 +++-- .../crashreporter/tools/unit-symbolstore.py | 17 ++++++---- 5 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build diff --git a/Makefile.in b/Makefile.in index a7c3d47560c2..9e460ec8efc6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -249,7 +249,11 @@ MAKE_SYM_STORE_ARGS := -c --vcs-info ifdef PDBSTR_PATH MAKE_SYM_STORE_ARGS += -i endif +ifdef MSVC_HAS_DIA_SDK +DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms.exe +else DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).exe +endif # PDB files don't get moved to dist, so we need to scan the whole objdir MAKE_SYM_STORE_PATH := . endif diff --git a/old-configure.in b/old-configure.in index e18a750d41ef..dbd24ec22a5c 100644 --- a/old-configure.in +++ b/old-configure.in @@ -475,6 +475,9 @@ case "$target" in MSVC_C_RUNTIME_DLL=vcruntime140.dll MSVC_CXX_RUNTIME_DLL=msvcp140.dll + MSVC_HAS_DIA_SDK=1 + AC_DEFINE(MSVC_HAS_DIA_SDK) + # -Wv:18 disables all warnings introduced after VS2013 # See http://blogs.msdn.com/b/vcblog/archive/2014/11/12/improvements-to-warnings-in-the-c-compiler.aspx CFLAGS="$CFLAGS -Wv:18" @@ -505,6 +508,7 @@ You must install Visual C++ 2013 Update 3, Visual C++ 2015 Update 1, or newer in See https://developer.mozilla.org/en/Windows_Build_Prerequisites.]) fi AC_SUBST(MSVS_VERSION) + AC_SUBST(MSVC_HAS_DIA_SDK) AC_SUBST(MSVC_C_RUNTIME_DLL) AC_SUBST(MSVC_CXX_RUNTIME_DLL) diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build new file mode 100644 index 000000000000..6220ae3cf6b6 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build @@ -0,0 +1,31 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +HostProgram('dump_syms') + +HOST_SOURCES += [ + '../../../common/windows/dia_util.cc', + '../../../common/windows/guid_string.cc', + '../../../common/windows/omap.cc', + '../../../common/windows/pdb_source_line_writer.cc', + '../../../common/windows/string_utils.cc', + 'dump_syms.cc', +] + +HOST_CXXFLAGS += [ + '-O2', + '-EHsc', + '-MD' +] + +HOST_OS_LIBS += [ + 'diaguids', + 'imagehlp' +] + +LOCAL_INCLUDES += [ + '../../..' +] diff --git a/toolkit/crashreporter/moz.build b/toolkit/crashreporter/moz.build index d045ac492020..e80e63515f98 100644 --- a/toolkit/crashreporter/moz.build +++ b/toolkit/crashreporter/moz.build @@ -8,10 +8,13 @@ SPHINX_TREES['crashreporter'] = 'docs' if CONFIG['OS_ARCH'] == 'WINNT': DIRS += [ - 'google-breakpad/src/common', - 'breakpad-windows-libxul' + 'google-breakpad/src/common', + 'breakpad-windows-libxul', ] + if CONFIG['MSVC_HAS_DIA_SDK']: + DIRS += ['google-breakpad/src/tools/windows/dump_syms'] + if CONFIG['MOZ_CRASHREPORTER_INJECTOR']: DIRS += ['breakpad-windows-standalone'] diff --git a/toolkit/crashreporter/tools/unit-symbolstore.py b/toolkit/crashreporter/tools/unit-symbolstore.py index 34102dd41386..907debdd3f3c 100644 --- a/toolkit/crashreporter/tools/unit-symbolstore.py +++ b/toolkit/crashreporter/tools/unit-symbolstore.py @@ -478,12 +478,17 @@ class TestFunctional(HelperMixin, unittest.TestCase): 'crashreporter', 'tools', 'symbolstore.py') if platform.system() in ("Windows", "Microsoft"): - self.dump_syms = os.path.join(self.topsrcdir, - 'toolkit', - 'crashreporter', - 'tools', - 'win32', - 'dump_syms_vc{_MSC_VER}.exe'.format(**buildconfig.substs)) + if buildconfig.substs['MSVC_HAS_DIA_SDK']: + self.dump_syms = os.path.join(buildconfig.topobjdir, + 'dist', 'host', 'bin', + 'dump_syms.exe') + else: + self.dump_syms = os.path.join(self.topsrcdir, + 'toolkit', + 'crashreporter', + 'tools', + 'win32', + 'dump_syms_vc{_MSC_VER}.exe'.format(**buildconfig.substs)) self.target_bin = os.path.join(buildconfig.topobjdir, 'browser', 'app',