Skip to content

Commit

Permalink
Link libssp_nonshared.a on all musl targets
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeul committed Jan 22, 2022
1 parent 31cc632 commit 4c9bcf8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_target/src/spec/linux_musl_base.rs
Original file line number Diff line number Diff line change
@@ -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".to_string();

// libssp_nonshared.a is needed for __stack_chk_fail_local when using libc.so
base.post_link_args.insert(LinkerFlavor::Gcc, vec!["-lssp_nonshared".to_string()]);

// These targets statically link libc by default
base.crt_static_default = true;

Expand Down

0 comments on commit 4c9bcf8

Please sign in to comment.