diff --git a/taskcluster/ci/toolchain/clang.yml b/taskcluster/ci/toolchain/clang.yml index 757bdb8ea38d..13f12cca60cc 100644 --- a/taskcluster/ci/toolchain/clang.yml +++ b/taskcluster/ci/toolchain/clang.yml @@ -244,17 +244,15 @@ linux64-clang-13-win-cross: toolchain-alias: linux64-clang-win-cross toolchain-artifact: public/build/clang.tar.zst dependencies: - win32-compiler-rt-13: toolchain-win32-compiler-rt-13 - win64-compiler-rt-13: toolchain-win64-compiler-rt-13 + win64-clang-13-2stage: toolchain-win64-clang-13-2stage fetches: toolchain: - linux64-clang-13 - win32-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86 - win64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86_64 + win64-clang-13-2stage: + # Put this into a new directory so it doesn't conflict with the linux toolchain + - artifact: clang.tar.zst + dest: clang-cl + extract: false macosx64-clang-13-raw: description: "Clang 13 toolchain build" diff --git a/taskcluster/ci/toolchain/compiler-rt.yml b/taskcluster/ci/toolchain/compiler-rt.yml index a1f152651093..0fd200bad7bf 100644 --- a/taskcluster/ci/toolchain/compiler-rt.yml +++ b/taskcluster/ci/toolchain/compiler-rt.yml @@ -127,66 +127,6 @@ macosx64-aarch64-compiler-rt-13: - linux64-clang-13-stage1 - macosx64-sdk-11.0 -win32-compiler-rt-13: - description: "win32 x86 Compiler-rt for Clang 13 toolchain build" - treeherder: - symbol: TW32(crt-13) - worker: - env: - TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/vs2017-15.9.manifest" - run: - arguments: - - i686-pc-windows-msvc - resources: - - 'taskcluster/scripts/misc/tooltool-download.sh' - tooltool-downloads: internal - fetches: - fetch: - - clang-13 - toolchain: - - linux64-clang-13-stage1 - - linux64-liblowercase - -win64-compiler-rt-13: - description: "win64 x64 Compiler-rt for Clang 13 toolchain build" - treeherder: - symbol: TW64(crt-13) - worker: - env: - TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/vs2017-15.9.manifest" - run: - arguments: - - x86_64-pc-windows-msvc - resources: - - 'taskcluster/scripts/misc/tooltool-download.sh' - tooltool-downloads: internal - fetches: - fetch: - - clang-13 - toolchain: - - linux64-clang-13-stage1 - - linux64-liblowercase - -win64-aarch64-compiler-rt-13: - description: "win64 aarch64 Compiler-rt for Clang 13 toolchain build" - treeherder: - symbol: TW64(aarch64-crt-13) - worker: - env: - TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/vs2017-15.9.manifest" - run: - arguments: - - aarch64-pc-windows-msvc - resources: - - 'taskcluster/scripts/misc/tooltool-download.sh' - tooltool-downloads: internal - fetches: - fetch: - - clang-13 - toolchain: - - linux64-clang-13-stage1 - - linux64-liblowercase - wasm32-wasi-compiler-rt-13: description: "wasm32-wasi Compiler-rt for Clang 13 toolchain build" treeherder: diff --git a/taskcluster/scripts/misc/build-compiler-rt.sh b/taskcluster/scripts/misc/build-compiler-rt.sh index db092d2c72d8..4d5eda38bd93 100755 --- a/taskcluster/scripts/misc/build-compiler-rt.sh +++ b/taskcluster/scripts/misc/build-compiler-rt.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -e -x +set -e target=$1 shift @@ -107,38 +107,6 @@ aarch64-unknown-linux-gnu) " PATH="$MOZ_FETCHES_DIR/binutils/bin:$PATH" ;; -*-pc-windows-msvc) - VSPATH="$MOZ_FETCHES_DIR/vs2017_15.9.6" - SDK_VERSION=10.0.17134.0 - - export INCLUDE="${VSPATH}/VC/include;${VSPATH}/VC/atlmfc/include;${VSPATH}/SDK/Include/${SDK_VERSION}/ucrt;${VSPATH}/SDK/Include/${SDK_VERSION}/shared;${VSPATH}/SDK/Include/${SDK_VERSION}/um" - case "$target" in - i686-pc-windows-msvc) - VCARCH=x86 - ;; - x86_64-pc-windows-msvc) - VCARCH=x64 - ;; - aarch64-pc-windows-msvc) - VCARCH=arm64 - ;; - esac - export LIB="${VSPATH}/VC/lib/${VCARCH};${VSPATH}/VC/atlmfc/lib/${VCARCH};${VSPATH}/SDK/Lib/${SDK_VERSION}/um/${VCARCH};${VSPATH}/SDK/Lib/${SDK_VERSION}/ucrt/${VCARCH}" - export LD_PRELOAD=$MOZ_FETCHES_DIR/liblowercase/liblowercase.so - export LOWERCASE_DIRS=$VSPATH - clang=$MOZ_FETCHES_DIR/clang/bin/clang-cl - clangxx=$clang - ar=lib - EXTRA_CMAKE_FLAGS=" - -DCMAKE_SYSTEM_NAME=Windows - -DCMAKE_LINKER=$MOZ_FETCHES_DIR/clang/bin/lld-link - -DCMAKE_MT=$MOZ_FETCHES_DIR/clang/bin/llvm-mt - -DCMAKE_RC_COMPILER=$MOZ_FETCHES_DIR/clang/bin/llvm-rc - -DCMAKE_C_FLAGS=--target=$target - -DCMAKE_CXX_FLAGS=--target=$target - -DCMAKE_ASM_FLAGS=--target=$target - " - ;; *) echo $target is not supported yet exit 1 @@ -160,11 +128,11 @@ eval cmake \ $MOZ_FETCHES_DIR/llvm-project/compiler-rt \ -GNinja \ -DCMAKE_C_COMPILER=$clang \ - -DCMAKE_CXX_COMPILER=${clangxx:-$clang++} \ + -DCMAKE_CXX_COMPILER=$clang++ \ -DCMAKE_C_COMPILER_TARGET=$target \ -DCMAKE_CXX_COMPILER_TARGET=$target \ -DCMAKE_ASM_COMPILER_TARGET=$target \ - -DCMAKE_AR=$MOZ_FETCHES_DIR/clang/bin/llvm-${ar:-ar} \ + -DCMAKE_AR=$MOZ_FETCHES_DIR/clang/bin/llvm-ar \ -DCMAKE_RANLIB=$MOZ_FETCHES_DIR/clang/bin/llvm-ranlib \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_ASSERTIONS=OFF \ diff --git a/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh b/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh index 0571f46a24d8..7f0c492c8b95 100755 --- a/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh +++ b/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh @@ -1,19 +1,15 @@ #!/bin/bash set -x -e -v -# This script is for building clang for windows targets on a Linux host, -# including native Windows Compiler-RT libraries. +# This script is to repack a linux clang with Windows clang-cl.exe and compiler runtime. cd $MOZ_FETCHES_DIR -# We have a native linux64 toolchain in $MOZ_FETCHES_DIR/clang -# We have a native x86 windows compiler-rt in $MOZ_FETCHES_DIR/x86/compiler-rt -# We have a native x86_64 windows compiler-rt in $MOZ_FETCHES_DIR/x86_64/compiler-rt -clang_lib=$(echo clang/lib/clang/*/lib) -mkdir -p $clang_lib/windows -cp x86/compiler-rt/lib/windows/* $clang_lib/windows -cp x86_64/compiler-rt/lib/windows/* $clang_lib/windows +# We already have the Linux clang extracted in $MOZ_FETCHES_DIR/clang by fetch-content +# We have a non-extracted clang-cl/clang.tar.zst for Windows clang-cl that we need to extract +# files from. +$GECKO_PATH/taskcluster/scripts/misc/zstdpy -d clang-cl/clang.tar.zst | tar -x --wildcards clang/lib/clang/*/lib/windows tar caf clang.tar.zst clang # Put a tarball in the artifacts dir