Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.mk: restore _mingw.h for default _WIN32_WINNT #12217

Closed
wants to merge 1 commit into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Oct 27, 2023

In 8.4.0 we deleted _mingw.h as part of purging old-mingw support.
Turns out _mingw.h had the side-effect of setting a default
_WIN32_WINNT value expected by lib/config-win32.h to enable
getaddrinfo support in Makefile.mk mingw-w64 builds. This caused
disabling support for this unless specifying the value manually.

Restore this header and update its comment to tell why we continue
to need it.

This triggered a regression in official Windows curl builds starting
with 8.4.0_1. Fixed in 8.4.0_6. (8.5.0 will be using CMake.)

Regression from 3802910 #11625

Reported-by: zhengqwe on github
Helped-by: Nico Rieck
Fixes #12134
Fixes #12136
Closes #12217

In 8.4.0 we deleted `_mingw.h` as part of purging old-mingw support.
Turns out `_mingw.h` had the side-effect of setting a default
`_WIN32_WINNT` value expected by `lib/config-win32.h` to enable
`getaddinfo` support in `Makefile.mk` mingw-w64 builds. This caused
disabling support for this unless specifying the value manually.

Restore this header and update its comment to tell why we continue
to need it.

Regression from 3802910 curl#11625

Reported-by: zhengqwe on github
Helped-by: Nico Rieck
Fixes curl#12134
Fixes curl#12136
Closes #xxxxx
@bagder
Copy link
Member

bagder commented Oct 27, 2023

Awesome work on this @vszakats !

@vszakats
Copy link
Member Author

vszakats commented Oct 27, 2023

Thanks @bagder.

After more investigation this seems to be the correct fix. An even more correct fix would be to include windows.h or similar, and make this work for all compilers. But this would probably be a regression in build performance. windows.h in mingw-w64 begins with #including _mingw.h (back into v1.0), and ultimately ignoring sdkddkver.h.

@vszakats vszakats changed the title Makefile.mk: restore _mingw.h to set _WIN32_WINNT Makefile.mk: restore _mingw.h for default _WIN32_WINNT Oct 27, 2023
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 27, 2023
We did not set an explicit Windows target version previously.

curl (as of v8.4.0) doesn't utilize Windows features beyond Vista,
neither do any of the default dependencies. Meaning: binaries are
bit-by-bit identical when setting or not setting this.

However, it is a good idea to set it explititly to Vista, to ensure we
live up to our compatibility goal even if curl or a dependency decides
to implement features specific to newer Windows versions.

Before this patch targets were defined by toolchain defaults:
- x64, x86: 0x0a00 (Win10)
- arm64: 0x0601 (Win7) (requires Win10 anyway for the CPU)

This also works around regression found in curl v8.4.0:
curl/curl#12217
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 27, 2023
We did not set an explicit Windows target version previously.

curl (as of v8.4.0) doesn't utilize Windows features beyond Vista,
neither do any of the default dependencies. Meaning: binaries are
bit-by-bit identical when setting or not setting this.

However, it is a good idea to set it explititly to Vista, to ensure we
live up to our compatibility goal even if curl or a dependency decides
to implement features specific to newer Windows versions.

Before this patch targets were defined by toolchain defaults:
- x64, x86: 0x0a00 (Win10)
- arm64: 0x0601 (Win7) (requires Win10 anyway for the CPU)

This also works around the `getaddrinfo` regression found in curl
v8.4.0: curl/curl#12217
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 27, 2023
- fix making `.def` timestamp reproducible.
- dump imports for Windows curl.exe.
- explicitly set target Windows version (to Vista).
  also works around 8.4.0_1 failing to link to `getaddrinfo`.
  Ref: curl/curl#12217
  8.5.0 fixes this by above upstream PR, and curl-for-win also
  switches to CMake, which is not affected by the issue.
@vszakats vszakats closed this in 5839b8a Oct 28, 2023
@vszakats vszakats deleted the mk-mingw-win32_winnt branch October 28, 2023 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Could not resolve IPv6 address of host
2 participants