Bug 1475998 Add a x86 MinGW Clang Build Job r=froydnj
☠☠ backed out by 3f74fda7be1b ☠ ☠
authorTom Ritter <tom@mozilla.com>
Tue, 09 Oct 2018 14:10:56 +0000
changeset 496010 df47d3ad9cc61d1462618ba18dbd2c3359bcc1e7
parent 496009 d2f1e35ee4b77b0d7d75aa79f94dc812e86b223c
child 496011 b8c1b55829137acd018c4ff0ca763d5e1e1a89e9
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1475998
milestone64.0a1
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 1475998 Add a x86 MinGW Clang Build Job r=froydnj This commit also removes dwarf-exceptions from the x64 build. sjlj exceptions are needed on x86 because there is a bug currently involving SEH exceptions on x86. However on x64 there is not, so we can use the default SEH and get rid of dwarf exceptions. Additionally, to use SEH exceptions, we need to -fuse-cxa-atexit Differential Revision: https://phabricator.services.mozilla.com/D7759
browser/config/mozconfigs/win32/mingwclang
browser/config/mozconfigs/win32/mingwclang-debug
taskcluster/ci/build/windows.yml
taskcluster/ci/config.yml
taskcluster/scripts/misc/build-clang-7-mingw.sh
testing/mozharness/configs/builds/releng_sub_windows_configs/32_mingwclang.py
testing/mozharness/configs/builds/releng_sub_windows_configs/32_mingwclang_debug.py
new file mode 100644
--- /dev/null
+++ b/browser/config/mozconfigs/win32/mingwclang
@@ -0,0 +1,79 @@
+# Sets:
+#    MOZ_AUTOMATION flags
+#    SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE - shouldn't be used?
+#    TOOLTOOL_DIR
+#    MAKECAB - shouldn't be used?
+. "$topsrcdir/build/mozconfig.win-common"
+
+# MinGW does not have (or need) makecab
+unset MAKECAB
+
+# Sets:
+#  build/mozconfig.common
+#    AUTOCLOBBER=1
+#    --enable-crashreporter
+#    --enable-release
+#    LLVM_CONFIG
+#    MOZ_ADDON_SIGNING
+#    MOZ_REQUIRE_SIGNING
+#    --enable-js-shell
+#  build/mozconfig.automation
+#    MOZ_AUTOMATION_ flags
+#  build/mozconfig.rust
+#    TOOLTOOL_DIR
+#    RUSTC
+#    CARGO
+. "$topsrcdir/browser/config/mozconfigs/common"
+
+# MinGW Stuff
+ac_add_options --target=i686-w64-mingw32
+ac_add_options --with-toolchain-prefix=i686-w64-mingw32-
+
+ac_add_options --disable-warnings-as-errors
+
+# Temporary config settings until we get these working on mingw
+ac_add_options --disable-accessibility # https://sourceforge.net/p/mingw-w64/bugs/648/
+
+# For now, we'll disable the sandbox, until we get get Bug 1461421 figured out
+ac_add_options --disable-sandbox
+
+# These aren't supported on mingw at this time
+ac_add_options --disable-maintenance-service
+ac_add_options --disable-webrtc # Bug 1393901
+ac_add_options --disable-geckodriver # Bug 1489320
+
+# Find our toolchain
+HOST_CC="$TOOLTOOL_DIR/clang/bin/clang"
+HOST_CXX="$TOOLTOOL_DIR/clang/bin/clang++"
+CC="$TOOLTOOL_DIR/clang/bin/i686-w64-mingw32-clang"
+CXX="$TOOLTOOL_DIR/clang/bin/i686-w64-mingw32-clang++"
+CXXFLAGS="-fms-extensions"
+CPP="$TOOLTOOL_DIR/clang/bin/i686-w64-mingw32-clang -E"
+AR=llvm-ar
+RANLIB=llvm-ranlib
+
+# For Stylo
+BINDGEN_CFLAGS="-I$TOOLTOOL_DIR/clang/i686-w64-mingw32/include/c++/v1 -I$TOOLTOOL_DIR/clang/lib/clang/7.0.0/include -I$TOOLTOOL_DIR/clang/i686-w64-mingw32/include"
+
+# Since we use windres from binutils without the rest of tools (like cpp), we need to
+# explicitly specify clang as a preprocessor.
+WINDRES="i686-w64-mingw32-windres --preprocessor=\"$CPP -xc\" -DRC_INVOKED"
+
+# Bug 1471698 - Work around binutils corrupting mingw clang binaries.
+LDFLAGS="-Wl,-S"
+STRIP=/bin/true
+OBJCOPY=/bin/true
+
+# We want to make sure we use binutils and other binaries in the tooltool
+# package.
+mk_add_options "export PATH=$TOOLTOOL_DIR/clang/bin:$TOOLTOOL_DIR/mingw32/bin:$TOOLTOOL_DIR/wine/bin:$TOOLTOOL_DIR/upx/bin:$TOOLTOOL_DIR/fxc2/bin:$PATH"
+
+LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/mingw32/lib64:$TOOLTOOL_DIR/clang/lib
+mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+
+# Do not include the visual studio related mozconfigs of course
+
+ac_add_options --with-branding=browser/branding/nightly
+
+. "$topsrcdir/build/mozconfig.common.override"
+. "$topsrcdir/build/mozconfig.cache"
new file mode 100644
--- /dev/null
+++ b/browser/config/mozconfigs/win32/mingwclang-debug
@@ -0,0 +1,6 @@
+MOZ_AUTOMATION_L10N_CHECK=0
+
+. "$topsrcdir/browser/config/mozconfigs/win32/mingwclang"
+
+ac_add_options --enable-debug
+ac_add_options --disable-optimize
\ No newline at end of file
--- a/taskcluster/ci/build/windows.yml
+++ b/taskcluster/ci/build/windows.yml
@@ -970,16 +970,87 @@ win32-mingw32/debug:
         - linux64-wine
         - linux64-cbindgen
         - linux64-sccache
         - linux64-mingw32-gcc
         - linux64-mingw32-nsis
         - linux64-mingw32-fxc2
         - linux64-node
 
+win32-mingwclang/opt:
+    description: "Win32 MinGW-Clang Opt"
+    index:
+        product: firefox
+        job-name: win32-mingwclang-opt
+    treeherder:
+        platform: windows-mingw32/all
+        symbol: WMC32(Bo)
+        tier: 2
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        docker-image: {in-tree: mingw32-build}
+        max-run-time: 7200
+        env:
+            PERFHERDER_EXTRA_OPTIONS: "opt 32 clang"
+    run:
+        using: mozharness
+        actions: [build]
+        script: mozharness/scripts/fx_desktop_build.py
+        config:
+            - builds/releng_base_firefox.py
+            - builds/releng_base_windows_32_mingw_builds.py
+            - builds/releng_sub_windows_configs/32_mingwclang.py
+        need-xvfb: false
+    toolchains:
+        - mingw32-rust
+        - linux64-upx
+        - linux64-wine
+        - linux64-sccache
+        - linux64-cbindgen
+        - linux64-node
+        - linux64-clang-7-mingw-x86
+        - linux64-mingw32-nsis
+        - linux64-mingw32-fxc2
+
+win32-mingwclang/debug:
+    description: "Win32 MinGW-Clang Debug"
+    index:
+        product: firefox
+        job-name: win32-mingwclang-debug
+    treeherder:
+        platform: windows-mingw32/all
+        symbol: WMC32(Bd)
+        tier: 2
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        docker-image: {in-tree: mingw32-build}
+        max-run-time: 72000
+        env:
+            PERFHERDER_EXTRA_OPTIONS: "debug 32 clang"
+    run:
+        using: mozharness
+        actions: [build]
+        script: mozharness/scripts/fx_desktop_build.py
+        config:
+            - builds/releng_base_firefox.py
+            - builds/releng_base_windows_32_mingw_builds.py
+            - builds/releng_sub_windows_configs/32_mingwclang.py
+            - builds/releng_sub_windows_configs/32_mingwclang_debug.py
+        need-xvfb: false
+    toolchains:
+        - mingw32-rust
+        - linux64-upx
+        - linux64-wine
+        - linux64-sccache
+        - linux64-cbindgen
+        - linux64-node
+        - linux64-clang-7-mingw-x86
+        - linux64-mingw32-nsis
+        - linux64-mingw32-fxc2
+
 win64-mingwclang/opt:
     description: "Win64 MinGW-Clang Opt"
     index:
         product: firefox
         job-name: win64-mingwclang-opt
     treeherder:
         platform: windows-mingw32/all
         symbol: WMC64(Bo)
--- a/taskcluster/ci/config.yml
+++ b/taskcluster/ci/config.yml
@@ -63,16 +63,17 @@ treeherder:
         'I': 'Docker Image Builds'
         'TL': 'Toolchain builds for Linux 64-bits'
         'TM': 'Toolchain builds for OSX'
         'TMW': 'Toolchain builds for Windows MinGW'
         'TW32': 'Toolchain builds for Windows 32-bits'
         'TW64': 'Toolchain builds for Windows 64-bits'
         'WM32': 'MinGW builds for Windows 32-bits'
         'WM64': 'MinGW builds for Windows 64-bits'
+        'WMC32': 'MinGW-Clang builds for Windows 32-bits'
         'WMC64': 'MinGW-Clang builds for Windows 64-bits'
         'Searchfox': 'Searchfox builds'
         'SM': 'Spidermonkey builds'
         'pub': 'APK publishing'
         'p': 'Partial generation'
         'ps': 'Partials signing'
         'Rel': 'Release promotion'
         'Snap': 'Snap image generation'
--- a/taskcluster/scripts/misc/build-clang-7-mingw.sh
+++ b/taskcluster/scripts/misc/build-clang-7-mingw.sh
@@ -5,20 +5,22 @@ set -x -e -v
 
 if [[ $# -eq 0 ]]; then
     echo "Provide either x86 or x64 to specify a toolchain."
     exit 1;
 elif [ "$1" == "x86" ]; then
   machine="i686"
   compiler_rt_machine="i386"
   crt_flags="--enable-lib32 --disable-lib64"
+  WRAPPER_FLAGS="-fsjlj-exceptions"
 elif [ "$1" == "x64" ]; then
   machine="x86_64"
   compiler_rt_machine="x86_64"
   crt_flags="--disable-lib32 --enable-lib64"
+  WRAPPER_FLAGS=""
 else
   echo "Provide either x86 or x64 to specify a toolchain."
   exit 1;
 fi
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
 UPLOAD_DIR=$HOME/artifacts
@@ -72,27 +74,29 @@ prepare() {
   tar -jxf binutils-$binutils_version.tar.$binutils_ext
 
   popd
 }
 
 install_wrappers() {
   pushd $INSTALL_DIR/bin
 
+  compiler_flags="--sysroot \$DIR/../$machine-w64-mingw32 -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $WRAPPER_FLAGS -fuse-cxa-atexit -Qunused-arguments"
+
   cat <<EOF >$machine-w64-mingw32-clang
 #!/bin/sh
 DIR="\$(cd "\$(dirname "\$0")" && pwd)"
-\$DIR/clang -target $machine-w64-mingw32 --sysroot \$DIR/../$machine-w64-mingw32 -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld -fdwarf-exceptions -Qunused-arguments "\$@"
+\$DIR/clang -target $machine-w64-mingw32 $compiler_flags "\$@"
 EOF
   chmod +x $machine-w64-mingw32-clang
 
   cat <<EOF >$machine-w64-mingw32-clang++
 #!/bin/sh
 DIR="\$(cd "\$(dirname "\$0")" && pwd)"
-\$DIR/clang -target $machine-w64-mingw32 --sysroot \$DIR/../$machine-w64-mingw32 --driver-mode=g++ -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld -fdwarf-exceptions -Qunused-arguments "\$@"
+\$DIR/clang -target $machine-w64-mingw32 --driver-mode=g++ $compiler_flags "\$@"
 EOF
   chmod +x $machine-w64-mingw32-clang++
 
   CC="$machine-w64-mingw32-clang"
   CXX="$machine-w64-mingw32-clang++"
 
   popd
 }
new file mode 100644
--- /dev/null
+++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_mingwclang.py
@@ -0,0 +1,7 @@
+config = {
+    'base_name': 'WINNT_5.2_MINGWCLANG_%(branch)s',
+    'platform': 'win32-mingwclang',
+    'stage_platform': 'win32-mingwclang',
+    'mozconfig_platform': 'win32',
+    'mozconfig_variant': 'mingwclang',
+}
new file mode 100644
--- /dev/null
+++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_mingwclang_debug.py
@@ -0,0 +1,3 @@
+config = {
+    'mozconfig_variant': 'mingwclang-debug',
+}