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

Enable atomic cas for bpf targets #105708

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Conversation

tomerze
Copy link
Contributor

@tomerze tomerze commented Dec 14, 2022

It seems like LLVM now supports it.

https://reviews.llvm.org/D72184 - the PR in LLVM

@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2022

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) soon.

Please see the contribution instructions for more information.

@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 Dec 14, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2022

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

@cjgillot
Copy link
Contributor

I don't know anything about codegen targets.
r? @nagisa since you reviewed #79608

@rustbot rustbot assigned nagisa and unassigned cjgillot Dec 25, 2022
@@ -19,6 +19,10 @@ pub fn opts(endian: Endian) -> TargetOptions {
obj_is_bitcode: true,
requires_lto: false,
singlethread: true,
// When targeting the `v3` cpu in llvm, 32-bit atomics are also supported.
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason why anybody would want to use an older target-cpu with BPF targets?

Copy link
Contributor

Choose a reason for hiding this comment

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

Support older kernels

@nagisa
Copy link
Member

nagisa commented Jan 9, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jan 9, 2023

📌 Commit 11331b1 has been approved by nagisa

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 9, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jan 9, 2023
…agisa

Enable atomic cas for bpf targets

It seems like LLVM now supports it.

https://reviews.llvm.org/D72184 - the PR in LLVM
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 10, 2023
Rollup of 9 pull requests

Successful merges:

 - rust-lang#105034 (Add example for iterator_flatten)
 - rust-lang#105708 (Enable atomic cas for bpf targets)
 - rust-lang#106175 (Fix bad import suggestion with nested `use` tree)
 - rust-lang#106204 (No need to take opaques in `check_type_bounds`)
 - rust-lang#106387 (Revert "bootstrap: Get rid of `tail_args` in `stream_cargo`")
 - rust-lang#106636 (Accept old spelling of Fuchsia target triples)
 - rust-lang#106639 (update Miri)
 - rust-lang#106640 (update test for inductive canonical cycles)
 - rust-lang#106647 (rustdoc: merge common CSS for `a`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5773e8b into rust-lang:master Jan 10, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 10, 2023
vadorovsky added a commit to vadorovsky/rust that referenced this pull request Jan 14, 2023
Enabling CAS for BPF targets (rust-lang#105708) breaks the build of core library.
The failure occurs both when building rustc for BPF targets and when
building crates for BPF targets with the current nightly.

The LLVM BPF backend does not correctly lower all `atomicrmw` operations
and crashes for unsupported ones.

Before we can enable CAS for BPF in Rust, we need to fix the LLVM BPF
backend first.

Fixes rust-lang#106795

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 23, 2023
…omic-cas-bpf, r=bjorn3

BPF: Disable atomic CAS

Enabling CAS for BPF targets (rust-lang#105708) breaks the build of core library.
The failure occurs both when building rustc for BPF targets and when
building crates for BPF targets with the current nightly.

The LLVM BPF backend does not correctly lower all `atomicrmw` operations
and crashes for unsupported ones.

Before we can enable CAS for BPF in Rust, we need to fix the LLVM BPF
backend first.

Fixes rust-lang#106795

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

6 participants