We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53a0b97 commit c1f07fcCopy full SHA for c1f07fc
src/lib.rs
@@ -1996,11 +1996,14 @@ 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(
2000
- !target.contains("windows")
2001
- && !target.contains("-none-")
2002
- && !target.ends_with("-none")
2003
- && !target.contains("uefi"),
+ if self.pic.unwrap_or_else(
+ || {
+ !target.contains("windows")
+ && !target.contains("-none-")
+ && !target.ends_with("-none")
2004
+ && !target.contains("uefi")
2005
+ && !Build::is_wasi_target(target)
2006
+ }
2007
) {
2008
cmd.push_cc_arg("-fPIC".into());
2009
// PLT only applies if code is compiled with PIC support,
0 commit comments