apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets - #155453
Conversation
|
These commits modify compiler targets. |
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
9bafb16 to
a88c30d
Compare
|
@rustbot ping arm Objections to merging this? |
|
Hey ARM Group! This issue has been identified as a good "ARM candidate". cc @adamgemmell @davidtwco @hug-dev @Jamesbarford @joaopaulocarreiro @lqd @raw-bin @Stammark |
as it's done for other AArch64 targets although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1) see issue 118095 for background information cherry-picked from upstream, see rust-lang/rust#155453 for details re-enable the tests for this fix
|
I'm happy with this, I think everything in Jacob's comment on the none target still applies. How would the user override this if they want to? |
a88c30d to
221687a
Compare
they can pass however, according to my testing there seems to be priority issue with this change.
what that all means is that, to let the user opt out of the errata fix, we should use |
|
Sounds good, thank you! |
|
@bors r+ |
…wesleywiser apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets as it's done for other AArch64 targets although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1) see rust-lang#118095 for background information
…wesleywiser apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets as it's done for other AArch64 targets although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1) see rust-lang#118095 for background information
…uwer Rollup of 22 pull requests Successful merges: - #154149 (resolve: Extend `ambiguous_import_visibilities` deprecation lint to glob-vs-glob ambiguities) - #155189 (simd_reduce_min/max: remove float support) - #155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets) - #155562 (Add a missing `GenericTypeVisitable`, and avoid having interner traits for `FnSigKind` and `Abi`) - #155608 (rustc_middle: Implement the `partial_cmp` operation for `DefId`s) - #155721 (When archive format is wrong produce an error instead of ICE) - #155794 (privacy: share effective visibility initialization) - #155832 (c-variadic: more precise compatibility check in const-eval) - #155856 (std_detect: support detecting more features on aarch64 Windows) - #155861 (Suggest `[const] Trait` bounds in more places) - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug) - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target) - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. ) - #155950 (use the new `//@ needs-asm-mnemonic: ret` more) - #155958 (ci(free-disk-space): remove more tools and fix warnings) - #155966 (miri subtree update) - #155711 (bump curl-sys and openssl-sys to support OpenSSL 4.0.x) - #155831 (Add `AcceptContext::expect_key_value`) - #155877 (Avoid misleading return-type note for foreign `Fn` callees) - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`) - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.) - #155967 (Fix `doc_cfg` feature for extern items)
|
This pull request was unapproved. This PR was contained in a rollup (#155976), which was unapproved. |
|
it appears that
@adamgemmell thoughts on switching this back to |
…uwer Rollup of 12 pull requests Successful merges: - #157467 (stdarch subtree update) - #155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets) - #156798 (delegation: do not always generate first argument) - #157016 (add `extern "tail"` calling convention) - #157450 (mark `Encode`, `Decode`, `Mark` impls as `#[inline]`) - #148183 (rustdoc: Test & document `test_harness` code block attribute) - #157190 (Silence recursive RUSTC_LOG_FORMAT_JSON messages) - #157470 (Avoid ICE when emitting TargetMachine config errors) - #157474 (Forbid optimize(none) with inline(always) or inline.) - #157475 (Add a smoke test for the optimize attribute.) - #157479 (Warn when `#[macro_use]` or `#[macro_escape]` is used on the crate root) - #157486 (Remove unused attributes from issue-29485.rs.) Failed merges: - #157485 (Rename `errors.rs` file to `diagnostics.rs`)
…wesleywiser apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets as it's done for other AArch64 targets although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1) see rust-lang#118095 for background information
Rollup of 12 pull requests Successful merges: - #155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets) - #156798 (delegation: do not always generate first argument) - #157438 (rustdoc: don't link doc(hidden) associated type projections) - #157450 (mark `Encode`, `Decode`, `Mark` impls as `#[inline]`) - #148183 (rustdoc: Test & document `test_harness` code block attribute) - #157190 (Silence recursive RUSTC_LOG_FORMAT_JSON messages) - #157396 (Add @aapoalas to libs review rotation) - #157470 (Avoid ICE when emitting TargetMachine config errors) - #157474 (Forbid optimize(none) with inline(always) or inline.) - #157475 (Add a smoke test for the optimize attribute.) - #157479 (Warn when `#[macro_use]` or `#[macro_escape]` is used on the crate root) - #157486 (Remove unused attributes from issue-29485.rs.) Failed merges: - #157485 (Rename `errors.rs` file to `diagnostics.rs`)
Rollup of 12 pull requests Successful merges: - #157467 (stdarch subtree update) - #155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets) - #156798 (delegation: do not always generate first argument) - #157438 (rustdoc: don't link doc(hidden) associated type projections) - #157450 (mark `Encode`, `Decode`, `Mark` impls as `#[inline]`) - #157190 (Silence recursive RUSTC_LOG_FORMAT_JSON messages) - #157396 (Add @aapoalas to libs review rotation) - #157470 (Avoid ICE when emitting TargetMachine config errors) - #157474 (Forbid optimize(none) with inline(always) or inline.) - #157475 (Add a smoke test for the optimize attribute.) - #157479 (Warn when `#[macro_use]` or `#[macro_escape]` is used on the crate root) - #157486 (Remove unused attributes from issue-29485.rs.) Failed merges: - #157485 (Rename `errors.rs` file to `diagnostics.rs`)
…wesleywiser apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets as it's done for other AArch64 targets although the linker (GCC) _may_ be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied for example, the Arm GNU toolchain does _not_ enable the errata mitigation by default (checked version: 13.3.Rel1) see rust-lang#118095 for background information
Rollup of 12 pull requests Successful merges: - rust-lang/rust#157467 (stdarch subtree update) - rust-lang/rust#155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets) - rust-lang/rust#156798 (delegation: do not always generate first argument) - rust-lang/rust#157438 (rustdoc: don't link doc(hidden) associated type projections) - rust-lang/rust#157450 (mark `Encode`, `Decode`, `Mark` impls as `#[inline]`) - rust-lang/rust#157190 (Silence recursive RUSTC_LOG_FORMAT_JSON messages) - rust-lang/rust#157396 (Add @aapoalas to libs review rotation) - rust-lang/rust#157470 (Avoid ICE when emitting TargetMachine config errors) - rust-lang/rust#157474 (Forbid optimize(none) with inline(always) or inline.) - rust-lang/rust#157475 (Add a smoke test for the optimize attribute.) - rust-lang/rust#157479 (Warn when `#[macro_use]` or `#[macro_escape]` is used on the crate root) - rust-lang/rust#157486 (Remove unused attributes from issue-29485.rs.) Failed merges: - rust-lang/rust#157485 (Rename `errors.rs` file to `diagnostics.rs`)
rustc's aarch64-unknown-linux-gnu target spec passes `-Wl,--fix-cortex-a53-843419` to the linker (rust-lang/rust#155453), which zig's linker rejects with "unsupported linker arg". cargo-zigbuild 0.23.0 filters the argument out. The aarch64 release job only runs on release branches, so the toolchain update to nightly-2026-08-13 landed on main without exercising it.
ARM64-musl Docker builds fail with Rust 1.98 because the target now [passes `--fix-cortex-a53-843419`](rust-lang/rust#155453), which [`zig cc` rejects](rust-cross/cargo-zigbuild#451). Require and lock `cargo-zigbuild` 0.23.0, which includes the [upstream change to filter this flag](rust-cross/cargo-zigbuild#452). Keep the existing Zig linker, libc, startup objects, and stack defaults. This restores build compatibility without enabling the new Cortex-A53 erratum mitigation. --------- Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com> Co-authored-by: Zanie Blue <contact@zanie.dev> Co-authored-by: Zanie Blue <zanie@openai.com>
cargo-zigbuild 0.23.0 skips rustc's -Wl,--fix-cortex-a53-843419 for the aarch64 musl target (rust-lang/rust#155453), which zig 0.13.0's linker rejects; it also needs rustc 1.88+, hence the image bump from 1.85 to 1.88.
…in (#245) The 1.98 toolchain bump (#241) is green on every CI check and still breaks the image: `docker.yml` fires on tags and pushes to `main`, not on pull requests, so the first build to run it was v0.30.1's — and only the arm64 leg failed. Rust 1.98 passes `--fix-cortex-a53-843419` to the linker for aarch64 targets (rust-lang/rust#155453). Zig's linker rejects unknown arguments outright, so the wrapper cargo-zigbuild 0.22.3 generates fails with `unsupported linker arg: --fix-cortex-a53-843419` and `noadd` never links for aarch64-unknown-linux-musl. amd64 is unaffected — the argument is only emitted for aarch64. cargo-zigbuild 0.23.0 filters the argument in `filter_linker_arg` (rust-cross/cargo-zigbuild#452), alongside the two other arguments it already dropped for the same reason. The rest of the 0.22.3..0.23.0 range is a cargo-dist config update, a cargo-options bump, and dependabot commits. Zig stays on 0.14.1: the fix is in the wrapper, not the linker, and 0.15+ still brings the libc++-19 bindgen requirement this pin exists to avoid. Claude-Session: https://claude.ai/code/session_01RLF7TP74kER7Wcx8Th33qc Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rust 1.98 (stable since 2026-08-18) started passing `-Wl,--fix-cortex-a53-843419` on every aarch64-linux target (rust-lang/rust#155453). zig 0.16's cc driver rejects it outright ("error: unsupported linker arg"), so the arm64 Docker cross-build died linking crc-fast. cargo-zigbuild filters the flag as of 0.23.0 (rust-cross/cargo-zigbuild#452), so pin that — and move taiki-e/install-action to v2.86.6, the first release whose manifest carries 0.23.0 (v2.82.0 tops out at 0.22.3 and would silently fall back to cargo-binstall). Reproduced locally with rustc 1.98.0 + zig 0.16.0: 0.22.3 fails on crc-fast with the exact CI error, 0.23.0 links a valid aarch64 ELF. - h2 0.4.15 -> 0.4.18 clears RUSTSEC-2026-0258; `cargo audit` is green again.
|
FYI this flag seems to break compiling on Aarch64 with very old gcc 4.9.4 (unsure if this was somehow expected, just wanted to leave a note here in case it helps) |
The linux-gnu native build broke on aarch64 after Rust 1.98.0 began passing -Wl,--fix-cortex-a53-843419 to the linker (rust-lang/rust#155453), which the pinned cargo-zigbuild 0.20.1 rejected. Lock the whole cross-compile toolchain rather than letting Rust float: a new .github/actions/install-toolchain composite action installs a pinned Rust (1.98.0) and, for linux-gnu targets only, a pinned zig 0.13.0 plus cargo-zigbuild 0.23.2 (0.23.0+ filters the arg). ci.yml and cd.yml now call it in a single step, replacing the separate submodule install-rust usage and the old install-zigbuild action. Also add .github/actions/** to CI's pull_request path filter so changes to composite actions trigger the workflow. Signed-off-by: Alex Le <alex.le@improving.com>
The linux-gnu native build broke on aarch64 after Rust 1.98.0 began passing -Wl,--fix-cortex-a53-843419 to the linker (rust-lang/rust#155453), which the pinned cargo-zigbuild 0.20.1 rejected. Lock the whole cross-compile toolchain rather than letting Rust float: a new .github/actions/install-toolchain composite action installs a pinned Rust (1.98.0) and, for linux-gnu targets only, a pinned zig 0.13.0 plus cargo-zigbuild 0.23.2 (0.23.0+ filters the arg). ci.yml and cd.yml now call it in a single step, replacing the separate submodule install-rust usage and the old install-zigbuild action. Also add .github/actions/** to CI's pull_request path filter so changes to composite actions trigger the workflow. Signed-off-by: Alex Le <alex.le@improving.com>
The linux-gnu native build broke on aarch64 after Rust 1.98.0 began passing -Wl,--fix-cortex-a53-843419 to the linker (rust-lang/rust#155453), which the pinned cargo-zigbuild 0.20.1 did not recognise. The real cause was an unpinned Rust (install-rust used toolchain: stable) drifting past a stale-but-pinned cross-compiler. Lock both sides: install Rust via dtolnay/rust-toolchain pinned to 1.98.0 in ci.yml and cd.yml, and install zig 0.13.0 plus cargo-zigbuild 0.23.2 (0.23.0+ filters the arg) through pip in the install-zigbuild action. The pip install pulls ziglang in as a dependency and cargo-zigbuild finds zig via python3 -m ziglang, so no zig binary needs to be on PATH. dtolnay's targets input adds the rustup target cargo-zigbuild needs, replacing the install-zigbuild rust-target input. Also add .github/actions/** to CI's pull_request path filter so changes to composite actions trigger the workflow. Signed-off-by: Alex Le <alex.le@improving.com>
The linux-gnu native build broke on aarch64 after Rust 1.98.0 began passing -Wl,--fix-cortex-a53-843419 to the linker (rust-lang/rust#155453), which the pinned cargo-zigbuild 0.20.1 did not recognise. The real cause was an unpinned Rust (install-rust used toolchain: stable) drifting past a stale-but-pinned cross-compiler. Lock both sides: install Rust via dtolnay/rust-toolchain pinned to 1.98.0 in ci.yml and cd.yml, and install zig 0.13.0 plus cargo-zigbuild 0.23.1 (0.23.0+ filters the arg) through pip in the install-zigbuild action. The pip install pulls ziglang in as a dependency and cargo-zigbuild finds zig via python3 -m ziglang, so no zig binary needs to be on PATH. dtolnay's targets input adds the rustup target cargo-zigbuild needs, replacing the install-zigbuild rust-target input. Also add .github/actions/** to CI's pull_request path filter so changes to composite actions trigger the workflow. Signed-off-by: Alex Le <alex.le@improving.com>
View all comments
as it's done for other AArch64 targets
although the linker (GCC) may be configured to apply the fix by default it's preferred to have rustc pass the flag to the linker to ensure the mitigation is always applied
for example, the Arm GNU toolchain does not enable the errata mitigation by default (checked version: 13.3.Rel1)
see #118095 for background information