-
Notifications
You must be signed in to change notification settings - Fork 525
Open
Description
Currently cc
builds for riscv*-unknown-none-elf
targets with -mabi=lp64
:
Lines 1973 to 1975 in 06c1289
} else if arch.starts_with("64") { | |
cmd.args.push(("-march=rv".to_owned() + arch).into()); | |
cmd.args.push("-mabi=lp64".into()); |
However for riscv64gc-unknown-none-elf
rustc produces lp64d
binaries, which would fail to link with lp64
binaries. Adding .flag("-mabi=lp64d")
works around this issue.
See this demo repo: https://github.com/dramforever/demo-cc-rs-riscv64gc
$ cargo build --target riscv64gc-unknown-none-elf
Compiling demo-cc-rs-riscv64gc v0.1.0 (/home/dram/code/virtiotic/demo-cc-rs-riscv64gc)
error: linking with `rust-lld` failed: exit status: 1
|
= note: [omitted]
= note: rust-lld: error: /home/dram/code/virtiotic/demo-cc-rs-riscv64gc/target/riscv64gc-unknown-none-elf/debug/build/demo-cc-rs-riscv64gc-add89ab8ebfbee8b/out/libanswer.a(answer.o): cannot link object files with different floating-point ABI
error: could not compile `demo-cc-rs-riscv64gc` due to previous error
Maybe we should copy the default ABI settings from rustc instead of using the current detection scheme. Unfortunately I couldn't find any docs on this.
Metadata
Metadata
Assignees
Labels
No labels