packages/chip/docs/toolchain/llvm-trunk-pin.md
This document is the source of truth for which LLVM commit, build flags, and
patches the e1 chip toolchain consumes. The corresponding machine-readable pin
lives in compiler/llvm-build/llvm-pin.json
and is consumed by scripts/build_llvm_riscv.sh.
V, Zicboz, Zicbom, Zicfilp, Zicfiss,
Zihintntl, Ztso, Zacas, Zfh, Zvfh, Zvbb) landed progressively
across LLVM 19-23. Trunk is the only branch that contains every RVA23
feature plus the active cost-model and predicate-vectorization work.main.compiler/llvm-build/llvm-pin.json under
upstream.commit_sha and printed by build_llvm_riscv.sh into
build/reports/compiler/llvm-build-sha.txt.llvm-21. Any older release SHA is
rejected by scripts/check_compiler_versions.py.packages/chip/Dockerfile.gcc-riscv64-linux-gnu sysroot, available only
inside the Linux container. The host build is therefore non-canonical and
fails closed in build_llvm_riscv.sh with BLOCKED llvm.environment_check.scripts/build_llvm_riscv.sh performs:
build/llvm-stage1/bin/clang. Used solely to bootstrap a
self-host stage 2.riscv64-unknown-linux-gnu. ThinLTO is enabled at the LLVM
build level. Produces build/llvm-stage2/bin/clang, the toolchain that
the rest of the e1-chip flow consumes.A future stage 3 may apply AutoFDO+Propeller+BOLT to the LLVM build itself,
landing 10-15% compile-time wins (per published Google data); this is not yet
in the pinned recipe.
The pin file's rva23_patches.active is empty by intent: the current trunk
SHA already contains every RVA23 mandatory extension. Any future deviation
must:
compiler/llvm-build/patches/<NNN>-<topic>.patch.rva23_patches.active with upstream_review_url and rationale.The toolchain emits the following baseline for every Android RVA23 build:
clang \
--target=riscv64-unknown-linux-gnu \
-march=rva23u64 -mcpu=eliza-e1 -mtune=eliza-e1 \
-O3 -flto=thin -fvectorize \
-fbasic-block-sections=labels \
-fcf-protection=full \
-fstack-clash-protection \
-fstack-protector-strong \
-fsanitize=shadow-call-stack
Profile attachment for AutoFDO+Propeller+BOLT is documented in
autofdo-propeller-bolt.md.
upstream.commit_sha is the placeholder TODO_PIN_LLVM_SHA_FROM_CONTAINER_BUILD.
No release-grade compiler evidence will be accepted until
scripts/build_llvm_riscv.sh runs to completion in the Linux container and
the resolved SHA is written into the pin file.cd external/llvm-project && git fetch origin main.llvm/llvm-test-suite nightly + Phabricator status).compiler/llvm-build/llvm-pin.json upstream.commit_sha.scripts/build_llvm_riscv.sh end-to-end inside the container.build/reports/compiler/llvm-version.txt, and
docs/evidence/compiler/llvm-build-evidence.yaml.make rva23-compliance to confirm the toolchain emits the
RVA23 baseline.scripts/build_llvm_riscv.sh.compiler/llvm-build/llvm-pin.json.docs/evidence/compiler/llvm-build-evidence.yaml.scripts/check_rva23_compliance.py.docs/toolchain/autofdo-propeller-bolt.md.docs/toolchain/reproducibility.md.