From 830cddf5ca2781b2c5824c8c8a18fa378e23f0fa Mon Sep 17 00:00:00 2001 From: Achill Gilgenast Date: Fri, 19 Sep 2025 10:16:06 +0200 Subject: [PATCH 07/10] need-ssp_nonshared.patch 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 Signed-off-by: Achill Gilgenast --- compiler/rustc_llvm/build.rs | 2 ++ library/std/src/sys/pal/unix/mod.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index 069b684ad09b..7c20a9374e0b 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -119,6 +119,8 @@ fn main() { return; } + println!("cargo:rustc-link-lib=ssp_nonshared"); + restore_library_path(); let llvm_config = diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs index ba9e14b8009c..2a61fd06e3c1 100644 --- a/library/std/src/sys/pal/unix/mod.rs +++ b/library/std/src/sys/pal/unix/mod.rs @@ -373,6 +373,9 @@ pub fn abort_internal() -> ! { #[link(name = "dl", cfg(not(target_feature = "crt-static")))] #[link(name = "log", cfg(not(target_feature = "crt-static")))] unsafe extern "C" {} + } else if #[cfg(all(target_os = "linux", target_env = "musl"))] { + #[link(name = "ssp_nonshared", kind = "static")] + unsafe extern "C" {} } else if #[cfg(target_os = "freebsd")] { #[link(name = "execinfo")] #[link(name = "pthread")] -- 2.51.0