Currently Rust stdlib on macOS requires every executable to link to libresolv.dylib. This is probably unnecessary and happens only because res_init_if_glibc_before_2_26 is called on all #[cfg(unix)] platforms.
On macOS -lresolv is rarely used, so Rust static libraries cause linker errors in most C programs due to _res_9_init missing.
Can the res_init_if_glibc_before_2_26 hack be limited to #[cfg(linux)] or something with not(target_os = "macos")?
Currently Rust stdlib on macOS requires every executable to link to
libresolv.dylib. This is probably unnecessary and happens only becauseres_init_if_glibc_before_2_26is called on all#[cfg(unix)]platforms.On macOS
-lresolvis rarely used, so Rust static libraries cause linker errors in most C programs due to_res_9_initmissing.Can the
res_init_if_glibc_before_2_26hack be limited to#[cfg(linux)]or something withnot(target_os = "macos")?