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

wasm64: std fails to build with target-feature=+atomics #126778

Closed
wooden-worm opened this issue Jun 21, 2024 · 2 comments · Fixed by #126792
Closed

wasm64: std fails to build with target-feature=+atomics #126778

wooden-worm opened this issue Jun 21, 2024 · 2 comments · Fixed by #126792
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. 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

@wooden-worm
Copy link
Contributor

I tried to build an example project for wasm64-unknown-unknown with target-feature=+atomics, but the std failed to build due to

use crate::arch::wasm32;
and
use crate::arch::wasm32;
hardcoding wasm32 arch.

I could get std to build by adding #![feature(simd_wasm64)] to https://github.com/rust-lang/rust/blob/master/library/std/src/lib.rs, and a few cfg checks to import the correct module.

I could work on a PR if that's the right approach.

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (d7f6ebace 2024-06-16)
binary: rustc
commit-hash: d7f6ebacee13b6c03623c4b74197280454ede8de
commit-date: 2024-06-16
host: aarch64-apple-darwin
release: 1.81.0-nightly
LLVM version: 18.1.7
@wooden-worm wooden-worm added the C-bug Category: This is a bug. label Jun 21, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 21, 2024
@wooden-worm
Copy link
Contributor Author

There's another similar problem with building for wasm64 using target-feature=+simd128: portable-simd only supports wasm32

@workingjubilee
Copy link
Member

that sounds about right as a fix. feel free to PR it!

@jieyouxu jieyouxu added O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-libs Relevant to the library team, which will review and decide on the PR/issue. A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 23, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 1, 2024
wasm64 build with target-feature=+simd128,+atomics

Fixes rust-lang#126778
@bors bors closed this as completed in 6cf34c0 Jul 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 4, 2024
Rollup merge of rust-lang#126792 - wooden-worm:master, r=Mark-Simulacrum

wasm64 build with target-feature=+simd128,+atomics

Fixes rust-lang#126778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. 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.

4 participants