From 907f9b6aabdef67b1f79b0c19cae7f3e1d906d64 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 9 Feb 2021 00:44:02 +0000 Subject: [PATCH] Bug 1690937 - Build sccache with a sysroot. r=firefox-build-system-reviewers,sheehan,mhentges We can't use the system compiler (gcc) because of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786883 (which despite being closed, still is a problem) We could use the linux64-gcc toolchain, but since we're using clang on other platforms, we might as well do the same. Differential Revision: https://phabricator.services.mozilla.com/D104129 --- taskcluster/ci/toolchain/sccache.yml | 3 +++ taskcluster/scripts/misc/build-sccache.sh | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/taskcluster/ci/toolchain/sccache.yml b/taskcluster/ci/toolchain/sccache.yml index f5b5e200bcba..99fa5441b959 100644 --- a/taskcluster/ci/toolchain/sccache.yml +++ b/taskcluster/ci/toolchain/sccache.yml @@ -21,13 +21,16 @@ linux64-sccache: symbol: TL(sccache) worker-type: b-linux worker: + docker-image: {in-tree: deb10-toolchain-build} max-run-time: 1800 run: toolchain-artifact: public/build/sccache.tar.xz fetches: toolchain: - linux64-rust-1.47 + - linux64-clang-11 - linux64-binutils + - linux64-sysroot macosx64-sccache: treeherder: diff --git a/taskcluster/scripts/misc/build-sccache.sh b/taskcluster/scripts/misc/build-sccache.sh index a2df62ac2a05..091141ad87d5 100755 --- a/taskcluster/scripts/misc/build-sccache.sh +++ b/taskcluster/scripts/misc/build-sccache.sh @@ -33,14 +33,16 @@ COMMON_FEATURES="native-zlib" case "$(uname -s)" in Linux) + export CC="$MOZ_FETCHES_DIR/clang/bin/clang" if [ "$TARGET" == "x86_64-apple-darwin" ]; then export PATH="$MOZ_FETCHES_DIR/llvm-dsymutil/bin:$PATH" export PATH="$MOZ_FETCHES_DIR/cctools/bin:$PATH" export RUSTFLAGS="-C linker=$GECKO_PATH/taskcluster/scripts/misc/osx-cross-linker" - export CC="$MOZ_FETCHES_DIR/clang/bin/clang" export TARGET_CC="$MOZ_FETCHES_DIR/clang/bin/clang -isysroot $MOZ_FETCHES_DIR/MacOSX10.12.sdk" cargo build --features "all $COMMON_FEATURES" --verbose --release --target $TARGET else + export CFLAGS_x86_64_unknown_linux_gnu="--sysroot=$MOZ_FETCHES_DIR/sysroot" + export RUSTFLAGS="-C linker=$CC -C link-arg=--sysroot=$MOZ_FETCHES_DIR/sysroot" cargo build --features "all dist-server openssl/vendored $COMMON_FEATURES" --verbose --release fi