-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Propose add function level inline assembly for rust. #1793
Comments
By this, we can implement section and other platform specific things directly without burden the rustc
And the following is the HEX string generated by MSVC compiler:
Dump of file test.obj File Type: COFF OBJECT FILE HEADER VALUES SECTION HEADER #1 RAW DATA #1 Linker Directives /include:some_fucntion_implement_init SECTION HEADER #2 RAW DATA #2 SECTION HEADER #3 RAW DATA #3 RELOCATIONS #3 00000000 ADDR64 00000000 00000000 6 some_fucntion_implement_init_by_rust COFF SYMBOL TABLE String Table Size = 0x46 bytes Summary
|
Isn't this the same thing as just linking an external .o file using build.rs? |
@Amanieu it's different, cause we can creating the .o at the compile time without modifing the build.rs and |
For example:
extern "C" {
pub fn get_registers() inline_assembly = 'ByteArray Literal for the Object file to be linked directly';
}
and the ByteArray Literal could be generated a procedure macro.
extern "C" {
pub fn get_registers() inline_assembly = get_registers_macro_assembly!();
}
The text was updated successfully, but these errors were encountered: