Default to double-float ABI on RISC-V Linux
authormsizanoen1 <qtmlabs@protonmail.com>
Sun, 1 Dec 2019 13:19:11 +0000 (20:19 +0700)
committerXimin Luo <infinity0@debian.org>
Sun, 5 Jan 2020 13:35:46 +0000 (13:35 +0000)
Gbp-Pq: Name u-riscv64-cc-460.patch

vendor/cc/src/lib.rs

index 9d8ef9644353ef715e8f1d455951529fcf115037..3d5cb8daf8f10d0fcfb19a55c9442b01f9de963f 100644 (file)
@@ -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());