rust: update to 1.82.0
[void-pkg.git] / srcpkgs / rust / patches / 0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
blobf4e6962ca55c97132e65474d0b283feef329a0ae
1 From 7e100ca9dad23efa1aafccd8faf86ec5fa85c351 Mon Sep 17 00:00:00 2001
2 From: q66 <daniel@octaforge.org>
3 Date: Sun, 3 May 2020 18:02:03 +0200
4 Subject: [PATCH 10/15] Fix dynamic linkage of musl libc for the libc crate
6 diff --git a/vendor/libc-0.2.157/src/unix/mod.rs b/vendor/libc-0.2.157/src/unix/mod.rs
7 index 8b3d988ae..b4ab3db3f 100644
8 --- a/vendor/libc-0.2.157/src/unix/mod.rs
9 +++ b/vendor/libc-0.2.157/src/unix/mod.rs
10 @@ -347,7 +347,14 @@ cfg_if! {
11 #[link(name = "dl", cfg(not(target_feature = "crt-static")))]
12 #[link(name = "c", cfg(not(target_feature = "crt-static")))]
13 extern {}
14 - } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
15 + } else if #[cfg(target_env = "musl")] {
16 + #[link(name = "c")]
17 + extern {}
18 + #[cfg_attr(feature = "rustc-dep-of-std",
19 + link(name = "gcc", kind = "static", modifiers = "-bundle",
20 + cfg(target_feature = "crt-static")))]
21 + extern {}
22 + } else if #[cfg(target_env = "ohos")] {
23 #[cfg_attr(feature = "rustc-dep-of-std",
24 link(name = "c", kind = "static", modifiers = "-bundle",
25 cfg(target_feature = "crt-static")))]
26 diff --git a/vendor/libc-0.2.158/src/unix/mod.rs b/vendor/libc-0.2.158/src/unix/mod.rs
27 index 8b3d988ae..b4ab3db3f 100644
28 --- a/vendor/libc-0.2.158/src/unix/mod.rs
29 +++ b/vendor/libc-0.2.158/src/unix/mod.rs
30 @@ -347,7 +347,14 @@ cfg_if! {
31 #[link(name = "dl", cfg(not(target_feature = "crt-static")))]
32 #[link(name = "c", cfg(not(target_feature = "crt-static")))]
33 extern {}
34 - } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
35 + } else if #[cfg(target_env = "musl")] {
36 + #[link(name = "c")]
37 + extern {}
38 + #[cfg_attr(feature = "rustc-dep-of-std",
39 + link(name = "gcc", kind = "static", modifiers = "-bundle",
40 + cfg(target_feature = "crt-static")))]
41 + extern {}
42 + } else if #[cfg(target_env = "ohos")] {
43 #[cfg_attr(feature = "rustc-dep-of-std",
44 link(name = "c", kind = "static", modifiers = "-bundle",
45 cfg(target_feature = "crt-static")))]