Skip to content

Commit ac5fd90

Browse files
committed
Don't pass -pie to linker on windows targets.
1 parent e0d5872 commit ac5fd90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_codegen_ssa/src/back/linker.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,11 @@ impl<'a> Linker for GccLinker<'a> {
281281
}
282282
}
283283
LinkOutputKind::DynamicPicExe => {
284-
// `-pie` works for both gcc wrapper and ld.
285-
self.cmd.arg("-pie");
284+
// noop on windows w/ gcc & ld, error w/ lld
285+
if !self.sess.target.is_like_windows {
286+
// `-pie` works for both gcc wrapper and ld.
287+
self.cmd.arg("-pie");
288+
}
286289
}
287290
LinkOutputKind::StaticNoPicExe => {
288291
// `-static` works for both gcc wrapper and ld.

0 commit comments

Comments
 (0)