-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
windows: reduce/stop loading DLLs at runtime #17413
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
Conversation
dbc8ebe
to
28c0786
Compare
Also, do we need to dynamically load any of these libraries anymore, I have a Windows XP VM and I see them there, and some of them look really old I don't know how anyone would not have them at this point, the only thing that might be an issue is Windows CE which is being deprecated so I think maybe we can link to these libraries Lines 81 to 93 in 1c31498
|
As per a quick local search WinCE doesn't have Another thing to check is if these DLLs do actually export the functions |
MS docs say that
|
The lib3026 load library calls were added in 856b133 #9412 It pre-loads the DLLs to avoid Windows loading them on each One call is gone in this PR by making the SSPI call non-dynamic. To avoid the other one, an option is to make it a non-dynamic call when building for Vista or upper, |
7a0b7e4
to
00c5c5b
Compare
On a thorough re-read of #9412, the issue experienced (and mitigated via DLL pre-load) Attempt to address in #17414. |
Curl_load_library
from lib, drop local implementation00c5c5b
to
1b4058c
Compare
- appveyor: make a job target Windows XP. - examples/block_ip: force this specific example to target Vista to make it compile when building curl for Windows XP. Fixing: ``` docs\examples\block_ip.c(157): warning C4013: 'inet_pton' undefined; assuming extern returning int docs\examples\block_ip.c(272): warning C4013: 'inet_ntop' undefined; assuming extern returning int ``` Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52102142/job/2ajdluhc20r4gmmw#L530 Cherry-picked from #17413 Closes #17415
8522e7c
to
97fbacc
Compare
curl no longer supports old/legacy/classic mingw. This mitigation was addressing slow perf seen in CI with old mingw. The slow perf is not seen in current CI with supported compilers. Remove the duplicate DLL load function from libtest. It's no longer used after this patch. Current CI run times for test3026 on GHA/windows: ``` test 3026...[curl_global_init thread-safety] # mingw, CM clang-x86_64 gnutls libssh -------e--- OK (1715 out of 1738, remaining: 00:02, took 0.196s, duration: 02:55) # dl-mingw, CM 9.5.0-x86_64 schannel -------e--- OK (1554 out of 1577, remaining: 00:02, took 0.217s, duration: 02:29) # msvc, CM x64-windows schannel +examples -------e--- OK (1578 out of 1601, remaining: 00:02, took 0.205s, duration: 02:50) ``` Follow-up to 3802910 #11625 Follow-up to 856b133 #9412 Ref: #17413 Closes #17414
configure: add secur32/security for SSPI
`security` is missing its implib before mingw-w64 6.0 also MSDN documents the lib as secur32. https://github.com/curl/curl/actions/runs/15173570065/job/42669218814?pr=17413 https://learn.microsoft.com/en-us/windows/win32/api/sspi/nf-sspi-initsecurityinterfacea
When targeting Vista or newer.
c8f8af6
to
8325dc6
Compare
@jay: Transformed this PR based on your suggestion to avoid loading DLLs dynamically |
This reverts commit 3d44751. Due to slow performance. run tests step is reaching almost 10 minutes, compared to normal 2.5 to 3 minutes.
- replace dynamic `InitSecurityInterface()` call with early binding and link `secur32` system DLL. The library and function are available in all supported curl Windows targets, meaning WinXP or newer. Add small hack for mingw32ce to make it build. - detect and use `if_nametoindex()` on Windows when available. Link `iphlpapi` system DLL. Requires targeting Vista or newer. Replacing the dynamic call and the pre-load optimization for lib3026. Suggested-by: Jay Satiro Closes curl#17413
Instead of CURL_WINDOWS_SSPI. When running CMake on Windows with no additional parameters (ie default build configuration), the generated project files do not include the `secur32.lib` library in the linker settings. This is because the relevant check was looking at `CURL_WINDOWS_SSPI` instead of `USE_WINDOWS_SSPI`. `USE_WINDOWS_SSPI` is enabled when building with SChannel (the default on Windows), or if `CURL_WINDOWS_SSPI` is specified on the command line. Follow-up to 0d71b18 #17413 Closes #17728
Static libcurl on Windows, built for Vista and up requires the iphlpapi system DLL since this curl commit: curl/curl@0d71b18 curl/curl#17413 Reported-by: Jacob Mealey Bug: curl/trurl#395 (comment)
replace dynamic
InitSecurityInterface()
call with early binding andlink
secur32
system DLL.The library and function are available in all supported curl Windows
targets, meaning WinXP or newer. Add small hack for mingw32ce to
make it build.
detect and use
if_nametoindex()
on Windows when available. Linkiphlpapi
system DLL. Requires targeting Vista or newer.Replacing the dynamic call and the pre-load optimization for lib3026.
Suggested-by: Jay Satiro
rebase on GHA/windows: run tests in a WinXP build #17426 once merged.