Files
rust/src/libstd/sys_common
Ryan Cumming 090a968fe7 Only link res_init() on GNU/*nix
To workaround a bug in glibc <= 2.26 lookup_host() calls res_init()
based on the glibc version detected at runtime. While this avoids
calling res_init() on platforms where it's not required we will still
end up linking against the symbol.

This causes an issue on macOS where res_init() is implemented in a
separate library (libresolv.9.dylib) from the main libc. While this is
harmless for standalone programs it becomes a problem if Rust code is
statically linked against another program. If the linked program doesn't
already specify -lresolv it will cause the link to fail. This is
captured in issue #46797

Fix this by hooking in to the glibc workaround in `cvt_gai` and only
activating it for the "gnu" environment on Unix This should include all
glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc.

This has the side benefit of removing the #[cfg] in sys_common; only
unix.rs has code related to the workaround now.
2018-01-16 06:30:44 +11:00
..
2017-12-22 12:40:39 -05:00
2017-06-20 20:26:22 -07:00
2018-01-16 06:30:44 +11:00
2017-12-06 09:25:29 +01:00
2017-12-24 14:24:31 +00:00
2017-12-06 09:25:29 +01:00
2017-12-06 09:25:29 +01:00
2017-12-06 09:25:29 +01:00
2017-12-24 14:24:31 +00:00