Navigation Menu

Skip to content

Commit

Permalink
Don't pass -pie to linker on windows targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmana committed May 18, 2021
1 parent e0d5872 commit ac5fd90
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Expand Up @@ -281,8 +281,11 @@ impl<'a> Linker for GccLinker<'a> {
}
}
LinkOutputKind::DynamicPicExe => {
// `-pie` works for both gcc wrapper and ld.
self.cmd.arg("-pie");
// noop on windows w/ gcc & ld, error w/ lld
if !self.sess.target.is_like_windows {
// `-pie` works for both gcc wrapper and ld.
self.cmd.arg("-pie");
}
}
LinkOutputKind::StaticNoPicExe => {
// `-static` works for both gcc wrapper and ld.
Expand Down

0 comments on commit ac5fd90

Please sign in to comment.