File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -824,7 +824,7 @@ impl Build {
824
824
825
825
/// Configures whether the compiler will emit position independent code.
826
826
///
827
- /// This option defaults to `false` for `windows-gnu` targets and
827
+ /// This option defaults to `false` for `windows-gnu` and `riscv` targets and
828
828
/// to `true` for all other targets.
829
829
pub fn pic ( & mut self , pic : bool ) -> & mut Build {
830
830
self . pic = Some ( pic) ;
@@ -1225,7 +1225,8 @@ impl Build {
1225
1225
cmd. push_cc_arg ( "-ffunction-sections" . into ( ) ) ;
1226
1226
cmd. push_cc_arg ( "-fdata-sections" . into ( ) ) ;
1227
1227
}
1228
- if self . pic . unwrap_or ( !target. contains ( "windows-gnu" ) ) {
1228
+ // Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet
1229
+ if self . pic . unwrap_or ( !target. contains ( "windows-gnu" ) && !target. contains ( "riscv" ) ) {
1229
1230
cmd. push_cc_arg ( "-fPIC" . into ( ) ) ;
1230
1231
// PLT only applies if code is compiled with PIC support,
1231
1232
// and only for ELF targets.
You can’t perform that action at this time.
0 commit comments