aarch64 Linux builds link again: zig runs through a shim that drops -mfix-cortex-a53-843419 #147

Merged
sionzee merged 1 commit from fix/aarch64-linux-zig-link into main 2026-11-23 21:42:18 +01:00
Owner

The 0.5.0 release job (run 557) failed at build-native --all while linking linux-arm64-gnu, so nothing reached npm. The cause is the pinned nightly (#124): it passes -mfix-cortex-a53-843419 to the C compiler that links aarch64-unknown-linux-gnu, and zig cc stops with Unknown Clang option. 0.4.0 was built with stable, which didn't pass the flag.

  • rustc has no option to turn the flag off. It isn't in -Z help or -C help, and opting out of rust-lld (-Zunstable-options -Clinker-features=-lld -Clink-self-contained=-linker) still passes it.
  • zig 0.14.1's lld also refuses the linker form, -Wl,--fix-cortex-a53-843419.
  • cargo-zigbuild 0.24.1 (the latest) doesn't filter it.

scripts/zig-shim.sh runs the real zig (SAFE_TS_ZIG, else zig on PATH) and drops that one argument from zig cc / zig c++. build-native.mjs points cargo-zigbuild at the shim with CARGO_ZIGBUILD_ZIG_PATH for the Linux and macOS targets. The binaries link the same way they did up to 0.4.0.

No docs change: the README's build-native line is still accurate.

Test, locally with zig 0.14.1 and the pinned nightly, as in CI: node scripts/build-native.mjs for each platform.

  • linux-arm64-gnu: failed with the CI error before this change; now produces an aarch64 ELF CLI and a .so addon.
  • darwin-arm64, darwin-x64, win32-x64-msvc: build. CI never reached these on the nightly. safe-ts.exe --version runs on Windows.
  • linux-x64-gnu: built again with the shim.

🤖 Generated with Claude Code

The 0.5.0 release job (run 557) failed at `build-native --all` while linking `linux-arm64-gnu`, so nothing reached npm. The cause is the pinned nightly (#124): it passes `-mfix-cortex-a53-843419` to the C compiler that links `aarch64-unknown-linux-gnu`, and `zig cc` stops with `Unknown Clang option`. 0.4.0 was built with stable, which didn't pass the flag. - rustc has no option to turn the flag off. It isn't in `-Z help` or `-C help`, and opting out of rust-lld (`-Zunstable-options -Clinker-features=-lld -Clink-self-contained=-linker`) still passes it. - zig 0.14.1's lld also refuses the linker form, `-Wl,--fix-cortex-a53-843419`. - cargo-zigbuild 0.24.1 (the latest) doesn't filter it. `scripts/zig-shim.sh` runs the real zig (`SAFE_TS_ZIG`, else `zig` on PATH) and drops that one argument from `zig cc` / `zig c++`. `build-native.mjs` points cargo-zigbuild at the shim with `CARGO_ZIGBUILD_ZIG_PATH` for the Linux and macOS targets. The binaries link the same way they did up to 0.4.0. No docs change: the README's build-native line is still accurate. Test, locally with zig 0.14.1 and the pinned nightly, as in CI: `node scripts/build-native.mjs` for each platform. - `linux-arm64-gnu`: failed with the CI error before this change; now produces an aarch64 ELF CLI and a `.so` addon. - `darwin-arm64`, `darwin-x64`, `win32-x64-msvc`: build. CI never reached these on the nightly. `safe-ts.exe --version` runs on Windows. - `linux-x64-gnu`: built again with the shim. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
aarch64 Linux builds link again: zig runs through a shim that drops -mfix-cortex-a53-843419
Some checks failed
Benchmarks / bench (pull_request) Successful in 3m3s
Tests / test (pull_request) Has been cancelled
9b2c2b2243
The 0.5.0 release job failed in build-native: the pinned nightly (#124) passes
`-mfix-cortex-a53-843419` to the C compiler linking aarch64-unknown-linux-gnu, with or without
its own lld and with no option to turn it off, and `zig cc` refuses it ("Unknown Clang
option"); zig's lld refuses `-Wl,--fix-cortex-a53-843419` as well. build-native now points
cargo-zigbuild at scripts/zig-shim.sh (CARGO_ZIGBUILD_ZIG_PATH), which runs the real zig
without that argument, so the binaries link as every release up to 0.4.0 did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sionzee deleted branch fix/aarch64-linux-zig-link 2026-11-23 21:42:18 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Evobug/Safe-Ts!147
No description provided.