Skip to content

macOS executables unnecessarily depend on libresolv.dylib #46797

Closed
@kornelski

Description

@kornelski

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")?

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-macosOperating system: macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions