mirror of
https://github.com/curl/curl.git
synced 2025-03-13 15:37:04 +08:00
1. Re-enable `HAVE_GETADDRINFO` detection on Windows Commit d08ee3c83d6bd416aef62ff844c98e47c4682429 (in 2013) added logic that automatically assumed `getaddrinfo()` to be present for builds with IPv6 enabled. As it turns out, certain toolchains (e.g. original MinGW) by default target older Windows versions, and thus do not support `getaddrinfo()` out of the box. The issue was masked for a while by CMake builds forcing a newer Windows version, but that logic got deleted in commit 8ba22ffb2030ed91312fc8634e29516cdf0a9761. Since then, some CI builds started failing due to IPv6 enabled, `HAVE_GETADDRINFO` set, but `getaddrinfo()` in fact missing. It also turns out that IPv6 works without `getaddrinfo()` since commit 67a08dca27a6a07b36c7f97252e284ca957ff1a5 (from 2019, via #4662). So, to resolve all this, we can now revert the initial commit, thus restoring `getaddrinfo()` detection and support IPv6 regardless of its outcome. Reported-by: Daniel Stenberg 2. Omit `bcrypt` with original MinGW Original (aka legacy/old) MinGW versions do not support `bcrypt` (introduced with Vista). We already have logic to handle that in `lib/rand.c` and autotools builds, where we do not call the unsupported API and do not link `bcrypt`, respectively, when using original MinGW. This patch ports that logic to CMake, fixing the link error: `c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lbcrypt` Ref: https://ci.appveyor.com/project/curlorg/curl/builds/44624888/job/40vle84cn4vle7s0#L508 Regression since 76172511e7adcf720f4c77bd91f49278300ec97e Fixes #9214 Fixes #9393 Fixes #9395 Closes #9396