Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject unsound toggling of Arm atomics-32 target feature #136170

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Jan 28, 2025

This target feature has the same semantics as RISC-V forced-atomics target feature that already marked as Forbidden (llvm/llvm-project@f5ed0cb) and toggling it can cause ABI incompatibility.

(
"forced-atomics",
Stability::Forbidden { reason: "unsound because it changes the ABI of atomic operations" },
&[],
),

Comment on feature definition in LLVM also says:

Code built with this feature is not ABI-compatible with code built without this feature, if atomic variables are exposed across the ABI boundary.

r? @workingjubilee or @RalfJung

@rustbot label +O-Arm

@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2025

Could not assign reviewer from: workingjubilee.
User(s) workingjubilee are either the PR author, already assigned, or on vacation. Please use r? to specify someone else to assign.

@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2025

r? @estebank

rustbot has assigned @estebank.
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

@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. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Jan 28, 2025
@taiki-e
Copy link
Member Author

taiki-e commented Jan 28, 2025

r? @RalfJung

@rustbot rustbot assigned RalfJung and unassigned estebank Jan 28, 2025
@workingjubilee workingjubilee self-assigned this Jan 28, 2025
@workingjubilee
Copy link
Member

Seems fine? Added to our target defs in 89582e8 so yeah, this was always explicitly for our purposes because we want to be able to assume this.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 28, 2025

📌 Commit 7f83f8a has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors 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 Jan 28, 2025
@RalfJung
Copy link
Member

Seems like we should document the atomics ABI of thumbv6m_none_eabi somewhere, probably here?

Cc @nikic

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#136121 (Deduplicate operand creation between scalars, non-scalars and string patterns)
 - rust-lang#136134 (Fix SIMD codegen tests on LLVM 20)
 - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests)
 - rust-lang#136161 (rustdoc: add nobuild typescript checking to our JS)
 - rust-lang#136166 (interpret: is_alloc_live: check global allocs last)
 - rust-lang#136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items)
 - rust-lang#136170 (Reject unsound toggling of Arm atomics-32 target feature)
 - rust-lang#136176 (Render pattern types nicely in mir dumps)
 - rust-lang#136186 (uefi: process: Fix args)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#136121 (Deduplicate operand creation between scalars, non-scalars and string patterns)
 - rust-lang#136134 (Fix SIMD codegen tests on LLVM 20)
 - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests)
 - rust-lang#136161 (rustdoc: add nobuild typescript checking to our JS)
 - rust-lang#136166 (interpret: is_alloc_live: check global allocs last)
 - rust-lang#136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items)
 - rust-lang#136170 (Reject unsound toggling of Arm atomics-32 target feature)
 - rust-lang#136176 (Render pattern types nicely in mir dumps)
 - rust-lang#136186 (uefi: process: Fix args)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0b1d717 into rust-lang:master Jan 29, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 29, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
Rollup merge of rust-lang#136170 - taiki-e:atomics-32, r=workingjubilee

Reject unsound toggling of Arm atomics-32 target feature

This target feature has the same semantics as RISC-V `forced-atomics` target feature that already marked as Forbidden  (llvm/llvm-project@f5ed0cb) and toggling it can cause ABI incompatibility.

https://github.com/rust-lang/rust/blob/2f348cb7ce4063fa4eb40038e6ada3c5214717bd/compiler/rustc_target/src/target_features.rs#L479-L483

[Comment on feature definition in LLVM](https://github.com/llvm/llvm-project/blob/7109f521975e9cc2e8ba4f52ac2a8e1140bd49b5/llvm/lib/Target/ARM/ARMFeatures.td#L572-L574) also says:

> Code built with this feature is not ABI-compatible with code built without this feature, if atomic variables are exposed across the ABI boundary.

r? `@workingjubilee` or `@RalfJung`

`@rustbot` label +O-Arm
@taiki-e taiki-e deleted the atomics-32 branch January 29, 2025 14:48
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