You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current c2rust produces assembler in the style of asm!("cpsie i" : : : "memory" : "volatile"), which is the style nowadays used with the llvm_asm macro since rust-lang/rust#71007 was merged.
A short-term solution I'm currently using as a workaround is to replace " asm!(" with " llvm_asm!(" in the output (hoping nobody puts this into literals); that's the route I'd like to take for a fix in c2rust as well. It has produced working binaries, though I'm not sure it ever passed through the asm code. (But hey, at least it built).
(A long-term solution might be using modern asm!, but a) that can wait until stable and b) it's probably better suited for a separate ... casm2rust? project, if it's ever really needed at all).
A thing I missed originally (as I'm only using --emit-modules) but discovered in unrelated testing: The feature(asm) present when exporting transpiled code as a whole needs to become feature(llvm_asm) as well.
The third occurrence of asm, global_asm!, seems to be unaffected by this transition, and did not have its name changed when asm was renamed to llvm_asm.
Closing as this is no longer relevant: in current Rust, llvm_asm! is gone, asm! is stable since 1.59, and PR #374 landed translation that produces asm!. Anything left is tracked in #363.
Activity
chrysn commentedon Sep 22, 2020
A thing I missed originally (as I'm only using
--emit-modules) but discovered in unrelated testing: Thefeature(asm)present when exporting transpiled code as a whole needs to becomefeature(llvm_asm)as well.chrysn commentedon Sep 22, 2020
The third occurrence of asm,
global_asm!, seems to be unaffected by this transition, and did not have its name changed when asm was renamed to llvm_asm.ahomescu commentedon Sep 22, 2020
This makes sense to me, afaik when they introduced the new asm syntax they just renamed the old macro from
asm!tollvm_asm!.fw-immunant commentedon Apr 13, 2022
Closing as this is no longer relevant: in current Rust,
llvm_asm!is gone,asm!is stable since 1.59, and PR #374 landed translation that producesasm!. Anything left is tracked in #363.Acknowledge that assebly can be pulled in through static inlines