summaryrefslogtreecommitdiff
path: root/bootstrap/rust-1.62/0007-Link-libssp_nonshared.a-on-all-musl-targets.patch
blob: f2a2f734cd07ae9ace888fd6970b8e7879b74af7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 976ff1e1bbdbb9c0c0a32a6a27238b51e6467f8f Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 3 Nov 2019 17:01:32 -0600
Subject: [PATCH 07/14] Link libssp_nonshared.a on all musl targets

---
 compiler/rustc_target/src/spec/linux_musl_base.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
index 9931578ba86..a1cece5733c 100644
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
@@ -1,10 +1,13 @@
-use crate::spec::TargetOptions;
+use crate::spec::{LinkerFlavor, TargetOptions};
 
 pub fn opts() -> TargetOptions {
     let mut base = super::linux_base::opts();
 
     base.env = "musl".into();
 
+    // libssp_nonshared.a is needed for __stack_chk_fail_local when using libc.so
+    base.post_link_args.insert(LinkerFlavor::Gcc, vec!["-lssp_nonshared".into()]);
+
     // These targets statically link libc by default
     base.crt_static_default = true;
 
-- 
2.35.1