Hi,
I'm trying to build a RiscV library to be integrated into existing C code.
I'm using the following target: riscv64gc-unknown-none-elf
When the link is executed I can see the following error message:
ld: skipping incompatible ../libs/my_lib/target/release/libmy_lib.a when searching for -lmy_lib
How can I check if my library has been built for the desired target?
Thanks,
.cargo/config.toml
[target.riscv64gc-unknown-none-elf]
rustflags = [
"-C", "link-arg=-Tlink.x",
]
[build]
target = "riscv64gc-unknown-none-elf"
src/lib.rs
#![no_std]
extern crate panic_halt;
#[unsafe(no_mangle)]
#[allow(non_snake_case)]
pub extern "C" fn MyFunction() -> u32 {
0
}
Cargo.toml
[package]
name = "my_lib"
version = "0.1.0"
edition = "2024"
[dependencies]
panic-halt = "1.0.0"
[lib]
name = "my_lib"
crate-type = ["staticlib"]