From: msizanoen1 Date: Sun, 1 Dec 2019 13:19:11 +0000 (+0700) Subject: Default to double-float ABI on RISC-V Linux X-Git-Tag: archive/raspbian/1.40.0+dfsg1-5+rpi1^2~22 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a7bf852a49c46b90be4298bdc60239fa141612e9;p=rustc.git Default to double-float ABI on RISC-V Linux Gbp-Pq: Name u-riscv64-cc-460.patch --- diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs index 9d8ef96443..3d5cb8daf8 100644 --- a/vendor/cc/src/lib.rs +++ b/vendor/cc/src/lib.rs @@ -1220,7 +1220,10 @@ impl Build { 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. @@ -1429,9 +1432,11 @@ impl Build { 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());