Bug 1486998 - Use the binutils toolchain instead of gcc for builds using clang. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 29 Aug 2018 14:35:46 +0900
changeset 482308 6fd2ee9bacf2869ba06830ea0e15da28ef2dea75
parent 482307 a2b4fe76a3806a99aacb9be6306b31cf10813011
child 482309 7d527975aa0e9ee49b01c3120f4738e254a4424f
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersfroydnj
bugs1486998
milestone63.0a1
Bug 1486998 - Use the binutils toolchain instead of gcc for builds using clang. r=froydnj This avoids downloading and unpacking a large package that we only use for binutils when building with clang. Differential Revision: https://phabricator.services.mozilla.com/D4516
build/unix/mozconfig.asan
build/unix/mozconfig.linux
build/unix/mozconfig.lto
build/unix/mozconfig.stdcxx
build/unix/mozconfig.tsan
taskcluster/ci/build/linux.yml
taskcluster/ci/valgrind/kind.yml
--- a/build/unix/mozconfig.asan
+++ b/build/unix/mozconfig.asan
@@ -2,20 +2,20 @@ MOZ_AUTOMATION_L10N_CHECK=0
 
 . "$topsrcdir/build/mozconfig.common"
 
 # Use Clang as specified in manifest
 export CC="$topsrcdir/clang/bin/clang -fgnu89-inline"
 export CXX="$topsrcdir/clang/bin/clang++"
 export LLVM_SYMBOLIZER="$topsrcdir/clang/bin/llvm-symbolizer"
 
-# Use a newer binutils, from the tooltool gcc package, if it's there
-if [ -e "$topsrcdir/gcc/bin/ld" ]; then
-    export CC="$CC -B $topsrcdir/gcc/bin"
-    export CXX="$CXX -B $topsrcdir/gcc/bin"
+# Use a newer binutils, if it's there
+if [ -e "$topsrcdir/binutils/bin/ld" ]; then
+    export CC="$CC -B $topsrcdir/binutils/bin"
+    export CXX="$CXX -B $topsrcdir/binutils/bin"
 fi
 
 # Enable ASan specific code and build workarounds
 ac_add_options --enable-address-sanitizer
 
 # Mandatory options required for ASan builds (both on Linux and Mac)
 export MOZ_DEBUG_SYMBOLS=1
 ac_add_options --enable-debug-symbols
--- a/build/unix/mozconfig.linux
+++ b/build/unix/mozconfig.linux
@@ -5,19 +5,21 @@ fi
 
 . "$topsrcdir/build/mozconfig.common"
 
 TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 
 if [ -n "$FORCE_GCC" -o -n "$MOZ_PGO" ]; then
     CC="$TOOLTOOL_DIR/gcc/bin/gcc"
     CXX="$TOOLTOOL_DIR/gcc/bin/g++"
+
+    # We want to make sure we use binutils and other binaries in the tooltool
+    # package.
+    mk_add_options "export PATH=$TOOLTOOL_DIR/gcc/bin:$PATH"
 else
     CC="$TOOLTOOL_DIR/clang/bin/clang"
     CXX="$TOOLTOOL_DIR/clang/bin/clang++"
     export ENABLE_CLANG_PLUGIN=1
+
+    mk_add_options "export PATH=$TOOLTOOL_DIR/binutils/bin:$PATH"
 fi
 
-# We want to make sure we use binutils and other binaries in the tooltool
-# package.
-mk_add_options "export PATH=$TOOLTOOL_DIR/gcc/bin:$PATH"
-
 . "$topsrcdir/build/unix/mozconfig.stdcxx"
--- a/build/unix/mozconfig.lto
+++ b/build/unix/mozconfig.lto
@@ -5,20 +5,20 @@ MOZ_AUTOMATION_L10N_CHECK=0
 # Use Clang as specified in manifest
 export AR="$topsrcdir/clang/bin/llvm-ar"
 export NM="$topsrcdir/clang/bin/llvm-nm"
 export RANLIB="$topsrcdir/clang/bin/llvm-ranlib"
 
 export CC="$topsrcdir/clang/bin/clang"
 export CXX="$topsrcdir/clang/bin/clang++"
 
-# Use a newer binutils, from the tooltool gcc package, if it's there
-if [ -e "$topsrcdir/gcc/bin/ld" ]; then
-    export CC="$CC -B $topsrcdir/gcc/bin"
-    export CXX="$CXX -B $topsrcdir/gcc/bin"
+# Use a newer binutils, if it's there
+if [ -e "$topsrcdir/binutils/bin/ld" ]; then
+    export CC="$CC -B $topsrcdir/binutils/bin"
+    export CXX="$CXX -B $topsrcdir/binutils/bin"
 fi
 
 ac_add_options --enable-lto
 # Until it's either made the default or we figure a way to remove the
 # copy locations that LTO induces in non-PIE executables.
 ac_add_options --enable-pie
 
 . "$topsrcdir/build/unix/mozconfig.stdcxx"
--- a/build/unix/mozconfig.stdcxx
+++ b/build/unix/mozconfig.stdcxx
@@ -8,12 +8,12 @@ TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 # lib or lib32. The directory for 64-bits libraries is always lib64.
 if [ -f "$TOOLTOOL_DIR/gcc/lib64/libstdc++.so" ]; then
   # We put both 32-bits and 64-bits library path in LD_LIBRARY_PATH: ld.so
   # will prefer the files in the 32-bits path when loading 32-bits executables,
   # and the files in the 64-bits path when loading 64-bits executables.
   # We also put both possible 32-bits library paths.
   LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/gcc/lib32:$TOOLTOOL_DIR/gcc/lib
 elif [ -f "$TOOLTOOL_DIR/clang/lib/libstdc++.so" ]; then
-  LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/clang/lib
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/clang/lib:$TOOLTOOL_DIR/clang/lib32
 fi
 
 mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
--- a/build/unix/mozconfig.tsan
+++ b/build/unix/mozconfig.tsan
@@ -2,20 +2,20 @@ MOZ_AUTOMATION_L10N_CHECK=0
 
 . "$topsrcdir/build/mozconfig.common"
 
 # Use Clang as specified in manifest
 export CC="$topsrcdir/clang/bin/clang"
 export CXX="$topsrcdir/clang/bin/clang++"
 export LLVM_SYMBOLIZER="$topsrcdir/clang/bin/llvm-symbolizer"
 
-# Use a newer binutils, from the tooltool gcc package, if it's there
-if [ -e "$topsrcdir/gcc/bin/ld" ]; then
-    export CC="$CC -B $topsrcdir/gcc/bin"
-    export CXX="$CXX -B $topsrcdir/gcc/bin"
+# Use a newer binutils, if it's there
+if [ -e "$topsrcdir/binutils/bin/ld" ]; then
+    export CC="$CC -B $topsrcdir/binutils/bin"
+    export CXX="$CXX -B $topsrcdir/binutils/bin"
 fi
 
 # Enable TSan specific code and build workarounds
 ac_add_options --enable-thread-sanitizer
 
 # The ThreadSanitizer is not compatible with sandboxing
 # (see bug 1182565)
 ac_add_options --disable-sandbox
--- a/taskcluster/ci/build/linux.yml
+++ b/taskcluster/ci/build/linux.yml
@@ -17,18 +17,18 @@ linux64/opt:
         config:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-plain/opt:
     description: "Linux64 Opt Plain"
@@ -49,18 +49,18 @@ linux64-plain/opt:
         config:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
             - builds/releng_sub_linux_configs/64_plain_opt.py
         script: mozharness/scripts/fx_desktop_build.py
         tooltool-downloads: public
     run-on-projects: [trunk]
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-node
         - linux64-cbindgen
 
 linux64-dmd/opt:
     description: "Linux64 DMD Opt"
     index:
         product: firefox
@@ -81,18 +81,18 @@ linux64-dmd/opt:
         script: "mozharness/scripts/fx_desktop_build.py"
         extra-config:
             mozconfig_variant: 'opt-dmd'
         secrets: true
         tooltool-downloads: public
         need-xvfb: true
     run-on-projects: []
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64/pgo:
     description: "Linux64 PGO"
@@ -183,18 +183,18 @@ linux64/debug:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: debug
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-cbindgen
         - linux64-sccache
         - linux64-rust
         - linux64-rust-size
         - linux64-node
 
 linux64-plain/debug:
     description: "Linux64 Debug Plain"
@@ -215,18 +215,18 @@ linux64-plain/debug:
         config:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
             - builds/releng_sub_linux_configs/64_plain_debug.py
         script: mozharness/scripts/fx_desktop_build.py
         tooltool-downloads: public
     run-on-projects: [trunk]
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-node
         - linux64-cbindgen
 
 linux64-devedition-nightly/opt:
     description: "Linux64 devedition Nightly"
     attributes:
         nightly: true
@@ -352,18 +352,18 @@ linux/opt:
         config:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_32_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux/debug:
     description: "Linux32 Debug"
@@ -386,18 +386,18 @@ linux/debug:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_32_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: debug
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux/pgo:
     description: "Linux32 PGO"
@@ -459,18 +459,18 @@ linux-rusttests/opt:
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: rusttests
         tooltool-downloads: public
         keep-artifacts: false
         need-xvfb: true
     run-on-projects: ['trunk', 'try']
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux-rusttests/debug:
     description: "Linux32 Rust tests Debug"
     index:
@@ -495,18 +495,18 @@ linux-rusttests/debug:
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: rusttests-debug
         tooltool-downloads: public
         keep-artifacts: false
         need-xvfb: true
     run-on-projects: ['trunk', 'try']
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux-devedition-nightly/opt:
     description: "Linux32 devedition Nightly"
     attributes:
@@ -609,18 +609,18 @@ linux64-asan/opt:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: asan-tc
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-asan-fuzzing/opt:
     description: "Linux64 Fuzzing Opt ASAN"
@@ -642,18 +642,18 @@ linux64-asan-fuzzing/opt:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: fuzzing-asan-tc
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-asan-fuzzing-ccov/opt:
     description: "Linux64 Fuzzing Opt ASAN w/ Coverage"
@@ -677,18 +677,18 @@ linux64-asan-fuzzing-ccov/opt:
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         extra-config:
             mozconfig_variant: 'asan-fuzzing-ccov'
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-fuzzing-ccov/opt:
     description: "Linux64 Fuzzing Opt w/ Coverage"
@@ -750,18 +750,18 @@ linux64-asan-reporter-nightly/opt:
             - builds/releng_base_linux_64_builds.py
             - taskcluster_nightly.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: asan-reporter-tc
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-asan/debug:
     description: "Linux64 Debug ASAN"
@@ -783,18 +783,18 @@ linux64-asan/debug:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: asan-tc-and-debug
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-lto/opt:
     description: "Linux64 Opt LTO"
@@ -817,18 +817,18 @@ linux64-lto/opt:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: lto-tc
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-lto/debug:
     description: "Linux64 Debug LTO"
@@ -851,18 +851,18 @@ linux64-lto/debug:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: lto-tc-and-debug
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-nightly/opt:
     description: "Linux64 Nightly"
@@ -924,18 +924,18 @@ linux64-noopt/debug:
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: noopt-debug
         tooltool-downloads: public
         keep-artifacts: false
         need-xvfb: true
     run-on-projects: ['trunk', 'try']
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-rusttests/opt:
     description: "Linux64 Rust tests Opt"
@@ -960,18 +960,18 @@ linux64-rusttests/opt:
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: rusttests
         tooltool-downloads: public
         keep-artifacts: false
         need-xvfb: true
     run-on-projects: ['trunk', 'try']
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-rusttests/debug:
     description: "Linux64 Rust tests Debug"
     index:
@@ -995,18 +995,18 @@ linux64-rusttests/debug:
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: rusttests-debug
         tooltool-downloads: public
         keep-artifacts: false
         need-xvfb: true
     run-on-projects: ['trunk', 'try']
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-tup/opt:
     description: "Linux64 Tup"
     index:
@@ -1028,18 +1028,18 @@ linux64-tup/opt:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: tup
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust-nightly
         - linux64-cbindgen
         - linux64-sccache
         - linux64-tup
         - linux64-node
 
 linux64-jsdcov/opt:
     description: "Linux64-JSDCov Opt"
@@ -1060,18 +1060,18 @@ linux64-jsdcov/opt:
         config:
             - builds/releng_base_firefox.py
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
 
 linux64-ccov/debug:
     description: "Linux64-CCov Debug"
     index:
@@ -1160,15 +1160,15 @@ linux64-add-on-devel/opt:
             - builds/releng_base_linux_64_builds.py
         script: "mozharness/scripts/fx_desktop_build.py"
         secrets: true
         custom-build-variant-cfg: add-on-devel
         tooltool-downloads: public
         need-xvfb: true
     run-on-projects: ['mozilla-beta', 'mozilla-release', 'mozilla-esr45']
     toolchains:
+        - linux64-binutils
         - linux64-clang
-        - linux64-gcc
         - linux64-rust
         - linux64-rust-size
         - linux64-cbindgen
         - linux64-sccache
         - linux64-node
--- a/taskcluster/ci/valgrind/kind.yml
+++ b/taskcluster/ci/valgrind/kind.yml
@@ -38,14 +38,14 @@ jobs:
             config:
                 - builds/releng_base_firefox.py
                 - builds/releng_base_linux_64_builds.py
             script: "mozharness/scripts/fx_desktop_build.py"
             secrets: true
             tooltool-downloads: public
             need-xvfb: true
         toolchains:
+            - linux64-binutils
             - linux64-clang
-            - linux64-gcc
             - linux64-rust
             - linux64-cbindgen
             - linux64-sccache
             - linux64-node