3 ms·
Tiniest of nits to pick but: > and I wish rustc would have a stand-alone assembly files support Rustc now supports inline assembly and global assembly in Rust
by roblabla 5y ago
Tiniest of nits to pick but:
> and I wish rustc would have a stand-alone assembly files support
Rustc now supports inline assembly and global assembly in Rust 1.59 (the very latest release). So this is now possible:
/// Lib.rs file
global_asm!(include_str!("asmfile.s"), options(raw));
Which will cause asmfile.s to be assembled and included in the rust library.
- JoshTriplett 5y agoAbsolutely, and any time you can use the built-in asm support, I'd recommend using it. But also, I'd love to see support for C and assembly files in rustc.
- wyldfire 5y agoNote that a really common use case for assembly files (.S files) is to expect that the file be transformed with the C preprocessor. It would be interesting to imagine a replacement with a rust equivalent but I can't help thinking that it's difficult or impossible to come up with an architecture / exec format independent replacement (other than m4). gas and cc1as support .macro directives - maybe that would suffice? But compatibility with existing assembly source files would suffer.