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 Jun 24, 2024
1 parent 8bf231b commit f516ef7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_target/src/spec/base/linux_musl.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use crate::spec::{base, TargetOptions};
use crate::spec::{base, Cc, LinkerFlavor, Lld, TargetOptions};

pub fn opts() -> TargetOptions {
let mut base = base::linux::opts();

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

// libssp_nonshared.a is needed for __stack_chk_fail_local when using libc.so
base.add_post_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-lssp_nonshared"]);

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

Expand Down

0 comments on commit f516ef7

Please sign in to comment.