New comment by ifreund on void-packages repository https://github.com/void-linux/void-packages/pull/32555#issuecomment-901454842 Comment: @ericonr Here's a patch for that patch: ```diff diff --git a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch b/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch index 88e29d9ebc..b2e61ddb0b 100644 --- a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch +++ b/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch @@ -16,13 +16,13 @@ diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codege index 6c9ec9e7b0d..60f43f70e4e 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -2396,10 +2396,23 @@ fn add_upstream_native_libraries( +@@ -2396,10 +2396,24 @@ fn add_upstream_native_libraries( let verbatim = lib.verbatim.unwrap_or(false); match lib.kind { - NativeLibKind::Dylib { as_needed } => { - cmd.link_dylib(name, verbatim, as_needed.unwrap_or(true)) -+ NativeLibKind::Dylib | NativeLibKind::Unspecified => { ++ NativeLibKind::Dylib { .. } | NativeLibKind::Unspecified => { + // On some targets, like Linux, linking a static executable inhibits using + // dylibs at all. Force native libraries to be static, even if for example + // an upstream rlib was originally linked against a native shared library. @@ -34,8 +34,9 @@ index 6c9ec9e7b0d..60f43f70e4e 100644 + } else { + cmd.link_dylib(name, verbatim, + match lib.kind { -+ NativeLibKind::Dylib => as_needed.unwrap_or(true), -+ NativeLibKind::Unspecified => true ++ NativeLibKind::Dylib { as_needed } => as_needed.unwrap_or(true), ++ NativeLibKind::Unspecified => true, ++ _ => unreachable!() + }) + } } ```