We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53a0b97 commit d0048abCopy full SHA for d0048ab
src/lib.rs
@@ -1996,12 +1996,13 @@ impl Build {
1996
cmd.push_cc_arg("-fdata-sections".into());
1997
}
1998
// Disable generation of PIC on bare-metal for now: rust-lld doesn't support this yet
1999
- if self.pic.unwrap_or(
+ if self.pic.unwrap_or_else(|| {
2000
!target.contains("windows")
2001
&& !target.contains("-none-")
2002
&& !target.ends_with("-none")
2003
- && !target.contains("uefi"),
2004
- ) {
+ && !target.contains("uefi")
+ && !Build::is_wasi_target(target)
2005
+ }) {
2006
cmd.push_cc_arg("-fPIC".into());
2007
// PLT only applies if code is compiled with PIC support,
2008
// and only for ELF targets.
0 commit comments