From 66c474fcb9c0c5fd8ebe56a420e4f4fc8252efe0 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 12 Feb 2021 22:28:02 +0000 Subject: [PATCH] Bug 1692416 - Add a toolchain for arm64 mac cbindgen. r=firefox-build-system-reviewers,andi,dmajor Differential Revision: https://phabricator.services.mozilla.com/D104978 --- taskcluster/ci/toolchain/cbindgen.yml | 15 +++++++++++++++ taskcluster/scripts/misc/build-cbindgen.sh | 12 +++++++++--- taskcluster/scripts/misc/osx-cross-linker | 6 +++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/taskcluster/ci/toolchain/cbindgen.yml b/taskcluster/ci/toolchain/cbindgen.yml index 966f253a93d8..9933a3ef70ff 100644 --- a/taskcluster/ci/toolchain/cbindgen.yml +++ b/taskcluster/ci/toolchain/cbindgen.yml @@ -46,6 +46,21 @@ macosx64-cbindgen: - linux64-rust-macos-1.47 - macosx64-sdk-10.12 +macosx64-aarch64-cbindgen: + treeherder: + symbol: TM(cbindgen-arm64) + worker: + docker-image: {in-tree: deb10-toolchain-build} + run: + arguments: ['aarch64-apple-darwin'] + fetches: + toolchain: + - linux64-cctools-port-clang-11 + - linux64-clang-11 + - linux64-llvm-dsymutil + - linux64-rust-macos-1.49 + - macosx64-sdk-11.0 + win64-cbindgen: treeherder: symbol: TW64(cbindgen) diff --git a/taskcluster/scripts/misc/build-cbindgen.sh b/taskcluster/scripts/misc/build-cbindgen.sh index 4eade9438dfa..0a38488a69b4 100755 --- a/taskcluster/scripts/misc/build-cbindgen.sh +++ b/taskcluster/scripts/misc/build-cbindgen.sh @@ -25,15 +25,21 @@ if [ -n "$TOOLTOOL_MANIFEST" ]; then fi # OSX cross builds are a bit harder -if [ "$TARGET" == "x86_64-apple-darwin" ]; then +case "$TARGET" in +*-apple-darwin) 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 + if test "$TARGET" = "aarch64-apple-darwin"; then + export SDK_VER=11.0 + fi + ;; +x86_64-unknown-linux-gnu) 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 + ;; +esac export PATH="$(cd $MOZ_FETCHES_DIR && pwd)/rustc/bin:$PATH" diff --git a/taskcluster/scripts/misc/osx-cross-linker b/taskcluster/scripts/misc/osx-cross-linker index f0827b01fa39..2c3f2b51071c 100755 --- a/taskcluster/scripts/misc/osx-cross-linker +++ b/taskcluster/scripts/misc/osx-cross-linker @@ -1,7 +1,7 @@ exec $MOZ_FETCHES_DIR/clang/bin/clang -v \ - -fuse-ld=$MOZ_FETCHES_DIR/cctools/bin/x86_64-apple-darwin-ld \ - -mmacosx-version-min=10.12 \ + -fuse-ld=$MOZ_FETCHES_DIR/cctools/bin/$TARGET-ld \ + -mmacosx-version-min=${SDK_VER:-10.12} \ -target $TARGET \ -B $MOZ_FETCHES_DIR/cctools/bin \ - -isysroot $MOZ_FETCHES_DIR/MacOSX10.12.sdk \ + -isysroot $MOZ_FETCHES_DIR/MacOSX${SDK_VER:-10.12}.sdk \ "$@"