Bug 1434316 Add 64 bit MinGW gcc toolchains draft
authorTom Ritter <tom@mozilla.com>
Thu, 31 May 2018 12:10:50 -0500
changeset 810889 e1198d589dcab7476bf09a546f67574f569bfad5
parent 810888 70a80e16c3b01f51ab92cc8a7e5219b054520415
child 810890 cc0040a5ee967565cee1930260cf7d746cb6ea90
push id114148
push userbmo:tom@mozilla.com
push dateTue, 26 Jun 2018 17:25:32 +0000
bugs1434316
milestone60.1.0
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,49 @@ 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
@@ -546,17 +570,17 @@ linux64-mingw32-nsis:
     run:
         using: toolchain-script
         script: build-mingw32-nsis.sh
         resources:
             - 'build/unix/build-gcc/build-gcc.sh'
             - 'taskcluster/scripts/misc/build-gcc-mingw32.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
@@ -567,9 +591,9 @@ linux64-mingw32-fxc2:
     run:
         using: toolchain-script
         script: build-mingw32-fxc2.sh
         resources:
             - 'build/unix/build-gcc/build-gcc.sh'
             - 'taskcluster/scripts/misc/build-gcc-mingw32.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,21 +9,22 @@ 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"
-mingw_version=bcf1f29d6dc80b6025b416bef104d2314fa9be57
+binutils_configure_flags="--target=$gcc_target"
+mingw_version=ee9fc3d0b8c8868280e38384edd968067b8e71fc
 
 # 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
 $GPG --import $data_dir/343C2FF0FBEE5EC2EDBEF399F3599FF828C67298.key