this is needed for libssp-less __stack_chk_fail_local (on x86), the other Bdynamic patch seems to break the top hunk, so we need the bottom hack -- diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 68c9520..63f8a48 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -357,6 +357,9 @@ cfg_if::cfg_if! { #[link(name = "dl", cfg(not(target_feature = "crt-static")))] #[link(name = "log", cfg(not(target_feature = "crt-static")))] extern "C" {} + } else if #[cfg(all(target_os = "linux", target_env = "musl"))] { + #[link(name = "ssp_nonshared", kind = "static")] + extern "C" {} } else if #[cfg(target_os = "freebsd")] { #[link(name = "execinfo")] #[link(name = "pthread")] --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -108,6 +108,8 @@ return; } + println!("cargo:rustc-link-lib=ssp_nonshared"); + restore_library_path(); let target = env::var("TARGET").expect("TARGET was not set");