Skip to content

Commit 2e8afca

Browse files
committed
Link libssp_nonshared.a on all musl targets
1 parent 5726b61 commit 2e8afca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_target/src/spec/linux_musl_base.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
use crate::spec::TargetOptions;
1+
use crate::spec::{LinkerFlavor, TargetOptions};
22

33
pub fn opts() -> TargetOptions {
44
let mut base = super::linux_base::opts();
55

66
base.env = "musl".into();
77

8+
// libssp_nonshared.a is needed for __stack_chk_fail_local when using libc.so
9+
base.post_link_args.insert(LinkerFlavor::Gcc, vec!["-lssp_nonshared".into()]);
10+
811
// These targets statically link libc by default
912
base.crt_static_default = true;
1013

0 commit comments

Comments
 (0)