From 7002d81e5e161c4d43301ebfb1d535a7a5685587 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Date: Wed, 21 Sep 2022 08:07:25 +0200
Subject: [PATCH 06/10] Link with libssp_nonshared and libexecinfo

[ismael@iodev.co.uk: Adjusted based on patches from Void and Alpine for 1.63.0]
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 library/std/build.rs        | 2 ++
 library/unwind/build.rs     | 3 +++
 vendor/libc/src/unix/mod.rs | 6 +++---
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs
index 34a023b02..934a87570 100644
--- a/library/std/src/sys/unix/mod.rs
+++ b/library/std/src/sys/unix/mod.rs
@@ -297,6 +297,10 @@ cfg_if::cfg_if! {
         #[link(name = "dl")]
         #[link(name = "log")]
         extern "C" {}
+    } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
+        #[link(name = "ssp_nonshared")]
+        #[link(name = "execinfo")]
+        extern "C" {}
     } else if #[cfg(target_os = "freebsd")] {
         #[link(name = "execinfo")]
         #[link(name = "pthread")]
--
2.30.0
