summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Gjengset <jon@thesquareplanet.com>2017-05-03 15:17:24 -0400
committerJon Gjengset <jon@thesquareplanet.com>2017-05-03 15:17:24 -0400
commitfcf5fc0257bb01e84aabfa0efd0d09638145d105 (patch)
tree20f973174e74ba721125bae694e58d18fd896d9e
parentb3700e4364181c58dd7f56f1d90fdb91b181f007 (diff)
downloadrust-libc-fcf5fc0257bb01e84aabfa0efd0d09638145d105.tar.gz
Avoid special-casing linking with resolv
-rw-r--r--src/unix/mod.rs20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 2ef85f1cd5..a235d6a422 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -206,19 +206,9 @@ pub const PRIO_MAX: ::c_int = 20;
cfg_if! {
if #[cfg(dox)] {
// on dox builds don't pull in anything
- } else if #[cfg(all(not(stdbuild),
- feature = "use_std",
- not(any(target_os = "macos",
- target_os = "ios")
- )))] {
+ } else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
- } else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
- // except on macOS and iOS, where we must link with lib resolv
- // for res_init, despite libsystem_info including it:
- // http://blog.achernya.com/2013/03/os-x-has-silly-libsystem.html
- #[link(name = "resolv")]
- extern {}
} 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")))]
@@ -233,12 +223,8 @@ cfg_if! {
#[link(name = "m")]
extern {}
} else if #[cfg(any(target_os = "macos",
- target_os = "ios"))] {
- #[link(name = "c")]
- #[link(name = "m")]
- #[link(name = "resolv")]
- extern {}
- } else if #[cfg(any(target_os = "android",
+ target_os = "ios",
+ target_os = "android",
target_os = "openbsd",
target_os = "bitrig"))] {
#[link(name = "c")]