-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
naked_asm!
on wasm emits invalid assembly
#135518
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
O-wasm
Target: WASM (WebAssembly), http://webassembly.org/
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Yes this was just missed so far, and I agree that it should work. Supporting wasm-asm appears mostly straightforward, but emitting |
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Jan 21, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? `@bjorn3` cc `@daxpedda,` `@tgross35`
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jan 21, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ``@bjorn3`` cc ``@daxpedda,`` ``@tgross35``
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jan 21, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ```@bjorn3``` cc ```@daxpedda,``` ```@tgross35```
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jan 22, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ````@bjorn3```` cc ````@daxpedda,```` ````@tgross35````
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Jan 23, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? `````@bjorn3````` cc `````@daxpedda,````` `````@tgross35`````
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jan 23, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ``````@bjorn3`````` cc ``````@daxpedda,`````` ``````@tgross35``````
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 24, 2025
Rollup merge of rust-lang#135648 - folkertdev:naked-asm-wasm, r=bjorn3 support wasm inline assembly in `naked_asm!` fixes rust-lang#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ```````@bjorn3``````` cc ```````@daxpedda,``````` ```````@tgross35```````
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this issue
Jan 25, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang/rust#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ```````@bjorn3``````` cc ```````@daxpedda,``````` ```````@tgross35```````
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this issue
Jan 27, 2025
support wasm inline assembly in `naked_asm!` fixes rust-lang/rust#135518 Webassembly was overlooked previously, but now `naked_asm!` and `#[naked]` functions work on the webassembly targets. Or, they almost do right now. I guess this is no surprise, but the `wasm32-unknown-unknown` target causes me some trouble. I'll add some inline comments with more details. r? ```````@bjorn3``````` cc ```````@daxpedda,``````` ```````@tgross35```````
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
O-wasm
Target: WASM (WebAssembly), http://webassembly.org/
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This should work (at least, I don't know of any reason it shouldn't), but it looks like the way we wrap it is something that LLVM doesn't like (trimmed output):
IR for reference:
I don't know enough about wasm to know what is correct here, but looking at some wasm codegen it seems like
.pushsection
should become.section
,.popsection
should be dropped, and we should emit.functype
directives (e.g..functype somefunc (f64) -> (f64)
)https://rust.godbolt.org/z/re5sverch
cc @folkertdev for naked functions and @daxpedda for knowing more about wasm-asm
The text was updated successfully, but these errors were encountered: