From 509fddfd3becbc4ff8eacf26a98aaaeacb08b07c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 9 Feb 2021 00:44:03 +0000 Subject: [PATCH] Bug 1690937 - Build cbindgen with a sysroot. r=firefox-build-system-reviewers,sheehan,mhentges Similarly to sccache, we need to use clang. Differential Revision: https://phabricator.services.mozilla.com/D104134 --- taskcluster/ci/toolchain/cbindgen.yml | 3 +++ taskcluster/scripts/misc/build-cbindgen.sh | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/taskcluster/ci/toolchain/cbindgen.yml b/taskcluster/ci/toolchain/cbindgen.yml index 8ed16bc7fac6..9eb9a74a6330 100644 --- a/taskcluster/ci/toolchain/cbindgen.yml +++ b/taskcluster/ci/toolchain/cbindgen.yml @@ -23,12 +23,15 @@ linux64-cbindgen: treeherder: symbol: TL(cbindgen) worker: + docker-image: {in-tree: deb10-toolchain-build} max-run-time: 1800 run: arguments: ['x86_64-unknown-linux-gnu'] fetches: toolchain: + - linux64-clang-11 - linux64-rust-1.47 + - linux64-sysroot macosx64-cbindgen: treeherder: diff --git a/taskcluster/scripts/misc/build-cbindgen.sh b/taskcluster/scripts/misc/build-cbindgen.sh index 33127d90fb53..4eade9438dfa 100755 --- a/taskcluster/scripts/misc/build-cbindgen.sh +++ b/taskcluster/scripts/misc/build-cbindgen.sh @@ -29,6 +29,10 @@ 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" +elif [ "$TARGET" == "x86_64-unknown-linux-gnu" ]; then + export CC="$MOZ_FETCHES_DIR/clang/bin/clang" + 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" fi export PATH="$(cd $MOZ_FETCHES_DIR && pwd)/rustc/bin:$PATH"