Skip to content

Commit

Permalink
Auto merge of #2944 - thomcc:apple-iconv, r=JohnTitor
Browse files Browse the repository at this point in the history
Don't link against iconv on apple targets when used by `std`

See #2870 (and specifically my, erm, rant in #2870 (comment)). I think we should probably remove it outright, but we definitely shouldn't have it in every Rust program by giving it to `std`.

FIxes #2870
  • Loading branch information
bors committed Oct 9, 2022
2 parents a0ff4d2 + 8a045af commit 8501d72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/unix/bsd/apple/mod.rs
Expand Up @@ -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(
Expand Down

0 comments on commit 8501d72

Please sign in to comment.