hangover icon indicating copy to clipboard operation
hangover copied to clipboard

[aarch64-musl] ws2_32.dll failed to initialize // could not load kernel32.dll

Open bareich opened this issue 2 years ago • 10 comments

Realizing that this is the more appropriate place to post the information, I'm moving this over from the WineHQ forum:

I compiled llvm-mingw from source (no musl binaries for download) and then Hangover as explained in the README.

Any exe I try to run with wine causes errors about ws2_32.dll and kernel32.dll:

/hangover/wine/build% find ./ -name kernel32.dll -o -name ws2_32.dll
./dlls/kernel32/aarch64-windows/kernel32.dll
./dlls/kernel32/i386-windows/kernel32.dll
./dlls/ws2_32/aarch64-windows/ws2_32.dll
./dlls/ws2_32/i386-windows/ws2_32.dll

/hangover/wine/build% ./wine programs/winecfg/aarch64-windows/winecfg.exe
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
002c:err:module:loader_init "ws2_32.dll" failed to initialize, aborting
002c:err:module:loader_init Initializing dlls for L"C:\\windows\\system32\\wineboot.exe" failed, status c0000142
wine: could not load kernel32.dll, status c0000135

/hangover/wine/build% ./wine programs/winecfg/i386-windows/winecfg.exe
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
002c:err:module:loader_init "ws2_32.dll" failed to initialize, aborting
002c:err:module:loader_init Initializing dlls for L"C:\\windows\\system32\\wineboot.exe" failed, status c0000142
0024:err:environ:init_peb starting L"Z:\\hangover\\wine\\build\\programs\\winecfg\\i386-windows\\winecfg.exe" in experimental wow64 mode
wine: could not load kernel32.dll, status c0000135

Any ideas?

(Note that this doesn't necessarily have to do with musl, but I figured I'd point it out for good measure.)

bareich avatar Nov 02 '23 14:11 bareich

That should not happen. What you can try to narrow down the issue is:

  • Try a Wine wow64 build, that is building a vanilla Wine (e.g. without Hangover modifications) as described in my README and try to run something
  • Try Hangover on a glibc based system

AndreRH avatar Nov 02 '23 17:11 AndreRH

The Hangover version I built with this configuration:

../configure --disable-tests --with-mingw --enable-archs=i386,aarch64

Shall I use the same options (and MinGW in $PATH) for the vanilla build?

bareich avatar Nov 02 '23 19:11 bareich

Yes exactly

AndreRH avatar Nov 02 '23 20:11 AndreRH

With vanilla wine, the error for aarch64-windows/winecfg.exe is exactly as above.

The error with i386-windows/winecfg.exe differs slightly:

/wine/build/wine programs/winecfg/i386-windows/winecfg.exe
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
002c:err:module:loader_init "ws2_32.dll" failed to initialize, aborting
002c:err:module:loader_init Initializing dlls for L"C:\\windows\\system32\\wineboot.exe" failed, status c0000142
0024:err:environ:init_peb starting L"Z:\\wine\\build\\programs\\winecfg\\i386-windows\\winecfg.exe" in experimental wow64 mode
0024:err:module:init_wow64 could not load L"C:\\windows\\system32\\wow64.dll", status c0000135

For glibc I will have to create a chroot and report back.

bareich avatar Nov 02 '23 21:11 bareich

Then it's likely a wine on musl issue, that's something for upstream wine

AndreRH avatar Nov 02 '23 22:11 AndreRH

In Debian (glibc) chroot, downloaded MinGW binaries, vanilla WINE build I get new problems:

file ./dlls/ntdll/ntdll.so
./dlls/ntdll/ntdll.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=4458a8aa4d36906d6783c1ea465767ba230cb227, with debug_info, not stripped

/debian/wine/build/wine programs/winecfg/i386-windows/winecfg.exe
wine: could not load ntdll.so: (null)

/debian/wine/build/wine programs/winecfg/i386-windows/winecfg.exe
wine: could not load ntdll.so: (null)

rm -Rf ~/.wine ; WINEPREFIX=~/.wine WINEARCH="win32" WINEDLLPATH=./dlls/ntdll  ./wine programs/winecfg/i386-windows/winecfg.exe
wine: created the configuration directory '/root/.wine'
wineserver: failed to load l_intl.nls
wine client error:0: recvmsg: Connection reset by peer

WINEPREFIX=~/.wine WINEARCH="win32" WINEDLLPATH=./dlls/ntdll  ./wine programs/winecfg/aarch64-windows/winecfg.exe
wineserver: failed to load l_intl.nls
wine client error:0: recvmsg: Connection reset by peer

Is there anything in my (previous) findings that points to a likely cause for my issue?

Regarding configure: Why am I adding aarch64 to --enable-archs - shouldn't i386 suffice?

bareich avatar Nov 03 '23 14:11 bareich

Regarding configure: Why am I adding aarch64 to --enable-archs - shouldn't i386 suffice? For a vanilla build, aarch64 is enough, as vanilla Wine can't run i386 on aarch64 yet (that's what Hangover is for)

/debian/wine/build/wine programs/winecfg/i386-windows/winecfg.exe As I said, that won't work.

rm -Rf ~/.wine ; WINEPREFIX=~/.wine WINEARCH="win32" WINEDLLPATH=./dlls/ntdll ./wine programs/winecfg/i386-windows/winecfg.exe

You're setting the default WINEPREFIX, not needed. Your're setting WINEARCH to win32, which is wrong. It'll be a aarch64 prefix, thus win64. But you also don't need to set it. I would also recommend not to mess with WINEDLLPATH.

So still, this is very odd. did you get a "Wine build complete." after running make?

AndreRH avatar Nov 05 '23 13:11 AndreRH

Yes. I just started fresh (rm -Rf wine/build) up to Wine build complete..

The env vars was just to try variants for new errors. I usually start without any. HODLL doesn't make any difference either, which leads me to think that it doesn't get to any emulation stage in the first place.

bareich avatar Nov 05 '23 14:11 bareich

I haven't heard of others with such issues, so something in your chroot is likely wrong, but I can't tell what from here. Did you report the musl issue upstream?

AndreRH avatar Nov 05 '23 15:11 AndreRH

Upstream it's bug #55862.

To avoid confusing (myself and others :)) once again the different results (both on aarch64 musl host):

vanilla (aarch64 binary)

cd /wine/build ; rm -Rf ~/.wine ; sleep 1 ; ./wine programs/powershell/aarch64-windows/powershell.exe
wine: created the configuration directory '/home/user/.wine'
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
002c:err:module:loader_init "ws2_32.dll" failed to initialize, aborting
002c:err:module:loader_init Initializing dlls for L"C:\\windows\\system32\\wineboot.exe" failed, status c0000142
wine: could not load kernel32.dll, status c0000135

hangover (i386 binary)

cd /hangover/wine/build ; rm -Rf ~/.wine ; sleep 1 ; ./wine programs/powershell/i386-windows/powershell.exe
wine: created the configuration directory '/home/user/.wine'
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
002c:err:module:loader_init "ws2_32.dll" failed to initialize, aborting
002c:err:module:loader_init Initializing dlls for L"C:\\windows\\system32\\wineboot.exe" failed, status c0000142
0024:err:environ:init_peb starting L"Z:\\hangover\\wine\\build\\programs\\powershell\\i386-windows\\powershell.exe" in experimental wow64 mode
wine: could not load kernel32.dll, status c0000135

bareich avatar Nov 05 '23 15:11 bareich

closing Wine issue, see https://bugs.winehq.org/show_bug.cgi?id=55862#c6

AndreRH avatar Mar 01 '24 20:03 AndreRH