void-packages/srcpkgs/rust/patches/0014-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
2019-12-29 16:22:23 +01:00

44 lines
1.6 KiB
Diff

From fae4aa3f952fc61880b71416527346a70fc69b4f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 21 Dec 2019 17:04:55 +0100
Subject: [PATCH 14/18] Fix dynamic linkage of musl libc for the libc crate
---
vendor/libc/src/lib.rs | 1 +
vendor/libc/src/unix/mod.rs | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
index 3255303e..bfbd2d7a 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
@@ -33,6 +33,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
#![no_std]
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
+#![cfg_attr(feature = "rustc-dep-of-std", feature(static_nobundle))]
#![cfg_attr(target_os = "redox", feature(static_nobundle))]
#[macro_use]
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
index 238da24b..ffb05ee7 100644
--- a/vendor/libc/src/unix/mod.rs
+++ b/vendor/libc/src/unix/mod.rs
@@ -299,11 +299,11 @@ cfg_if! {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
} else if #[cfg(target_env = "musl")] {
+ #[link(name = "c")]
+ extern {}
#[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", kind = "static",
+ link(name = "gcc", kind = "static-nobundle",
cfg(target_feature = "crt-static")))]
- #[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", cfg(not(target_feature = "crt-static"))))]
extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
--
2.24.0