Skip to content

Commit

Permalink
Auto merge of rust-lang#73384 - petrochenkov:gnulink, r=cuviper
Browse files Browse the repository at this point in the history
linker: Never pass `-no-pie` to non-gnu linkers

Fixes rust-lang#73370
  • Loading branch information
bors committed Jun 18, 2020
2 parents 7d16c1d + e8cf572 commit e55d3f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_codegen_ssa/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl<'a> Linker for GccLinker<'a> {
fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
match output_kind {
LinkOutputKind::DynamicNoPicExe => {
if !self.is_ld {
if !self.is_ld && self.sess.target.target.options.linker_is_gnu {
self.cmd.arg("-no-pie");
}
}
Expand All @@ -291,7 +291,7 @@ impl<'a> Linker for GccLinker<'a> {
LinkOutputKind::StaticNoPicExe => {
// `-static` works for both gcc wrapper and ld.
self.cmd.arg("-static");
if !self.is_ld {
if !self.is_ld && self.sess.target.target.options.linker_is_gnu {
self.cmd.arg("-no-pie");
}
}
Expand Down

0 comments on commit e55d3f9

Please sign in to comment.