From 2d941255db3f4f2919b078a702c2f822911abc0a Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 12 Apr 2022 01:30:55 +0000 Subject: [PATCH] Bug 1758780 - Avoid building LLVM when building wasi compiler-rt. r=firefox-build-system-reviewers,mhentges Instead, do the same trick as for the wasi sysroot, and reuse clang itself. Differential Revision: https://phabricator.services.mozilla.com/D143171 --- taskcluster/ci/toolchain/compiler-rt.yml | 2 ++ taskcluster/scripts/misc/build-compiler-rt-wasi.sh | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/taskcluster/ci/toolchain/compiler-rt.yml b/taskcluster/ci/toolchain/compiler-rt.yml index c744784fdac4..cb25a0097558 100644 --- a/taskcluster/ci/toolchain/compiler-rt.yml +++ b/taskcluster/ci/toolchain/compiler-rt.yml @@ -223,3 +223,5 @@ wasm32-wasi-compiler-rt-13: fetch: - clang-13 - wasi-sdk + toolchain: + - linux64-clang-13-stage1 diff --git a/taskcluster/scripts/misc/build-compiler-rt-wasi.sh b/taskcluster/scripts/misc/build-compiler-rt-wasi.sh index 3c1d4c3b2781..d23e4b1e5a23 100755 --- a/taskcluster/scripts/misc/build-compiler-rt-wasi.sh +++ b/taskcluster/scripts/misc/build-compiler-rt-wasi.sh @@ -7,6 +7,17 @@ dir=${artifact%.tar.*} cd $MOZ_FETCHES_DIR/wasi-sdk LLVM_PROJ_DIR=$MOZ_FETCHES_DIR/llvm-project +mkdir -p build/install/wasi +# The wasi-sdk build system wants to build clang itself. We trick it into +# thinking it did, and put our own clang where it would have built its own. +ln -s $MOZ_FETCHES_DIR/clang build/llvm +touch build/llvm.BUILT + +# The wasi-sdk build system wants a clang and an ar binary in +# build/install/$PREFIX/bin +ln -s $MOZ_FETCHES_DIR/clang/bin build/install/wasi/bin +ln -s llvm-ar build/install/wasi/bin/ar + # Build compiler-rt make \ LLVM_PROJ_DIR=$LLVM_PROJ_DIR \