feat(bazel): Wire hermetic-llvm as an opt-in toolchain for armv7 #61555
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 318 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #61555"
general
weight: 0.35
JSGette
What does this PR do?
Adds hermetic-llvm as a second toolchain for
linux_armv7, without changing the default.MODULE.bazelregisters an armv7 Linux LLVM target, and//bazel/platforms:linux_armv7gets the libc, kernel, libstdc++ and FPU constraints that only hermetic-llvm reads. GCC is registered before@llvm_toolchains//:all, so it keeps winning wherever it can run (aarch64 Linux, which is where CI builds armhf).It also carries hermeticbuild/hermetic-llvm#1003 (merged, not released yet) as
bazel/patches/llvm/0002-fpu-vfpv3-d16.patch, because clang defaults armv7 to NEON + 32 D registers, which the GCC toolchain (armv7-a,vfpv3-d16) never emitted.<details>
<summary>Functional changes</summary>
| Before | After |
| --- | --- |
| armv7 build on aarch64 Linux (CI
bazel:package:iot:linux-armhf): GCC 13.2 | Same toolchain; the IoT agent binary is byte-identical tomain|| armv7 build with
--extra_toolchains=@llvm_toolchains//:all: still GCC, there was no LLVM armv7 toolchain | hermetic-llvm builds it, at glibc 2.17, VFPv3-D16 without NEON, libstdc++ 13.2 || armv7 build on a macOS or x86_64 Linux host: toolchain resolution failed (the GCC armv7 toolchain only runs on aarch64 Linux) | Falls back to hermetic-llvm |
Unchanged: shipped armhf packages, and every other platform's toolchain. The patch changes the
@llvmrepo, so macOS and Windows LLVM actions rebuild once.</details>
Motivation
First step of moving armv7 from GCC to hermetic-llvm without a flag day: the wiring lands now, and the remaining LLVM-only issues found in a spike (Go DWARF compression under LLD,
nosys.solink libraries) get fixed against it before armv7 switches. glibc 2.17 is kept because it is the floor of both current armv7 builders (crosstool-NG sysroot and the CentOS 7rpm_armhfimage).Describe how you validated your changes
On an aarch64 workspace:
--toolchain_resolution_debug: armv7 resolves togcc_toolchain_armv7_13_2_0by default and to hermetic-llvm with--extra_toolchains=@llvm_toolchains//:all.//packages/iot:debianwith GCC, built frommainand from this branch in separate worktrees: same agent SHA-256, identical.debcontents.//packages/iot:debianwith LLVM:Tag_FP_arch: VFPv3-D16with no NEON tag, 0 NEON / d16-d31 / FMA instructions (objdump -d, same as GCC), highest symbolGLIBC_2.8. NEEDED is GCC's set pluslibm.so.6.bazel run //bazel/buildifier:test.The macOS / x86_64 host fallback follows from toolchain registration; I didn't run it.