# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
task-defaults:
    worker-type: b-linux-docker-amd
    worker:
        max-run-time: 1800
    run:
        using: toolchain-script
        script: build-compiler-rt.sh

wasm32-wasi-compiler-rt-17:
    description: "wasm32-wasi Compiler-rt for Clang 17 toolchain build"
    treeherder:
        symbol: TL(wasi-crt-17)
    worker-type: b-linux-docker-xlarge-amd
    run:
        script: build-compiler-rt-wasi.sh
        arguments:
            - wasi-sdk.patch
        resources:
            - taskcluster/scripts/misc/wasi-sdk.patch
        toolchain-artifact: public/build/compiler-rt-wasm32-wasi.tar.zst
    fetches:
        fetch:
            - clang-17
            - wasi-sdk
        toolchain:
            - linux64-clang-17-raw

android-aarch64-compiler-rt-19:
    description: "android aarch64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TA(aarch64-crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-linux-android.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - linux64-android-ndk-linux-repack

android-arm-compiler-rt-19:
    description: "android arm Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TA(arm-crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-armv7-linux-android.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - linux64-android-ndk-linux-repack

android-x64-compiler-rt-19:
    description: "android x64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TA(x64-crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-linux-android.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - linux64-android-ndk-linux-repack

linux64-x86-compiler-rt-19:
    description: "Linux x86 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TL32(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-i686-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - sysroot-i686-linux-gnu

linux64-x64-compiler-rt-19:
    description: "Linux x64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TL(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - sysroot-x86_64-linux-gnu

linux64-aarch64-compiler-rt-19:
    description: "Linux aarch64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TLA64(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - sysroot-aarch64-linux-gnu

macosx64-x64-compiler-rt-19:
    description: "macOS x64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TM(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-apple-darwin.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - macosx64-sdk-toolchain

macosx64-aarch64-compiler-rt-19:
    description: "macOS aarch64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TMA64(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-apple-darwin.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - macosx64-sdk-toolchain

win32-compiler-rt-19:
    description: "win32 x86 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TW32(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-i686-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - vs-toolchain

win64-compiler-rt-19:
    description: "win64 x64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TW64(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
            - build/build-clang/win64-compiler-rt-19.json
        resources:
            - build/build-clang/clang-19.json
            - build/build-clang/win64-compiler-rt-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - vs-toolchain

win64-aarch64-compiler-rt-19:
    description: "Win64 Aarch64 Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TWA64(crt-19)
    run:
        arguments:
            - build/build-clang/clang-19.json
        resources:
            - build/build-clang/clang-19.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-19
        toolchain:
            - linux64-clang-19-stage1
            - vs-toolchain

wasm32-wasi-compiler-rt-19:
    description: "wasm32-wasi Compiler-rt for Clang 19 toolchain build"
    treeherder:
        symbol: TL(wasi-crt-19)
    worker-type: b-linux-docker-xlarge-amd
    run:
        script: build-compiler-rt-wasi.sh
        arguments:
            - wasi-sdk.patch
        resources:
            - taskcluster/scripts/misc/wasi-sdk.patch
        toolchain-artifact: public/build/compiler-rt-wasm32-wasi.tar.zst
    fetches:
        fetch:
            - clang-19
            - wasi-sdk
        toolchain:
            - linux64-clang-19-stage1

android-aarch64-compiler-rt-20:
    description: "android aarch64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TA(aarch64-crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-linux-android.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - linux64-android-ndk-linux-repack

android-arm-compiler-rt-20:
    description: "android arm Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TA(arm-crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-armv7-linux-android.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - linux64-android-ndk-linux-repack

android-x64-compiler-rt-20:
    description: "android x64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TA(x64-crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-linux-android.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - linux64-android-ndk-linux-repack

linux64-x86-compiler-rt-20:
    description: "Linux x86 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TL32(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-i686-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - sysroot-i686-linux-gnu

linux64-x64-compiler-rt-20:
    description: "Linux x64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TL(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - sysroot-x86_64-linux-gnu

linux64-aarch64-compiler-rt-20:
    description: "Linux aarch64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TLA64(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - sysroot-aarch64-linux-gnu

macosx64-x64-compiler-rt-20:
    description: "macOS x64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TM(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-apple-darwin.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - macosx64-sdk-toolchain

macosx64-aarch64-compiler-rt-20:
    description: "macOS aarch64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TMA64(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-apple-darwin.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - macosx64-sdk-toolchain

win32-compiler-rt-20:
    description: "win32 x86 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TW32(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-i686-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - vs-toolchain

win64-compiler-rt-20:
    description: "win64 x64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TW64(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - vs-toolchain

win64-aarch64-compiler-rt-20:
    description: "Win64 Aarch64 Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TWA64(crt-20)
    run:
        arguments:
            - build/build-clang/clang-20.json
        resources:
            - build/build-clang/clang-20.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-20
        toolchain:
            - linux64-clang-20-stage1
            - vs-toolchain

wasm32-wasi-compiler-rt-20:
    description: "wasm32-wasi Compiler-rt for Clang 20 toolchain build"
    treeherder:
        symbol: TL(wasi-crt-20)
    worker-type: b-linux-docker-xlarge-amd
    run:
        script: build-compiler-rt-wasi.sh
        arguments:
            - wasi-sdk.patch
        resources:
            - taskcluster/scripts/misc/wasi-sdk.patch
        toolchain-artifact: public/build/compiler-rt-wasm32-wasi.tar.zst
    fetches:
        fetch:
            - clang-20
            - wasi-sdk
        toolchain:
            - linux64-clang-20-stage1

android-aarch64-compiler-rt-trunk:
    description: "android aarch64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TA(aarch64-crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-linux-android.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-android-ndk-linux-repack

android-arm-compiler-rt-trunk:
    description: "android arm Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TA(arm-crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-armv7-linux-android.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-android-ndk-linux-repack

android-x64-compiler-rt-trunk:
    description: "android x64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TA(x64-crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-linux-android.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-android-ndk-linux-repack

linux64-x86-compiler-rt-trunk:
    description: "Linux x86 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL32(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-i686-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - sysroot-i686-linux-gnu

linux64-x64-compiler-rt-trunk:
    description: "Linux x64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - sysroot-x86_64-linux-gnu

linux64-aarch64-compiler-rt-trunk:
    description: "Linux aarch64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TLA64(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-unknown-linux-gnu.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - sysroot-aarch64-linux-gnu

macosx64-x64-compiler-rt-trunk:
    description: "macOS x64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TM(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-apple-darwin.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - macosx64-sdk-toolchain

macosx64-aarch64-compiler-rt-trunk:
    description: "macOS aarch64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TMA64(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-apple-darwin.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - macosx64-sdk-toolchain

win32-compiler-rt-trunk:
    description: "win32 x86 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TW32(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-i686-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - vs-toolchain

win64-compiler-rt-trunk:
    description: "win64 x64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TW64(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-x86_64-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - vs-toolchain

win64-aarch64-compiler-rt-trunk:
    description: "Win64 Aarch64 Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TWA64(crt-trunk)
    run:
        arguments:
            - build/build-clang/clang-trunk.json
        resources:
            - build/build-clang/clang-trunk.json
            - taskcluster/scripts/misc/build-llvm-common.sh
        toolchain-artifact: public/build/compiler-rt-aarch64-pc-windows-msvc.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - vs-toolchain

wasm32-wasi-compiler-rt-trunk:
    description: "wasm32-wasi Compiler-rt for Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL(wasi-crt-trunk)
    worker-type: b-linux-docker-xlarge-amd
    run:
        script: build-compiler-rt-wasi.sh
        arguments:
            - wasi-sdk.patch
        resources:
            - taskcluster/scripts/misc/wasi-sdk.patch
        toolchain-artifact: public/build/compiler-rt-wasm32-wasi.tar.zst
    fetches:
        fetch:
            - clang-trunk
            - wasi-sdk
        toolchain:
            - linux64-clang-trunk-stage1
