Skip to content

apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets - #155453

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ferrocene:a53-linux-fix-errata
Jun 5, 2026
Merged

apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets#155453
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ferrocene:a53-linux-fix-errata

Conversation

@japaric

@japaric japaric commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

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

@rustbot

rustbot commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 17, 2026
@rustbot

rustbot commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 72 candidates
  • Random selection from 18 candidates

@rustbot

This comment has been minimized.

@japaric
japaric force-pushed the a53-linux-fix-errata branch from 9bafb16 to a88c30d Compare April 17, 2026 16:55

@wesleywiser wesleywiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me

View changes since this review

@wesleywiser

Copy link
Copy Markdown
Member

@rustbot ping arm

Objections to merging this?

@rustbot rustbot added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Apr 17, 2026
@rustbot

rustbot commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Hey ARM Group! This issue has been identified as a good "ARM candidate".
In case it's useful, here are some instructions for tackling these sorts of
issues. Maybe take a look?
Thanks! <3

cc @adamgemmell @davidtwco @hug-dev @Jamesbarford @joaopaulocarreiro @lqd @raw-bin @Stammark

Xylakant pushed a commit to ferrocene/ferrocene that referenced this pull request Apr 17, 2026
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
@adamgemmell

Copy link
Copy Markdown
Contributor

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?

@japaric
japaric force-pushed the a53-linux-fix-errata branch from a88c30d to 221687a Compare April 28, 2026 13:31
@japaric

japaric commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

How would the user override this if they want to?

they can pass -mno-fix-cortex-a53-843419 to the linker driver (GCC) to opt-out of the silicon errata fix. that'd be passing -C link-arg=-mno-fix-cortex-a53-843419 to the binary-producing rustc invocation

however, according to my testing there seems to be priority issue with this change. -Wl,--fix-cortex-a53-843419 has higher priority than -mno-fix-cortex-a53-843419 so the fix is applied regardless of the -mno flag.

--no-fix-cortex-a53-843419 is not a valid flag (as of GNU LD 2.42) so -Wl,--no-fix-cortex-a53-843419 is not an option to opt out of the fix.

what that all means is that, to let the user opt out of the errata fix, we should use -mfix-cortex-a53-843419 in the target spec instead of the -Wl version. I have updated the commit to do that just now.

@adamgemmell

Copy link
Copy Markdown
Contributor

Sounds good, thank you!

@wesleywiser

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 221687a has been approved by wesleywiser

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…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
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
…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)
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r-
#155976 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2026
@rust-bors

rust-bors Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#155976), which was unapproved.

View changes since this unapproval

@japaric

japaric commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

#155976 (comment)

it appears that -mfix-cortex-a53-843419 is only supported in Clang v21+ and CI is using Clang v20 (released in 2025).

-Wl,--fix-cortex-a53-843419 would have better compatibility as, according to my testing, it's supported by GNU LD 2.32 (released in 2019) and, of course, the rust-lld shipped with the compiler. it would however not be possible to opt out from the errata if we use the -Wl version.

@adamgemmell thoughts on switching this back to -Wl? I'd think that the perf impact of that alternative is negligible as the errata workaround is applied in an scenario that rarely happens

rust-bors Bot pushed a commit that referenced this pull request Jun 5, 2026
…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`)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 5, 2026
…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
rust-bors Bot pushed a commit that referenced this pull request Jun 5, 2026
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`)
rust-bors Bot pushed a commit that referenced this pull request Jun 5, 2026
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`)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 5, 2026
…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
@rust-bors
rust-bors Bot merged commit 0c119ef into rust-lang:main Jun 5, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 5, 2026
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Jun 8, 2026
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`)
@tshepang
tshepang deleted the a53-linux-fix-errata branch June 9, 2026 04:39
pull Bot pushed a commit to bhardwajRahul/mirrord that referenced this pull request Aug 16, 2026
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.
zanieb added a commit to astral-sh/uv that referenced this pull request Aug 21, 2026
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>
jpmcb added a commit to papercomputeco/tapesctl that referenced this pull request Aug 21, 2026
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.
henry40408 added a commit to henry40408/noadd that referenced this pull request Aug 23, 2026
…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>
brycedrennan added a commit to blackthorn-interstellar/pypiron that referenced this pull request Aug 23, 2026
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.
@apiraino

Copy link
Copy Markdown
Contributor

FYI this flag seems to break compiling on Aarch64 with very old gcc 4.9.4
cc: @japaric

(unsure if this was somehow expected, just wanted to leave a note here in case it helps)

Aryex added a commit to valkey-io/valkey-glide-ruby that referenced this pull request Aug 24, 2026
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>
Aryex added a commit to valkey-io/valkey-glide-ruby that referenced this pull request Aug 24, 2026
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>
Aryex added a commit to valkey-io/valkey-glide-ruby that referenced this pull request Aug 24, 2026
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>
Aryex added a commit to valkey-io/valkey-glide-ruby that referenced this pull request Aug 24, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants