mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
linker: Never pass -no-pie
to non-gnu linkers
This commit is contained in:
parent
f315c35a77
commit
e8cf5721b1
@ -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");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user