We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
-no-pie
1 parent f315c35 commit e8cf572Copy full SHA for e8cf572
src/librustc_codegen_ssa/back/linker.rs
@@ -280,7 +280,7 @@ impl<'a> Linker for GccLinker<'a> {
280
fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path) {
281
match output_kind {
282
LinkOutputKind::DynamicNoPicExe => {
283
- if !self.is_ld {
+ if !self.is_ld && self.sess.target.target.options.linker_is_gnu {
284
self.cmd.arg("-no-pie");
285
}
286
@@ -291,7 +291,7 @@ impl<'a> Linker for GccLinker<'a> {
291
LinkOutputKind::StaticNoPicExe => {
292
// `-static` works for both gcc wrapper and ld.
293
self.cmd.arg("-static");
294
295
296
297
0 commit comments