Skip to content

Commit fcf5fc0

Browse files
committed
Avoid special-casing linking with resolv
1 parent b3700e4 commit fcf5fc0

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/unix/mod.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,9 @@ pub const PRIO_MAX: ::c_int = 20;
206206
cfg_if! {
207207
if #[cfg(dox)] {
208208
// on dox builds don't pull in anything
209-
} else if #[cfg(all(not(stdbuild),
210-
feature = "use_std",
211-
not(any(target_os = "macos",
212-
target_os = "ios")
213-
)))] {
209+
} else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
214210
// cargo build, don't pull in anything extra as the libstd dep
215211
// already pulls in all libs.
216-
} else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
217-
// except on macOS and iOS, where we must link with lib resolv
218-
// for res_init, despite libsystem_info including it:
219-
// http://blog.achernya.com/2013/03/os-x-has-silly-libsystem.html
220-
#[link(name = "resolv")]
221-
extern {}
222212
} else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {
223213
#[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
224214
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
@@ -233,12 +223,8 @@ cfg_if! {
233223
#[link(name = "m")]
234224
extern {}
235225
} else if #[cfg(any(target_os = "macos",
236-
target_os = "ios"))] {
237-
#[link(name = "c")]
238-
#[link(name = "m")]
239-
#[link(name = "resolv")]
240-
extern {}
241-
} else if #[cfg(any(target_os = "android",
226+
target_os = "ios",
227+
target_os = "android",
242228
target_os = "openbsd",
243229
target_os = "bitrig"))] {
244230
#[link(name = "c")]

0 commit comments

Comments
 (0)