diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 436853468ac3c..69797e2923531 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -670,7 +670,6 @@ pub const LOG_SECURITY: ::c_int = 13 << 3; pub const LOG_CONSOLE: ::c_int = 14 << 3; pub const LOG_NFACILITIES: ::c_int = 24; -#[link(name = "util")] extern { pub fn getnameinfo(sa: *const ::sockaddr, salen: ::socklen_t, diff --git a/src/unix/bsd/openbsdlike/mod.rs b/src/unix/bsd/openbsdlike/mod.rs index 1f430e8b72691..5430f7f73f5f3 100644 --- a/src/unix/bsd/openbsdlike/mod.rs +++ b/src/unix/bsd/openbsdlike/mod.rs @@ -447,7 +447,6 @@ pub const RTLD_GLOBAL: ::c_int = 0x100; pub const LOG_NFACILITIES: ::c_int = 24; -#[link(name = "util")] extern { pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 29de88bf4455c..b4f312e6ad190 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -203,16 +203,21 @@ cfg_if! { extern {} } else if #[cfg(any(target_os = "macos", target_os = "ios", - target_os = "android", - target_os = "openbsd", + target_os = "android"))] { + #[link(name = "c")] + #[link(name = "m")] + extern {} + } else if #[cfg(any(target_os = "openbsd", target_os = "bitrig"))] { #[link(name = "c")] #[link(name = "m")] + #[link(name = "util")] extern {} } else { #[link(name = "c")] #[link(name = "m")] #[link(name = "rt")] + #[link(name = "util")] extern {} } } diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index b8d6d0b1a6a25..9fd5cf4f60350 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -478,7 +478,6 @@ extern { static mut program_invocation_short_name: *mut ::c_char; } -#[link(name = "util")] extern { pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;