Skip to content

Commit a43c1f7

Browse files
committed
Enable -fPIC on non-bare-metal RISC-V
1 parent 661800e commit a43c1f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1366,10 +1366,10 @@ impl Build {
13661366
cmd.push_cc_arg("-fdata-sections".into());
13671367
}
13681368
// Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet
1369-
if self
1370-
.pic
1371-
.unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv"))
1372-
{
1369+
if self.pic.unwrap_or(
1370+
!target.contains("windows-gnu")
1371+
&& !(target.contains("riscv") && target.contains("-none-")),
1372+
) {
13731373
cmd.push_cc_arg("-fPIC".into());
13741374
// PLT only applies if code is compiled with PIC support,
13751375
// and only for ELF targets.

0 commit comments

Comments
 (0)