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

Web Assembly Atomic fence support in atomic::fence #72997

Closed
poliorcetics opened this issue Jun 4, 2020 · 0 comments · Fixed by #73036
Closed

Web Assembly Atomic fence support in atomic::fence #72997

poliorcetics opened this issue Jun 4, 2020 · 0 comments · Fixed by #73036
Labels
C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@poliorcetics
Copy link
Contributor

The function pub fence(order: Ordering) in libcore/sync/atomic.rs does nothing when compiled for Web Assembly.

This stem from an old issue in web assembly #WebAssembly/tool-conventions/issues/59 and LLVM crashing (at the time) with it.

This has since been fixed, notably for LLVM, maybe we can remove the #[cfg(...)] and comment about it ?

@jonas-schievink jonas-schievink added T-libs Relevant to the library team, which will review and decide on the PR/issue. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ labels Jun 4, 2020
@crlf0710 crlf0710 added the C-bug Category: This is a bug. label Jun 11, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 11, 2020
…ark-Simulacrum

std: Enable atomic.fence emission on wasm32

This commit removes the `#[cfg]` guards in `atomic::fence` on wasm
targets. Since these guards were originally added the upstream wasm
specification for threads gained an `atomic.fence` instruction, so LLVM
no longer panics on these intrinsics.

Although there aren't a ton of tests in-repo for this right now I've
tested locally and all of these fences generate `atomic.fence`
instructions in wasm.

Closes rust-lang#65687
Closes rust-lang#72997
@bors bors closed this as completed in 05b2d3f Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants