Skip to content

Revert #98333 "Re-enable atomic loads and stores for all RISC-V targets" #114497

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Aug 5, 2023

This reverts #98333.

As said in #98333 (comment), forced-atomics target feature is also needed to enable atomic load/store on these targets (otherwise, libcalls are generated): https://godbolt.org/z/433qeG7vd

However, forced-atomics target feature is currently broken (#114153), so AFAIK, there is currently no way to enable atomic load/store (via core::intrinsics) on these targets properly.

r? @Amanieu

…anieu"

This reverts commit 90f0b24, reversing
changes made to e173a8e.
@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 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2023

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

@taiki-e
Copy link
Member Author

taiki-e commented Aug 5, 2023

Or should we skip the revert (and break these targets with "undefined reference to ..." errors for a few days) and then merge a patch that enables forced-atomics after #114153 is fixed?

@taiki-e
Copy link
Member Author

taiki-e commented Aug 5, 2023

Hmm... given that force-atomics appears to exist only in LLVM 16+ (llvm/llvm-project@f5ed0cb), and the current minimum LLVM version is 15, a patch to enable force-atomics may not be merged soon enough. Although I don't know what the policy on the minimum LLVM version is for these targets.

@taiki-e
Copy link
Member Author

taiki-e commented Aug 5, 2023

I also opened a PR to enable forced-atomics (#114499), but given that there are two open issues, I think reverting #98333 (i.e., merge this PR) is a reasonable choice for now.

taiki-e added a commit to taiki-e/semihosting that referenced this pull request Aug 6, 2023
rust-lang/rust#98333 broke RISC-V targets
without A-extension.
This will be fixed by rust-lang/rust#114497 or
rust-lang/rust#114499.

```
  = note: rust-lld: error: undefined symbol: __atomic_load_4
          >>> referenced by mod.rs:1242 (/rustc/eb088b8b9d98f1af1b0e61bbdcd8686e1b0db7b6/library/core/src/num/mod.rs:1242)
          >>>               compiler_builtins-d066fd6ed508b6b5.compiler_builtins.b1b28d926042a9f7-cgu.004.rcgu.o:(compiler_builtins::mem::memcpy::he6d5500b219c1d3d) in archive /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32i-unknown-none-elf/lib/libcompiler_builtins-d066fd6ed508b6b5.rlib
```
taiki-e added a commit to taiki-e/atomic-maybe-uninit that referenced this pull request Aug 6, 2023
rust-lang/rust#98333 broke RISC-V targets
without A-extension.
This will be fixed by rust-lang/rust#114497 or
rust-lang/rust#114499.

```
  = note: rust-lld: error: undefined symbol: __atomic_load_4
          >>> referenced by mod.rs:1242 (/rustc/eb088b8b9d98f1af1b0e61bbdcd8686e1b0db7b6/library/core/src/num/mod.rs:1242)
          >>>               compiler_builtins-d066fd6ed508b6b5.compiler_builtins.b1b28d926042a9f7-cgu.004.rcgu.o:(compiler_builtins::mem::memcpy::he6d5500b219c1d3d) in archive /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/riscv32i-unknown-none-elf/lib/libcompiler_builtins-d066fd6ed508b6b5.rlib
```
taiki-e added a commit to taiki-e/portable-atomic that referenced this pull request Aug 6, 2023
rust-lang/rust#98333 broke RISC-V targets
without A-extension.
This will be fixed by rust-lang/rust#114497 or
rust-lang/rust#114499.

```
  = note: rust-lld: error: undefined symbol: __atomic_load_4
          >>> referenced by uint_macros.rs:1230 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:1230)
          >>>               compiler_builtins-a15f77f0f647aa99.compiler_builtins.eedcbccd0d1b9b88-cgu.1.rcgu.o:(compiler_builtins::mem::memcpy::hedd00e0c59d2a943) in archive /home/runner/work/portable-atomic/portable-atomic/target/riscv32im-unknown-none-elf/debug/deps/libcompiler_builtins-a15f77f0f647aa99.rlib
```
@Amanieu
Copy link
Member

Amanieu commented Aug 7, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 7, 2023

📌 Commit b47e4a4 has been approved by Amanieu

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 Aug 7, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#114376 (Avoid exporting __rust_alloc_error_handler_should_panic more than once.)
 - rust-lang#114413 (Warn when #[macro_export] is applied on decl macros)
 - rust-lang#114497 (Revert rust-lang#98333 "Re-enable atomic loads and stores for all RISC-V targets")
 - rust-lang#114500 (Remove arm crypto target feature)
 - rust-lang#114566 (Store the laziness of type aliases in their `DefKind`)
 - rust-lang#114594 (Structurally normalize weak and inherent in new solver)
 - rust-lang#114596 (Rename method in `opt-dist`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6f36f1f into rust-lang:master Aug 8, 2023
@bors
Copy link
Collaborator

bors commented Aug 8, 2023

⌛ Testing commit b47e4a4 with merge 8e7fd55...

@rustbot rustbot added this to the 1.73.0 milestone Aug 8, 2023
@taiki-e taiki-e deleted the revert-riscv-atomic branch August 8, 2023 05:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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