diff --git a/src/unix/mod.rs b/src/unix/mod.rs index cb66c049fd013..2d210196abacb 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -236,8 +236,8 @@ cfg_if! { // cargo build, don't pull in anything extra as the libstd dep // already pulls in all libs. } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] { - #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))] - #[link(name = "c", cfg(not(target_feature = "crt-static")))] + #[cfg_attr(stdbuild, link(name = "c", kind = "static", cfg(target_feature = "crt-static")))] + #[cfg_attr(stdbuild, link(name = "c", cfg(not(target_feature = "crt-static"))))] extern {} } else if #[cfg(target_os = "emscripten")] { #[link(name = "c")]