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

add LoadLibrary("winhttp.dll")-fix GCC 8.3.0 link fail in blead perl #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bulk88
Copy link

@bulk88 bulk88 commented Oct 18, 2024

When compiling blead perl 5.41 with GCC 8.3.0 i686, Win32.xs has a link failure breaking blead.

C:/Strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw 32/bin/ld.exe: C:\sources\perl5\cpan\Win32/Win32.xs:1880: undefined reference to `WinHttpQueryHeaders@24'

Switch to loading winhttp.dll on demand with GetProcAddrees, not static DLL linking. Plus winhttp.dll has a huge tree of sub-dependency DLLs to many other MS WinOS DLLs. Most Win32.pm users and most perl.exe processes instances will never call Win32::HttpGetFile. Win32::HttpGetFile is a great feature, but it will never have the usage demand of Win32::GetLastError() for example, so load it on demand.

Fixing the GCC link failure is most important. This patch minimalistic to get blead perl+GCC to compile. I see other cleanup that can be done but this patch is minimalistic. Reference count the DLL Library handle for ithread reasons and libperl unloads.

When compiling blead perl 5.41 with GCC 8.3.0 i686, Win32.xs has a link
failure breaking blead.

C:/Strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw
32/bin/ld.exe: C:\sources\perl5\cpan\Win32/Win32.xs:1880: undefined reference to
`WinHttpQueryHeaders@24'

Switch to loading winhttp.dll on demand with GetProcAddrees, not
static DLL linking.  Plus winhttp.dll has a huge tree of sub-dependency
DLLs to many other MS WinOS DLLs. Most Win32.pm users and most perl.exe
processes instances will never call Win32::HttpGetFile. Win32::HttpGetFile
is a great feature, but it will never have the usage demand of
Win32::GetLastError() for example, so load it on demand.

Fixing the GCC link failure is most important. This patch minimalistic to
get blead perl+GCC to compile. I see other cleanup that can be done but
this patch is minimalistic. Reference count the DLL Library handle for
ithread reasons and libperl unloads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant