Repository navigation
Enable return address signing on ARM fully: drop the SimSIMD and compiler-rt exclusions - #131996
Conversation
…h protection Bumps `contrib/SimSIMD` to the merge of ClickHouse/SimSIMD#33. The CPU probe `_simsimd_capabilities_arm` reads `ID_AA64ZFR0_EL1` by its encoding instead of being compiled for `arch=armv8.5-a+sve`, and the bf16 kernels use `+simd+bf16` / `+sve+sve2+bf16` instead of `arch=armv8.6-a+...`. Nothing in `SimSIMD` is compiled for ARMv8.3 or later anymore, so it no longer needs `branch-protection=none` and all of its functions are signed under `-mbranch-protection=pac-ret`, without `retaa` that would raise SIGILL on cores without `FEAT_PAuth`. The bump also brings ClickHouse/SimSIMD#30 (typed kernel dispatch). Related: ClickHouse/SimSIMD#33 Related: ClickHouse#131748 Related: ClickHouse#131784 Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `SimSIMD` no longer compiled for ARMv8.3 or later, the long explanation of the exclusions is not needed. Keep only what a reader needs: why the flag is safe on cores without `FEAT_PAuth`, the rule that no code may be compiled for ARMv8.3 or later, and why sanitizer builds are excluded.
Scan the executable sections of the binary for the two fixed encodings and report the count, without `mmap` and without naming the functions through `system.symbols`.
`contrib/compiler-rt-cmake` keeps only an allowlist of the inherited flags, which dropped `-mbranch-protection=pac-ret`, so the builtins and the `XRay` runtime linked into the release binary had unsigned return addresses. Keep the flag. Now all compile commands of the `arm_release` build have it; only the hand-written assembly in `compiler-rt` (the `XRay` trampolines and the `__emupac_*` wrappers) stays unsigned.
|
Workflow [PR], commit [0c5771b] Summary: ✅
AI ReviewSummaryPR #131996, reviewed at Missing context / blind spots
Final Verdict✅ Approve. No unresolved code findings; normal ARM CI validation remains pending. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units11 translation units recompiled, 78 s compile time in total, 11 of them have a recent master baseline. |
#131784 enabled
-mbranch-protection=pac-reton ARM. To avoidretaa(SIGILL on cores withoutFEAT_PAuth, such as Graviton2 and Ampere Altra), it turned off branch protection in theSimSIMDfunctions compiled for ARMv8.3 or later. It also didn't covercompiler-rt. This PR removes both exclusions:SimSIMDis bumped to Keep ARMv8.3+ code out of SimSIMD instead of disabling branch protection SimSIMD#33, which fixes the root cause instead of disabling protection. The CPU probe readsID_AA64ZFR0_EL1by its encoding, so it doesn't needarch=armv8.5-a+sve. The bf16 kernels use+simd+bf16/+sve+sve2+bf16instead ofarch=armv8.6-a+.... Nothing is compiled for ARMv8.3 or later anymore, and all of its functions are signed. The bump also brings Cache each dispatched kernel with its exact type SimSIMD#30.compiler-rt:contrib/compiler-rt-cmakekeeps only an allowlist of the inherited flags, and that allowlist dropped-mbranch-protection. The builtins and theXRayruntime are linked into the release binary, so their return addresses were unsigned. Now every compile command of thearm_releasebuild has the flag. Only hand-written assembly stays unsigned: theXRaytrampolines and the__emupac_*wrappers.-mbranch-protection=pac-reton ARM, except for SimSIMD #131784 are simplified: the comment inCMakeLists.txtgoes from ~70 lines to 7. The compatibility check still fails thearm_releasepackage on anyretaa/retab, in ~20 lines.Verification, on a build with the
arm_releasecmake flags (ThinLTO,clang-22):-Wpass-failed.HINTspace. The new check passes on this binary in ~2 s and fails on a binary containingretaa.FEAT_PAuth):clickhouse localbuilds abf16HNSW vector index and computes the distance functions correctly. That exercises theSimSIMDprobe and dispatch, where the binary from Build the CI toolchain with jemalloc 5.4.0 using transparent huge pages #131745 raised SIGILL.system.stack_traceand the query profiler (system.trace_log) all symbolize correctly.retaadies with SIGILL on the same machine.Related: #131784
Related: #131748
Related: #131765
Related: ClickHouse/SimSIMD#33
Related: ClickHouse/SimSIMD#32
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Sign return addresses on ARM also in
SimSIMDandcompiler-rt, which were previously excluded. The binary still runs on cores without pointer authentication, such as Graviton2.Workflow [PR]
Sync PR [sync-upstream/pr/131996]
Version info
26.11.1.2508-master(included in26.11and later)