summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/unix/bsd/apple/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index a9438ef57a..0662e81fc6 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -5873,7 +5873,10 @@ cfg_if! {
}
}
-#[link(name = "iconv")]
+// These require a dependency on `libiconv`, and including this when built as
+// part of `std` means every Rust program gets it. Ideally we would have a link
+// modifier to only include these if they are used, but we do not.
+#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
extern "C" {
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(