Skip to content

Commit

Permalink
Enable -fPIC on non-bare-metal RISC-V
Browse files Browse the repository at this point in the history
  • Loading branch information
msizanoen1 committed Dec 5, 2019
1 parent 661800e commit eaab26a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1366,10 +1366,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") && target.contains("-none")),
) {
cmd.push_cc_arg("-fPIC".into());
// PLT only applies if code is compiled with PIC support,
// and only for ELF targets.
Expand Down

0 comments on commit eaab26a

Please sign in to comment.