From: Wladimir J. van der Laan Date: Thu, 8 Aug 2019 06:52:55 +0000 (+0000) Subject: risc-v: Set ABI correctly for 32-bit targets X-Git-Tag: archive/raspbian/1.40.0+dfsg1-5+rpi1^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3049e9f29aa737c6f2825a62792a214bf314523c;p=rustc.git 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 Gbp-Pq: Name u-riscv64-cc-429.patch --- diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs index 8ce062cc34..5b36f7d7c0 100644 --- a/vendor/cc/src/lib.rs +++ b/vendor/cc/src/lib.rs @@ -1430,7 +1430,11 @@ impl Build { 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: - cmd.args.push("-mabi=lp64".into()); + if arch.starts_with("64") { + cmd.args.push("-mabi=lp64".into()); + } else { + cmd.args.push("-mabi=ilp32".into()); + } } } }