Skip to content

compiler: Make +fix-cortex-a53-835769 a default feature for aarch64 fuchsia - #161886

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
PiJoules:fix-cortex-a53-835769
Aug 29, 2026
Merged

compiler: Make +fix-cortex-a53-835769 a default feature for aarch64 fuchsia#161886
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
PiJoules:fix-cortex-a53-835769

Conversation

@PiJoules

Copy link
Copy Markdown
Contributor

This matches the default target features for aarch64 fuchsia emitted by clang.

…uchsia

This matches the default target features for aarch64 fuchsia emitted by
clang.
@rustbot

rustbot commented Aug 27, 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 Aug 27, 2026
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

r? @jieyouxu

rustbot has assigned @jieyouxu.
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 75 candidates
  • Random selection from 18 candidates

@PiJoules

Copy link
Copy Markdown
Contributor Author

cc @ilovepi to make sure this is the right spelling of this

@ilovepi

ilovepi commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This should be the right way to spell this on Fuchsia. We should also consider just always setting this in LLVM if its targeting a Fuchsia triple.

We may also need to adjust the build Rules on the Fuchsia side when this lands, since its likely to change the ABI of the core snd std libraries. I have a vague memory that ordering may also have been important, so we should check that all the things that care (specifically zircon's build rules) use a compatible ordering.

@jieyouxu jieyouxu 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.

(This seems sensible, but I'll wait for a target maintainer to double-check EDIT: sorry, I think @ilovepi was meant to be one of the target maintainers?)

View changes since this review

let mut base = base::fuchsia::opts();
base.cpu = "generic".into();
base.features = "+v8a,+crc,+aes,+sha2,+neon".into();
base.features = "+v8a,+crc,+aes,+sha2,+neon,+fix-cortex-a53-835769".into();

@jieyouxu jieyouxu Aug 28, 2026

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.

Is there more context for this? Would be helpful if the PR description could be slightly expanded to backlink to relevant bugs/context. I did a basic search and found:

In particular for the gcc/llvm patch

Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is possible for a 64-bit multiply-accumulate instruction in AArch64 state to generate an incorrect result. The details are quite complex and hard to determine statically, since branches in the code may exist in some circumstances, but all cases end with a memory (load, store, or prefetch) instruction followed immediately by the multiply-accumulate operation.

The safest work-around for this issue is to make the compiler avoid emitting multiply-accumulate instructions immediately after memory instructions and the simplest way to do this is to insert a NOP.

This patch implements such work-around. The work-around is only enabled when specifying the clang command line option -mfix-cortex-a53-835769 or the llvm backend option -aarch64-fix-cortex-a53-835769.

The work-around code generation is not enabled by default.

Presumably this PR here changes the default target features so that the workaround is enabled-by-default for the aarch64 fuchsia target?

cc @erickt @Nashenas88 (target maintainers, I don't know if Fuchsia has different target maintainers or sth)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fushsia's C++ code already always adds this in clang (see https://github.com/llvm/llvm-project/blob/1a315dc409bd5eec1c4df57ae9225b518c1c265a/clang/lib/Driver/ToolChains/Fuchsia.cpp#L94). It's been an oversight that it wasn't happening in Rust too. This is unfortunate in that it likely has prevented cross language inlining in our LTO builds. We've been introducing Rust into our kernel and the build changes there are where we first noticed the incompatibility.

let mut base = base::fuchsia::opts();
base.cpu = "generic".into();
base.features = "+v8a,+crc,+aes,+sha2,+neon".into();
base.features = "+v8a,+crc,+aes,+sha2,+neon,+fix-cortex-a53-835769".into();

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.

This should be the right way to spell this on Fuchsia. We should also consider just always setting this in LLVM if its targeting a Fuchsia triple.

This sounds sensible to me. I think it's fine if we do it on the Rust side if you'd like to get this enabled-by-default sooner, but it sounds like the more sane default over the longer term is to change the LLVM side to enable this by default (and if there's some obscure reason to not want this, provide an opt-out).

@jieyouxu jieyouxu added the S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. label Aug 28, 2026

@jieyouxu jieyouxu Aug 28, 2026

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.

Oh hm, I think the fuchsia ping group / target maintainers never got updated, there's

@ilovepi do you happen to know what's the actual intended group of target maintainers for the Fuchsia targets?

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think its roughly our Toolchain team. That includes @PiJoules @petrhosek @erickt @zeroomega @gulfemsavrun @Prabhuk @mysterymath and me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@erickt can you confirm if there are more folks? We should probably also land the referenced PR w/ the full set of team members.

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.

Updated in rust-lang/team#1614, thanks

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.

Also FYI -- Fuchsia's current test job was disabled some ago due to hitting fuchsia server rate limits:

# FIXME: temporarily disabled due to fuchsia server rate limits. See
# <https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/fuchsia.20failure/with/506637259>.
#
#- name: x86_64-fuchsia
# # Only run this job on the nightly channel. Fuchsia requires
# # nightly features to compile, and this job would fail if
# # executed on beta and stable.
# only_on_channel: nightly
# doc_url: https://rustc-dev-guide.rust-lang.org/tests/fuchsia.html
# <<: *job-linux-8c

I'm not sure if this is still intended (i.e. the server rate limits is annoying to solve), or if this fell off the radar. But just FYI that in terms of the integration test job, Fuchsia hasn't been running in CI for a while.

@jieyouxu jieyouxu added the relnotes Marks issues that should be documented in the release notes of the next release. label Aug 29, 2026
@jieyouxu jieyouxu added the O-fuchsia Operating system: Fuchsia label Aug 29, 2026

@jieyouxu jieyouxu 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.

@rust-bors

rust-bors Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 42f6596 has been approved by jieyouxu

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 Aug 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 29, 2026
…uwer

Rollup of 2 pull requests

Successful merges:

 - #161692 (Allow Unpin impls for local extern type)
 - #161886 (compiler: Make +fix-cortex-a53-835769 a default feature for aarch64 fuchsia)
@rust-bors
rust-bors Bot merged commit 711bd1a into rust-lang:main Aug 29, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 29, 2026
Rollup merge of #161886 - PiJoules:fix-cortex-a53-835769, r=jieyouxu

compiler: Make +fix-cortex-a53-835769 a default feature for aarch64 fuchsia

This matches the default target features for aarch64 fuchsia emitted by clang.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-fuchsia Operating system: Fuchsia relnotes Marks issues that should be documented in the release notes of the next release. S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. 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.

4 participants