sniper
1
Is there a way to include assembly.S file in cargo project for risc-v ?
When I tested with test.S in src/asm directory;
src/asm/test.S
#![no_std]
#![no_main]
use core::arch::asm;
asm!( "mret");
src/main.rs
#![no_std]
#![no_main]
global_asm!(include_str!("asm/test.S"));
it throws the error
error**: unexpected token**
However, inline assembly in main.rs asm!( "mret");
works.
What is the correct way to include risc-v assembly file with .S extension?
vague
2
This is the correct way to do it.
Share with complete error msg from rustc instead of from your IDE.
sniper
4
Thanks, while trying to get you the code, figured out (the cause) that the assembly test.S file had asm! instantiation.
system
Closed
5
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.