cmd.push_cc_arg("-fdata-sections".into());
}
// Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet
- if self.pic.unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv")) {
+ if self
+ .pic
+ .unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv"))
+ {
cmd.push_cc_arg("-fPIC".into());
// PLT only applies if code is compiled with PIC support,
// and only for ELF targets.
if let Some(arch) = parts.next() {
let arch = &arch[5..];
cmd.args.push(("-march=rv".to_owned() + arch).into());
- // ABI is always soft-float right now, update this when this is no longer the
- // case:
- if arch.starts_with("64") {
+ if target.contains("linux") && arch.starts_with("64") {
+ cmd.args.push("-mabi=lp64d".into());
+ } else if target.contains("linux") && arch.starts_with("32") {
+ cmd.args.push("-mabi=ilp32d".into());
+ } else if arch.starts_with("64") {
cmd.args.push("-mabi=lp64".into());
} else {
cmd.args.push("-mabi=ilp32".into());