Skip to content

Commit 15fe24a

Browse files
msizanoen1alexcrichton
authored andcommitted
Default to double-float ABI on RISC-V Linux (#460)
1 parent 661800e commit 15fe24a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,9 +1588,11 @@ impl Build {
15881588
if let Some(arch) = parts.next() {
15891589
let arch = &arch[5..];
15901590
cmd.args.push(("-march=rv".to_owned() + arch).into());
1591-
// ABI is always soft-float right now, update this when this is no longer the
1592-
// case:
1593-
if arch.starts_with("64") {
1591+
if target.contains("linux") && arch.starts_with("64") {
1592+
cmd.args.push("-mabi=lp64d".into());
1593+
} else if target.contains("linux") && arch.starts_with("32") {
1594+
cmd.args.push("-mabi=ilp32d".into());
1595+
} else if arch.starts_with("64") {
15941596
cmd.args.push("-mabi=lp64".into());
15951597
} else {
15961598
cmd.args.push("-mabi=ilp32".into());

0 commit comments

Comments
 (0)