Note 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.
You could have a build.rs script preprocess them with the C preprocessor if you really wanted. Or write a proc macro implementing a limited C preprocessor... ugh
> 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:
Which will cause asmfile.s to be assembled and included in the rust library.