From: msizanoen1 Date: Thu, 5 Dec 2019 05:22:41 +0000 (+0700) Subject: Enable -fPIC on non-bare-metal RISC-V X-Git-Tag: archive/raspbian/1.40.0+dfsg1-5+rpi1^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ceba57c628b398381b17d2308d6266172b5d26c8;p=rustc.git Enable -fPIC on non-bare-metal RISC-V Gbp-Pq: Name u-riscv64-cc-461.patch --- diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs index 3d5cb8daf8..caadb5dfd8 100644 --- a/vendor/cc/src/lib.rs +++ b/vendor/cc/src/lib.rs @@ -1219,11 +1219,11 @@ impl Build { cmd.push_cc_arg("-ffunction-sections".into()); 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")) - { + // Disable generation of PIC on bare-metal RISC-V for now: rust-lld doesn't support this yet + if self.pic.unwrap_or( + !target.contains("windows-gnu") + && !(target.contains("riscv") && target.contains("-none-")), + ) { cmd.push_cc_arg("-fPIC".into()); // PLT only applies if code is compiled with PIC support, // and only for ELF targets.