Bug 1590624 - Update the mingw-clang compiler to clang 9 r=dmajor
authorTom Ritter <tom@mozilla.com>
Thu, 12 Dec 2019 07:43:53 +0000
changeset 506623 02a71c2df35ce9fe3ea5ccaebff3da2dc9697972
parent 506622 27df7ff304df066aef73fcf03d67bbaa5ba9a55d
child 506624 79bf2b523d94d5558206d14ff7077b32d431e8af
push id36910
push usercsabou@mozilla.com
push dateThu, 12 Dec 2019 21:50:40 +0000
treeherdermozilla-central@0f6958f49842 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1590624
milestone73.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 1590624 - Update the mingw-clang compiler to clang 9 r=dmajor We can remove our backported objcopy patches, we'll need to update llvm-mingw for toolchain fixes, and we need to add binutils to compile this newer version of clang because the system binutils is too old. Differential Revision: https://phabricator.services.mozilla.com/D50152
browser/config/mozconfigs/win32/mingwclang
browser/config/mozconfigs/win64/mingwclang
build/build-clang/clang-8-mingw.json
build/build-clang/clang-9-mingw.json
taskcluster/ci/fetch/toolchains.yml
taskcluster/ci/toolchain/clang.yml
taskcluster/ci/toolchain/mingw.yml
taskcluster/ci/toolchain/minidump_stackwalk.yml
taskcluster/ci/toolchain/nasm.yml
taskcluster/scripts/misc/build-clang-8-mingw.sh
taskcluster/scripts/misc/build-clang-mingw.sh
--- a/browser/config/mozconfigs/win32/mingwclang
+++ b/browser/config/mozconfigs/win32/mingwclang
@@ -52,17 +52,17 @@ CXXFLAGS="-fms-extensions"
 AR=llvm-ar
 RANLIB=llvm-ranlib
 
 # For Stylo
 BINDGEN_CFLAGS="-I$MOZ_FETCHES_DIR/clang/i686-w64-mingw32/include/c++/v1 -I$MOZ_FETCHES_DIR/clang/i686-w64-mingw32/include"
 
 # We want to make sure we use binutils and other binaries in the tooltool
 # package.
-mk_add_options "export PATH=$MOZ_FETCHES_DIR/clang/bin:$MOZ_FETCHES_DIR/mingw32/bin:$MOZ_FETCHES_DIR/wine/bin:$MOZ_FETCHES_DIR/upx/bin:$MOZ_FETCHES_DIR/fxc2/bin:$PATH"
+mk_add_options "export PATH=$MOZ_FETCHES_DIR/clang/bin:$MOZ_FETCHES_DIR/mingw32/bin:$MOZ_FETCHES_DIR/wine/bin:$MOZ_FETCHES_DIR/upx/bin:$MOZ_FETCHES_DIR/fxc2/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH"
 
 LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MOZ_FETCHES_DIR/mingw32/lib64:$MOZ_FETCHES_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
 
--- a/browser/config/mozconfigs/win64/mingwclang
+++ b/browser/config/mozconfigs/win64/mingwclang
@@ -52,17 +52,17 @@ CXXFLAGS="-fms-extensions"
 AR=llvm-ar
 RANLIB=llvm-ranlib
 
 # For Stylo
 BINDGEN_CFLAGS="-I$MOZ_FETCHES_DIR/clang/x86_64-w64-mingw32/include/c++/v1 -I$MOZ_FETCHES_DIR/clang/x86_64-w64-mingw32/include"
 
 # We want to make sure we use binutils and other binaries in the tooltool
 # package.
-mk_add_options "export PATH=$MOZ_FETCHES_DIR/clang/bin:$MOZ_FETCHES_DIR/mingw32/bin:$MOZ_FETCHES_DIR/wine/bin:$MOZ_FETCHES_DIR/upx/bin:$MOZ_FETCHES_DIR/fxc2/bin:$PATH"
+mk_add_options "export PATH=$MOZ_FETCHES_DIR/clang/bin:$MOZ_FETCHES_DIR/mingw32/bin:$MOZ_FETCHES_DIR/wine/bin:$MOZ_FETCHES_DIR/upx/bin:$MOZ_FETCHES_DIR/fxc2/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH"
 
 LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MOZ_FETCHES_DIR/mingw32/lib64:$MOZ_FETCHES_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
 
rename from build/build-clang/clang-8-mingw.json
rename to build/build-clang/clang-9-mingw.json
--- a/build/build-clang/clang-8-mingw.json
+++ b/build/build-clang/clang-9-mingw.json
@@ -4,22 +4,10 @@
     "build_type": "Release",
     "assertions": false,
     "python_path": "/usr/bin/python2.7",
     "gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
     "cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
     "cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
     "as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
     "patches": [
-        "mingwclang-llvm-objcopy-COFF-Remove-a-superfluous-namespace-qua.patch",
-        "mingwclang-llvm-objcopy-COFF-Add-support-for-removing-sections.patch",
-        "mingwclang-llvm-objcopy-COFF-Implement-strip-debug.patch",
-        "mingwclang-llvm-objcopy-COFF-Implement-only-keep-debug.patch",
-        "mingwclang-llvm-objcopy-COFF-Implement-only-section.patch",
-        "mingwclang-llvm-objcopy-Consistently-use-createStringError-inst.patch",
-        "mingwclang-llvm-objcopy-COFF-Update-symbol-indices-in-weak-exte.patch",
-        "mingwclang-llvm-objcopy-Return-Error-from-Buffer-allocate-ELF-W.patch",
-        "mingwclang-Reapply-llvm-objcopy-COFF-Implement-add-gnu-debuglin.patch",
-        "mingwclang-llvm-objcopy-COFF-Clear-the-unwritten-tail-of-coff_s.patch",
-        "mingwclang-llvm-objcopy-COFF-Fix-handling-of-aux-symbols-for-bi.patch",
-        "mingwclang-llvm-objcopy-COFF-Error-out-on-use-of-unhandled-opti.patch"
     ]
 }
--- a/taskcluster/ci/fetch/toolchains.yml
+++ b/taskcluster/ci/fetch/toolchains.yml
@@ -366,24 +366,24 @@ mingw-w64:
         repo: git://git.code.sf.net/p/mingw-w64/mingw-w64
         revision: 1b373beec6d07478ffba33726bb3bb21f32e4411
 
 libunwind:
     description: libunwind source code
     fetch:
         type: git
         repo: https://github.com/llvm-mirror/libunwind
-        revision: 6ee92fcc97350ae32db3172a269e9afcc2bab686
+        revision: efd17a11b0fae29d3414e11e99307e082d4ee949
 
 llvm-mingw:
     description: llvm-mingw source code
     fetch:
         type: git
         repo: https://github.com/mstorsjo/llvm-mingw
-        revision: c3a16814bd26aa6702e1e5b482a3d9044bb0f725
+        revision: 9f8e5cebd6dbbb7546e8917e6c59284699a48d26
 
 android-rs-glue:
     description: android-rs-glue source code
     fetch:
         type: git
         repo: https://github.com/rust-windowing/android-rs-glue
         revision: e3ac6edea5814e1faca0c31ea8fac6877cb929ea
 
--- a/taskcluster/ci/toolchain/clang.yml
+++ b/taskcluster/ci/toolchain/clang.yml
@@ -81,62 +81,64 @@ linux64-clang-9-cross:
         toolchain-artifact: public/build/clang.tar.xz
     fetches:
         fetch:
             - clang-9
         toolchain:
             - linux64-binutils
             - linux64-gcc-7
 
-linux64-clang-8-mingw-x86:
+linux64-clang-9-mingw-x86:
     description: "MinGW-Clang Trunk x86 toolchain build"
     treeherder:
         symbol: TMW(clang-x86)
     run:
-        script: build-clang-8-mingw.sh
+        script: build-clang-mingw.sh
         arguments:
             - 'x86'
-            - 'build/build-clang/clang-8-mingw.json'
+            - 'build/build-clang/clang-9-mingw.json'
         resources:
-            - 'build/build-clang/clang-8-mingw.json'
+            - 'build/build-clang/clang-9-mingw.json'
         toolchain-alias: linux64-clang-mingw-x86
         toolchain-artifact: public/build/clangmingw.tar.xz
     fetches:
         fetch:
-            - clang-8
+            - clang-9
             - mingw-w64
             - libunwind
             - llvm-mingw
             - gcc-9.1.0
         toolchain:
             - linux64-gcc-7
+            - linux64-binutils
 
-linux64-clang-8-mingw-x64:
+linux64-clang-9-mingw-x64:
     description: "MinGW-Clang Trunk x64 toolchain build"
     treeherder:
         symbol: TMW(clang-x64)
         tier: 1
     run:
-        script: build-clang-8-mingw.sh
+        script: build-clang-mingw.sh
         arguments:
             - 'x64'
-            - 'build/build-clang/clang-8-mingw.json'
+            - 'build/build-clang/clang-9-mingw.json'
         resources:
-            - 'build/build-clang/clang-8-mingw.json'
+            - 'build/build-clang/clang-9-mingw.json'
         toolchain-alias: linux64-clang-mingw-x64
         toolchain-artifact: public/build/clangmingw.tar.xz
     fetches:
         fetch:
-            - clang-8
+            - clang-9
             - mingw-w64
             - libunwind
             - llvm-mingw
             - gcc-9.1.0
         toolchain:
             - linux64-gcc-7
+            - linux64-binutils
 
 linux64-clang-9-android-cross:
     description: "Clang 9 toolchain build"
     treeherder:
         symbol: TL(clang9-android)
     run:
         using: toolchain-script
         script: build-clang.sh
--- a/taskcluster/ci/toolchain/mingw.yml
+++ b/taskcluster/ci/toolchain/mingw.yml
@@ -69,9 +69,9 @@ linux64-mingw-fxc2-x86:
     run:
         using: toolchain-script
         script: build-mingw-fxc2-x86.sh
         toolchain-artifact: public/build/fxc2.tar.xz
     fetches:
         fetch:
             - fxc2
         toolchain:
-            - linux64-clang-8-mingw-x86
+            - linux64-clang-mingw-x86
--- a/taskcluster/ci/toolchain/minidump_stackwalk.yml
+++ b/taskcluster/ci/toolchain/minidump_stackwalk.yml
@@ -56,10 +56,10 @@ win32-minidump-stackwalk:
     treeherder:
         symbol: TW32(stackwalk)
     worker:
         docker-image: {in-tree: mingw32-build}
     run:
         arguments: ['mingw32']
     fetches:
         toolchain:
-            - linux64-clang-8-mingw-x86
+            - linux64-clang-mingw-x86
             - mingw32-rust-1.39
--- a/taskcluster/ci/toolchain/nasm.yml
+++ b/taskcluster/ci/toolchain/nasm.yml
@@ -17,17 +17,17 @@ win64-nasm:
         docker-image: {in-tree: mingw32-build}
     run:
         script: build-nasm.sh
         arguments: ['win64']
     fetches:
         fetch:
             - nasm-2.14.02
         toolchain:
-            - linux64-clang-8-mingw-x64
+            - linux64-clang-mingw-x64
 
 linux64-nasm:
     description: "nasm linux64 build"
     treeherder:
         symbol: TL(nasm)
     run:
         script: build-nasm.sh
         arguments: ['linux64']
rename from taskcluster/scripts/misc/build-clang-8-mingw.sh
rename to taskcluster/scripts/misc/build-clang-mingw.sh
--- a/taskcluster/scripts/misc/build-clang-8-mingw.sh
+++ b/taskcluster/scripts/misc/build-clang-mingw.sh
@@ -22,16 +22,20 @@ else
 fi
 
 TOOLCHAIN_DIR=$MOZ_FETCHES_DIR/llvm-project
 INSTALL_DIR=$TOOLCHAIN_DIR/build/stage3/clang
 CROSS_PREFIX_DIR=$INSTALL_DIR/$machine-w64-mingw32
 
 make_flags="-j$(nproc)"
 
+if [ -d "$MOZ_FETCHES_DIR/binutils/bin" ]; then
+  export PATH="$MOZ_FETCHES_DIR/binutils/bin:$PATH"
+fi
+
 # This is default value of _WIN32_WINNT. Gecko configure script explicitly sets this,
 # so this is not used to build Gecko itself. We default to 0x601, which is Windows 7.
 default_win32_winnt=0x601
 
 cd $GECKO_PATH
 
 patch_file="$(pwd)/taskcluster/scripts/misc/mingw-winrt.patch"