Bug 1434316 Add 64 bit MinGW gcc toolchains draft
authorTom Ritter <tom@mozilla.com>
Mon, 19 Feb 2018 09:06:35 -0600
changeset 777660 092fd8c196f4e2765e36690b075bff77e7dbc2da
parent 777659 e74191e0592073d8f275c51e59f298000967efc2
child 777661 6894ec9d039c383dc5a8a37b28ff8354765596ba
push id105261
push userbmo:tom@mozilla.com
push dateThu, 05 Apr 2018 04:18:27 +0000
bugs1434316
milestone61.0a1
Bug 1434316 Add 64 bit MinGW gcc toolchains MozReview-Commit-ID: CBUE6i8ghpx
build/unix/build-gcc/build-gcc.sh
taskcluster/ci/build/windows.yml
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-gcc-mingw32.sh
--- a/build/unix/build-gcc/build-gcc.sh
+++ b/build/unix/build-gcc/build-gcc.sh
@@ -121,49 +121,50 @@ build_gcc() {
 
   tar caf $root_dir/gcc.tar.xz gcc/
   popd
 }
 
 build_gcc_and_mingw() {
   mkdir gcc-objdir
   pushd gcc-objdir
-  ../gcc-$gcc_version/configure --prefix=$install_dir --target=i686-w64-mingw32 --with-gnu-ld --with-gnu-as --disable-multilib --enable-threads=posix
+  ../gcc-$gcc_version/configure --prefix=$install_dir --target=$gcc_target --with-gnu-ld --with-gnu-as --disable-multilib --enable-threads=posix
   make $make_flags all-gcc
   make $make_flags install-gcc
   popd
 
   mkdir mingw-w64-headers32
   pushd mingw-w64-headers32
-  ../mingw-w64/mingw-w64-headers/configure --host=i686-w64-mingw32 --prefix=$install_dir/i686-w64-mingw32/ --enable-sdk=all --enable-secure-api --enable-idl
+  ../mingw-w64/mingw-w64-headers/configure --host=$gcc_target --prefix=$install_dir/$gcc_target/ --enable-sdk=all --enable-secure-api --enable-idl
   make $make_flags install
   popd
 
   mkdir mingw-w64-crt32
   pushd mingw-w64-crt32
-  ../mingw-w64/mingw-w64-crt/configure --host=i686-w64-mingw32 --prefix=$install_dir/i686-w64-mingw32/
+  ../mingw-w64/mingw-w64-crt/configure --host=$gcc_target --prefix=$install_dir/$gcc_target/
   make
   make install
   popd
 
   mkdir mingw-w64-pthread
   pushd mingw-w64-pthread
-  ../mingw-w64/mingw-w64-libraries/winpthreads/configure --host=i686-w64-mingw32 --prefix=$install_dir/i686-w64-mingw32/
+  ../mingw-w64/mingw-w64-libraries/winpthreads/configure --host=$gcc_target --prefix=$install_dir/$gcc_target/
   make
   make install
   popd
 
   pushd gcc-objdir
   make
   make install
   popd
 
   mkdir widl32
   pushd widl32
-  ../mingw-w64/mingw-w64-tools/widl/configure --prefix=$install_dir --target=i686-w64-mingw32
+  ../mingw-w64/mingw-w64-tools/widl/configure --prefix=$install_dir --target=$gcc_target
   make
   make install
   popd
 
+
   pushd $(dirname $install_dir)
   tar caf $root_dir/mingw32.tar.xz $(basename $install_dir)/
   popd
 }
--- a/taskcluster/ci/build/windows.yml
+++ b/taskcluster/ci/build/windows.yml
@@ -662,17 +662,17 @@ win32-mingw32/opt:
             - builds/releng_base_firefox.py
             - builds/releng_base_windows_32_mingw_builds.py
         need-xvfb: false
     toolchains:
         - mingw32-rust
         - linux64-upx
         - linux64-wine
         - linux64-sccache
-        - linux64-mingw32-gcc
+        - linux64-mingw32-gcc-x86
         - linux64-mingw32-nsis
         - linux64-mingw32-fxc2
 
 win32-mingw32/debug:
     description: "Win32 MinGW Debug"
     index:
         product: firefox
         job-name: win32-mingw32-debug
@@ -695,17 +695,17 @@ win32-mingw32/debug:
             - builds/releng_base_windows_32_mingw_builds.py
             - builds/releng_sub_windows_configs/32_mingw_debug.py
         need-xvfb: false
     toolchains:
         - mingw32-rust
         - linux64-upx
         - linux64-wine
         - linux64-sccache
-        - linux64-mingw32-gcc
+        - linux64-mingw32-gcc-x86
         - linux64-mingw32-nsis
         - linux64-mingw32-fxc2
 
 win64-mingw32/opt:
     description: "Win64 MinGW Opt"
     index:
         product: firefox
         job-name: win64-mingw32-opt
@@ -727,17 +727,17 @@ win64-mingw32/opt:
             - builds/releng_base_firefox.py
             - builds/releng_base_windows_64_mingw_builds.py
         need-xvfb: false
     toolchains:
         - mingw32-rust
         - linux64-upx
         - linux64-wine
         - linux64-sccache
-        - linux64-mingw32-gcc
+        - linux64-mingw32-gcc-x64
         - linux64-mingw32-nsis
         - linux64-mingw32-fxc2
 
 win64-mingw32/debug:
     description: "Win64 MinGW Debug"
     index:
         product: firefox
         job-name: win64-mingw32-debug
@@ -760,11 +760,11 @@ win64-mingw32/debug:
             - builds/releng_base_windows_64_mingw_builds.py
             - builds/releng_sub_windows_configs/64_mingw_debug.py
         need-xvfb: false
     toolchains:
         - mingw32-rust
         - linux64-upx
         - linux64-wine
         - linux64-sccache
-        - linux64-mingw32-gcc
+        - linux64-mingw32-gcc-x64
         - linux64-mingw32-nsis
         - linux64-mingw32-fxc2
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -509,30 +509,54 @@ linux64-wine:
     worker:
         docker-image: {in-tree: mingw32-build}
         max-run-time: 10800
     run:
         using: toolchain-script
         script: build-wine.sh
         toolchain-artifact: public/build/wine.tar.xz
 
-linux64-mingw32-gcc:
-    description: "GCC toolchain build for MinGW32 Cross Compile"
+linux64-mingw32-gcc-x86:
+    description: "x86 GCC toolchain build for MinGW32 Cross Compile"
     treeherder:
         kind: build
         platform: toolchains/opt
-        symbol: TMW(mingw32-gcc)
+        symbol: TMW(mingw32-gcc-x86)
         tier: 2
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         docker-image: {in-tree: mingw32-build}
         max-run-time: 10800
     run:
         using: toolchain-script
         script: build-gcc-mingw32.sh
+        arguments: [
+            'i686-w64-mingw32'
+        ]
+        resources:
+            - 'build/unix/build-gcc/build-gcc.sh'
+        toolchain-artifact: public/build/mingw32.tar.xz
+
+linux64-mingw32-gcc-x64:
+    description: "x64 GCC toolchain build for MinGW32 Cross Compile"
+    treeherder:
+        kind: build
+        platform: toolchains/opt
+        symbol: TMW(mingw32-gcc-x64)
+        tier: 2
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        docker-image: {in-tree: mingw32-build}
+        max-run-time: 10800
+    run:
+        using: toolchain-script
+        script: build-gcc-mingw32.sh
+        arguments: [
+            'x86_64-w64-mingw32'
+        ]
         resources:
             - 'build/unix/build-gcc/build-gcc.sh'
         toolchain-artifact: public/build/mingw32.tar.xz
 
 linux64-mingw32-nsis:
     description: "NSIS build for MinGW32 Cross Compile"
     treeherder:
         kind: build
@@ -543,17 +567,17 @@ linux64-mingw32-nsis:
     worker:
         docker-image: {in-tree: mingw32-build}
         max-run-time: 3600
     run:
         using: toolchain-script
         script: build-mingw32-nsis.sh
         toolchain-artifact: public/build/nsis.tar.xz
     toolchains:
-        - linux64-mingw32-gcc
+        - linux64-mingw32-gcc-x86
 
 linux64-mingw32-fxc2:
     description: "fxc2.exe build for MinGW32 Cross Compile"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TMW(mingw32-fxc2)
         tier: 2
@@ -561,9 +585,9 @@ linux64-mingw32-fxc2:
     worker:
         docker-image: {in-tree: mingw32-build}
         max-run-time: 1800
     run:
         using: toolchain-script
         script: build-mingw32-fxc2.sh
         toolchain-artifact: public/build/fxc2.tar.xz
     toolchains:
-        - linux64-mingw32-gcc
+        - linux64-mingw32-gcc-x86
--- a/taskcluster/scripts/misc/build-gcc-mingw32.sh
+++ b/taskcluster/scripts/misc/build-gcc-mingw32.sh
@@ -9,20 +9,21 @@ UPLOAD_DIR=$HOME/artifacts
 
 # Do not define root_dir so we build everything to a tmpdir
 #root_dir=$HOME_DIR
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 . $data_dir/build-gcc.sh
 
 gcc_version=6.4.0
+gcc_target=$1
 gcc_ext=xz
 binutils_version=2.27
 binutils_ext=bz2
-binutils_configure_flags="--target=i686-w64-mingw32"
+binutils_configure_flags="--target=$gcc_target"
 mingw_version=36d7b92bbcec1e72d3ce24013b01f7acc34be3b0
 
 # GPG keys used to sign GCC (collected from 5.1.0, 5.4.0, 6.4.0)
 $GPG --import $data_dir/33C235A34C46AA3FFB293709A328C3A2C3C45C06.key
 $GPG --import $data_dir/7F74F97C103468EE5D750B583AB00996FC26A641.key
 # GPG key used to sign binutils
 $GPG --import $data_dir/EAF1C276A747E9ED86210CBAC3126D3B4AE55E93.key
 # GPG key used to sign GMP