try draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Dec 2018 17:19:40 +0900
changeset 1784107 949cdc454db08ff50267c00b51b92a55cd42f5f0
parent 1782615 4b84d98bb5f41fc5be0bd27503a99b1c942a491c
child 1784108 aa89a85a607440907823d5d4c65283fcb0b63882
push id321263
push usermh@glandium.org
push dateWed, 12 Dec 2018 00:40:49 +0000
treeherdertry@aa89a85a6074 [default view] [failures only]
milestone66.0a1
try
mfbt/moz.build
old-configure.in
taskcluster/ci/toolchain/linux.yml
taskcluster/docker/toolchain-build/Dockerfile
taskcluster/scripts/misc/build-minidump-stackwalk.sh
taskcluster/scripts/misc/minidump_stackwalk.sh
toolkit/crashreporter/google-breakpad/src/common/moz.build
toolkit/crashreporter/minidump_stackwalk/app.mozbuild
toolkit/crashreporter/minidump_stackwalk/moz.build
toolkit/crashreporter/minidump_stackwalk/moz.configure
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -2,18 +2,16 @@
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "MFBT")
 
-TEST_DIRS += ['tests']
-
 Library('mfbt')
 
 EXPORTS.mozilla = [
     'Algorithm.h',
     'Alignment.h',
     'AllocPolicy.h',
     'AlreadyAddRefed.h',
     'Array.h',
@@ -129,49 +127,52 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS.mozilla += [
         'WindowsVersion.h',
     ]
 elif CONFIG['OS_ARCH'] == 'Linux':
     EXPORTS.mozilla += [
         'LinuxSignal.h',
     ]
 
-UNIFIED_SOURCES += [
-    'Assertions.cpp',
-    'ChaosMode.cpp',
-    'double-conversion/double-conversion/bignum-dtoa.cc',
-    'double-conversion/double-conversion/bignum.cc',
-    'double-conversion/double-conversion/cached-powers.cc',
-    'double-conversion/double-conversion/diy-fp.cc',
-    'double-conversion/double-conversion/double-conversion.cc',
-    'double-conversion/double-conversion/fast-dtoa.cc',
-    'double-conversion/double-conversion/fixed-dtoa.cc',
-    'double-conversion/double-conversion/strtod.cc',
-    'FloatingPoint.cpp',
-    'HashFunctions.cpp',
-    'JSONWriter.cpp',
-    'Poison.cpp',
-    'RandomNum.cpp',
-    'RecordReplay.cpp',
-    'SHA1.cpp',
-    'TaggedAnonymousMemory.cpp',
-    'Unused.cpp',
-    'Utf8.cpp',
-]
+if CONFIG['MOZ_BUILD_APP'] != 'toolkit/crashreporter/minidump_stackwalk':
+    TEST_DIRS += ['tests']
+
+    UNIFIED_SOURCES += [
+        'Assertions.cpp',
+        'ChaosMode.cpp',
+        'double-conversion/double-conversion/bignum-dtoa.cc',
+        'double-conversion/double-conversion/bignum.cc',
+        'double-conversion/double-conversion/cached-powers.cc',
+        'double-conversion/double-conversion/diy-fp.cc',
+        'double-conversion/double-conversion/double-conversion.cc',
+        'double-conversion/double-conversion/fast-dtoa.cc',
+        'double-conversion/double-conversion/fixed-dtoa.cc',
+        'double-conversion/double-conversion/strtod.cc',
+        'FloatingPoint.cpp',
+        'HashFunctions.cpp',
+        'JSONWriter.cpp',
+        'Poison.cpp',
+        'RandomNum.cpp',
+        'RecordReplay.cpp',
+        'SHA1.cpp',
+        'TaggedAnonymousMemory.cpp',
+        'Unused.cpp',
+        'Utf8.cpp',
+    ]
+
+    SOURCES += [
+        'Compression.cpp',
+        'decimal/Decimal.cpp',
+        'lz4.c',
+    ]
+
+    DisableStlWrapping()
+
+    if CONFIG['CC_TYPE'] == 'clang':
+        # Suppress warnings from third-party V8 Decimal code.
+        SOURCES['decimal/Decimal.cpp'].flags += ['-Wno-implicit-fallthrough']
 
 DEFINES['IMPL_MFBT'] = True
 
-SOURCES += [
-    'Compression.cpp',
-    'decimal/Decimal.cpp',
-    'lz4.c',
-]
-
-DisableStlWrapping()
-
-if CONFIG['CC_TYPE'] == 'clang':
-    # Suppress warnings from third-party V8 Decimal code.
-    SOURCES['decimal/Decimal.cpp'].flags += ['-Wno-implicit-fallthrough']
-
 if CONFIG['MOZ_NEEDS_LIBATOMIC']:
     OS_LIBS += ['atomic']
 
 DEFINES['LZ4LIB_VISIBILITY'] = ''
--- a/old-configure.in
+++ b/old-configure.in
@@ -1139,16 +1139,20 @@ case "${OS_TARGET}" in
 Darwin)
   ;;
 *)
   STL_FLAGS="-I${DIST}/stl_wrappers"
   WRAP_STL_INCLUDES=1
   ;;
 esac
 
+if test "$MOZ_BUILD_APP" = "toolkit/crashreporter/minidump_stackwalk"; then
+    WRAP_STL_INCLUDES=
+fi
+
 dnl Checks for header files.
 dnl ========================================================
 AC_HEADER_DIRENT
 case "$target_os" in
 bitrig*|dragonfly*|freebsd*|openbsd*)
 # for stuff like -lXshm
     CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
     ;;
@@ -2316,17 +2320,17 @@ if test -n "$MOZ_SYSTEM_LIBVPX"; then
 fi
 CFLAGS=$_SAVE_CFLAGS
 LIBS=$_SAVE_LIBS
 
 AC_SUBST(MOZ_SYSTEM_LIBVPX)
 AC_SUBST_LIST(MOZ_LIBVPX_CFLAGS)
 AC_SUBST_LIST(MOZ_LIBVPX_LIBS)
 
-if test -z "$MOZ_SYSTEM_LIBVPX"; then
+if test -z "$MOZ_SYSTEM_LIBVPX" -a "$MOZ_BUILD_APP" != "toolkit/crashreporter/minidump_stackwalk"; then
 
     dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
     dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
     dnl We currently require gcc on all arm platforms.
 
     dnl See if we have assembly on this platform.
     case "$OS_ARCH:$CPU_ARCH" in
     Darwin:x86)
@@ -2699,17 +2703,17 @@ if test -n "$MOZ_LIBJPEG_TURBO" -a -n "$
   *:x86_64)
     if $CC -E -dM -</dev/null | grep -q __ELF__; then
       LIBJPEG_TURBO_ASFLAGS="-D__x86_64__ -DPIC -DELF"
     fi
   ;;
   esac
 fi
 
-if test -n "$LIBJPEG_TURBO_ASFLAGS"; then
+if test -n "$LIBJPEG_TURBO_ASFLAGS" -a "$MOZ_BUILD_APP" != "toolkit/crashreporter/minidump_stackwalk"; then
   case "$CPU_ARCH" in
 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
 dnl it doesn't exist or we have too old of a version.
   x86_64|x86)
     LIBJPEG_TURBO_USE_YASM=1
 
     if test -z "$YASM" ; then
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -829,8 +829,29 @@ linux64-mingw-fxc2-x86:
         script: build-mingw-fxc2-x86.sh
         resources:
             - 'build/build-clang/build-clang.py'
             - 'build/build-clang/clang-trunk-mingw.json'
             - 'taskcluster/scripts/misc/build-clang-trunk-mingw.sh'
         toolchain-artifact: public/build/fxc2.tar.xz
     toolchains:
         - linux64-clang-trunk-mingw-x86
+
+linux64-minidump-stackwalk:
+    description: "minidump_stackwalk toolchain build"
+    treeherder:
+        kind: build
+        platform: toolchains/opt
+        symbol: TL(stackwalk)
+        tier: 1
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        max-run-time: 1800
+    run:
+        using: toolchain-script
+        script: build-minidump-stackwalk.sh
+        sparse-profile: null
+        resources:
+            - 'taskcluster/scripts/misc/tooltool-download.sh'
+        toolchain-artifact: public/build/minidump_stackwalk.tar.xz
+    toolchains:
+        - linux64-clang-7
+        - linux64-binutils
--- a/taskcluster/docker/toolchain-build/Dockerfile
+++ b/taskcluster/docker/toolchain-build/Dockerfile
@@ -9,16 +9,17 @@ VOLUME /builds/worker/tooltool-cache
 ENV XZ_OPT=-T0
 
 # %ARG DOCKER_IMAGE_PACKAGES
 RUN /usr/local/sbin/setup_packages.sh $DOCKER_IMAGE_PACKAGES
 
 RUN apt-get update && \
     apt-get install \
       autoconf \
+      autoconf2.13 \
       automake \
       bison \
       build-essential \
       curl \
       cmake \
       flex \
       gawk \
       gcc-multilib \
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-minidump-stackwalk.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building minidump_stackwalk
+
+WORKSPACE=$HOME/workspace
+UPLOAD_DIR=$HOME/artifacts
+COMPRESS_EXT=xz
+PATH="$WORKSPACE/build/src/binutils/bin:$WORKSPACE/build/src/clang/bin:$PATH"
+
+cd $WORKSPACE/build/src
+
+. taskcluster/scripts/misc/tooltool-download.sh
+
+export MOZ_OBJDIR=obj-minidump
+
+echo ac_add_options --enable-project=toolkit/crashreporter/minidump_stackwalk > .mozconfig
+
+./mach build
+
+mkdir minidump_stackwalk
+cp $MOZ_OBJDIR/dist/bin/minidump_stackwalk* minidump_stackwalk/
+
+tar -acf minidump_stackwalk.tar.$COMPRESS_EXT minidump_stackwalk/
+mkdir -p $UPLOAD_DIR
+cp minidump_stackwalk.tar.$COMPRESS_EXT $UPLOAD_DIR
deleted file mode 100755
--- a/taskcluster/scripts/misc/minidump_stackwalk.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash
-#
-# This script builds minidump_stackwalk binaries from the Google Breakpad
-# source for all of the operating systems that we run Firefox tests on:
-# Linux x86, Linux x86-64, Windows x86, OS X x86-64.
-#
-# It expects to be run in the luser/breakpad-builder:0.7 Docker image and
-# needs access to the relengapiproxy to download internal tooltool files.
-
-set -v -e -x
-
-# This is a pain to support properly with gclient.
-#: BREAKPAD_REPO        ${BREAKPAD_REPO:=https://google-breakpad.googlecode.com/svn/trunk/}
-: BREAKPAD_REV         "${BREAKPAD_REV:=master}"
-: STACKWALK_HTTP_REPO  "${STACKWALK_HTTP_REPO:=https://hg.mozilla.org/users/tmielczarek_mozilla.com/stackwalk-http}"
-: STACKWALK_HTTP_REV   "${STACKWALK_HTTP_REV:=default}"
-
-ncpu=$(getconf _NPROCESSORS_ONLN)
-
-function build()
-{
-    cd /tmp
-    local platform=$1
-    local strip_prefix=$2
-    local configure_args=$3
-    local make_args=$4
-    local objdir=/tmp/obj-breakpad-$platform
-    local ext=
-    if test "$platform" = "win32"; then
-        ext=.exe
-    fi
-    rm -rf "$objdir"
-    mkdir "$objdir"
-    # First, build Breakpad
-    cd "$objdir"
-    # shellcheck disable=SC2086
-    CFLAGS="-O2 $CFLAGS" CXXFLAGS="-O2 $CXXFLAGS" /tmp/breakpad/src/configure --disable-tools $configure_args
-    # shellcheck disable=SC2086
-    make -j$ncpu $make_args src/libbreakpad.a src/third_party/libdisasm/libdisasm.a src/processor/stackwalk_common.o
-    # Second, build stackwalk-http
-    make -f /tmp/stackwalk-http/Makefile BREAKPAD_SRCDIR=/tmp/breakpad/src "BREAKPAD_OBJDIR=$(pwd)" "OS=$platform" "-j$ncpu"
-    "${strip_prefix}strip" "stackwalk${ext}"
-    cp "stackwalk${ext}" "/tmp/stackwalker/${platform}-minidump_stackwalk${ext}"
-}
-
-function linux64()
-{
-    export LDFLAGS="-static-libgcc -static-libstdc++"
-    build linux64
-    unset LDFLAGS
-}
-
-function linux32()
-{
-    export LDFLAGS="-static-libgcc -static-libstdc++ -L/tmp/libcurl-i386/lib"
-    export CFLAGS="-m32 -I/tmp/libcurl-i386/include"
-    export CXXFLAGS="-m32 -I/tmp/libcurl-i386/include"
-    build linux32 "" "--enable-m32"
-    unset LDFLAGS CFLAGS CXXFLAGS
-}
-
-function macosx64()
-{
-    cd /tmp
-    if ! test -d MacOSX10.7.sdk; then
-      python tooltool.py -v --manifest=macosx-sdk.manifest --url=http://relengapi/tooltool/ fetch
-    fi
-    export MACOSX_SDK=/tmp/MacOSX10.7.sdk
-    export CCTOOLS=/tmp/cctools
-    local FLAGS="-stdlib=libc++ -target x86_64-apple-darwin10 -mlinker-version=136 -B /tmp/cctools/bin -isysroot ${MACOSX_SDK} -mmacosx-version-min=10.7"
-    export CC="clang $FLAGS"
-    export CXX="clang++ $FLAGS -std=c++11"
-    local old_path="$PATH"
-    export PATH="/tmp/clang/bin:/tmp/cctools/bin/:$PATH"
-    export LD_LIBRARY_PATH=/usr/lib/llvm-3.6/lib/
-
-    build macosx64 "/tmp/cctools/bin/x86_64-apple-darwin10-" "--host=x86_64-apple-darwin10" "AR=/tmp/cctools/bin/x86_64-apple-darwin10-ar"
-
-    unset CC CXX LD_LIBRARY_PATH MACOSX_SDK CCTOOLS
-    export PATH="$old_path"
-}
-
-function win32()
-{
-    export LDFLAGS="-static-libgcc -static-libstdc++"
-    export CFLAGS="-D__USE_MINGW_ANSI_STDIO=1"
-    export CXXFLAGS="-D__USE_MINGW_ANSI_STDIO=1"
-    export ZLIB_DIR=/tmp/zlib-mingw
-    build win32 "i686-w64-mingw32-" "--host=i686-w64-mingw32"
-    unset LDFLAGS CFLAGS CXXFLAGS ZLIB_DIR
-}
-
-cd /tmp
-if ! test -d depot_tools; then
-  git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
-else
-  (cd depot_tools; git pull origin master)
-fi
-export PATH=$(pwd)/depot_tools:"$PATH"
-if ! test -d breakpad; then
-    mkdir breakpad
-    pushd breakpad
-    fetch breakpad
-    popd
-else
-    pushd breakpad/src
-    git pull origin master
-    popd
-fi
-pushd breakpad/src
-git checkout "${BREAKPAD_REV}"
-gclient sync
-popd
-
-(cd breakpad/src; git rev-parse master)
-if ! test -d stackwalk-http; then
-  hg clone -u "$STACKWALK_HTTP_REV" "$STACKWALK_HTTP_REPO"
-else
-  (cd stackwalk-http && hg pull "$STACKWALK_HTTP_REPO" && hg up "$STACKWALK_HTTP_REV")
-fi
-mkdir -p stackwalker
-linux64
-linux32
-macosx64
-win32
--- a/toolkit/crashreporter/google-breakpad/src/common/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build
@@ -65,11 +65,12 @@ if CONFIG['OS_TARGET'] == 'Android':
         'android/breakpad_getcontext.S',
     ]
     LOCAL_INCLUDES += [
         '/toolkit/crashreporter/google-breakpad/src/common/android/include',
     ]
 
 Library('breakpad_common_s')
 
-FINAL_LIBRARY = 'xul'
+if CONFIG['MOZ_BUILD_APP'] != 'toolkit/crashreporter/minidump_stackwalk':
+    FINAL_LIBRARY = 'xul'
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/minidump_stackwalk/app.mozbuild
@@ -0,0 +1,6 @@
+DIRS += [
+    '/config/external/zlib',
+    '/toolkit/crashreporter/minidump_stackwalk',
+    '/toolkit/crashreporter/google-breakpad/src/common',
+    '/toolkit/crashreporter/google-breakpad/src/processor',
+]
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/minidump_stackwalk/moz.build
@@ -0,0 +1,25 @@
+Program('minidump_stackwalk')
+
+SOURCES += [
+    '../google-breakpad/src/common/path_helper.cc',
+    '../google-breakpad/src/processor/minidump_stackwalk.cc',
+    '../google-breakpad/src/processor/simple_symbol_supplier.cc',
+]
+
+USE_LIBS += [
+    'breakpad_processor',
+    'zlib',
+]
+
+if CONFIG['OS_TARGET'] == 'WINNT':
+    if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+        DEFINES['__USE_MINGW_ANSI_STDIO'] = True
+
+        LDFLAGS += [
+            '-static-libgcc',
+            '-static-libstdc++',
+        ]
+
+DisableStlWrapping()
+
+include('/toolkit/crashreporter/crashreporter.mozbuild')
new file mode 100644