diff options
| author | bors <bors@rust-lang.org> | 2020-06-18 04:29:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-18 04:29:23 +0000 |
| commit | e55d3f9c5213fe1a25366450127bdff67ad1eca2 (patch) | |
| tree | a75a537d742c221ba3c706ef66d54ae86c2e9a83 /src | |
| parent | 7d16c1d5f56b07190c0ac4dddd3721474b0c672f (diff) | |
| parent | e8cf5721b1b3ebdc8ee69d15a375afd2eab0dd8f (diff) | |
| download | rust-e55d3f9c5213fe1a25366450127bdff67ad1eca2.tar.gz rust-e55d3f9c5213fe1a25366450127bdff67ad1eca2.zip | |
Auto merge of #73384 - petrochenkov:gnulink, r=cuviper
linker: Never pass `-no-pie` to non-gnu linkers Fixes https://github.com/rust-lang/rust/issues/73370
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_codegen_ssa/back/linker.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs index b17c3678207..efcabc57e6f 100644 --- a/src/librustc_codegen_ssa/back/linker.rs +++ b/src/librustc_codegen_ssa/back/linker.rs @@ -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"); } } @@ -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"); } } |
