void-packages/srcpkgs/rust/patches/0010-Fix-dynamic-linkage-of...

26 lines
1.2 KiB
Diff

From 7e100ca9dad23efa1aafccd8faf86ec5fa85c351 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 3 May 2020 18:02:03 +0200
Subject: [PATCH 10/15] Fix dynamic linkage of musl libc for the libc crate
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
index b005970b9..c53093a09 100644
--- a/vendor/libc/src/unix/mod.rs
+++ b/vendor/libc/src/unix/mod.rs
@@ -351,7 +351,14 @@ cfg_if! {
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
- } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
+ } else if #[cfg(target_env = "musl")] {
+ #[link(name = "c")]
+ extern {}
+ #[cfg_attr(feature = "rustc-dep-of-std",
+ link(name = "gcc", kind = "static", modifiers = "-bundle",
+ cfg(target_feature = "crt-static")))]
+ extern {}
+ } else if #[cfg(target_env = "ohos")] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]