Skip to content

Commit b154938

Browse files
committed
risc-v: Set ABI correctly for 32-bit targets
Pick the correct softfloat mode based on bitness: - `-mabi=lp64` for 64 bit RISC-V - `-mabi=ilp32` for 32-bit RISC-V Currently it fails for rv32 due to a conflict between the ABI and arch: cc1: error: ABI requires -march=rv64
1 parent f6f6c81 commit b154938

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,11 @@ impl Build {
14361436
cmd.args.push(("-march=rv".to_owned() + arch).into());
14371437
// ABI is always soft-float right now, update this when this is no longer the
14381438
// case:
1439-
cmd.args.push("-mabi=lp64".into());
1439+
if arch.starts_with("64") {
1440+
cmd.args.push("-mabi=lp64".into());
1441+
} else {
1442+
cmd.args.push("-mabi=ilp32".into());
1443+
}
14401444
}
14411445
}
14421446
}

0 commit comments

Comments
 (0)