Bug 278427

Summary: emulators/wine: dysfunctional non-32-bit prefix
Product: Ports & Packages Reporter: Stefan Schlosser <bsdcode>
Component: Individual Port(s)Assignee: Gerald Pfeifer <gerald>
Status: Closed FIXED    
Severity: Affects Some People CC: Alexander88207, agh, alt2600, grahamperrin, iwtcex, stephan
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://forums.freebsd.org/threads/wine-9-0-1-not-working.93148

Description Stefan Schlosser 2024-04-18 10:29:20 UTC
There are reports in the forum that wine doesn't work anymore for non-32-bit prefixes.


$ freebsd-version
14.0-RELEASE-p6

$ pkg info wine | fgrep Version
Version        : 9.0,1

$ wineboot
0024:fixme:ntdll:create_logical_proc_info stub
0024:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
002c:fixme:ntdll:create_logical_proc_info stub
002c:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
wine: failed to open L"C:\\windows\\system32\\wineboot.exe": c0000135
0024:err:environ:run_wineboot failed to start wineboot c0000135
wine: could not load kernel32.dll, status c0000135


A pure 32-bit prefix (WINEARCH=win32 wineboot) works as intended.
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2024-04-28 08:44:20 UTC
It appears to work for some, and not for others?

For the time being - unless someone has an idea - we have emulators/wine8
available for the latter. Sorry I'm not able to provide more than this.
Comment 2 Stefan Schlosser 2024-04-29 15:06:48 UTC
According to the forum thread we have at least three affected users (me included) and one user for whom it still works on 15-CURRENT. Unfortunately we don't have more datapoints.

Now I also see bug #278525, comment #17. Is WoW64 just broken for now in version 9?

Yes emulators/wine8 is available and works. Thanks!
Comment 3 alt2600 2024-05-06 03:48:36 UTC
(In reply to Stefan Schlosser from comment #2)

its good it works with wine8 for you, I've had nothing working since wine7 was deleted. only some marginal good luck with a stab at highly experimental new WoW64 mode documented in PR 277230, I'm hoping that mode starts getting some gas, think it will become required for Releng 15 when i386 may be going away. Think the issues I saw may be because they were still converting the directx code and such so it was hit or miss what worked for games. still try from time to time, but got tired or poudriere needing to build two compilers all the time as my attempts were after gcc and clang had dependency bumps it seems.
Comment 4 Gerald Pfeifer freebsd_committer freebsd_triage 2024-05-09 07:06:28 UTC
Stefan (and of course Alexander and Graham) after the changes in PR 278525
and using the updated files/patch-dlls_ntdll_unix_loader.c patch Alex S.
kindly provided there, do look things better for you?
Comment 5 Alexander Vereeken freebsd_triage 2024-05-09 14:40:21 UTC
(In reply to Gerald Pfeifer from comment #4)

Hello,

it seems to work but under some circumstances it fails to load opengl32 from i386.


From Steam:

0120:err:module:open_builtin_so_file failed to load .so lib "/home/test/.i386-wine-pkg/usr/local/lib/wine/i386-unix/opengl32.dll.so"
0120:err:module:import_dll Loading library OPENGL32.dll (which is needed by L"Z:\\home\\test\\Downloads\\Steam\\steamui.dll") failed (error c000007a).
0120:err:module:open_builtin_so_file failed to load .so lib "/home/test/.i386-wine-pkg/usr/local/lib/wine/i386-unix/opengl32.dll.so"


From Blizzard:

0464:err:module:open_builtin_so_file failed to load .so lib "/home/test/.i386-wine-pkg/usr/local/lib/wine/i386-unix/opengl32.dll.so"
0464:err:module:import_dll Loading library opengl32.dll (which is needed by L"C:\\windows\\system32\\wined3d.dll") failed (error c000007a).
0464:err:module:import_dll Library wined3d.dll (which is needed by L"C:\\windows\\system32\\dxgi.dll") not found
0464:err:module:import_dll Library dxgi.dll (which is needed by L"C:\\windows\\system32\\d3d11.dll") not found
0464:err:module:open_builtin_so_file failed to load .so lib "/home/test/.i386-wine-pkg/usr/local/lib/wine/i386-unix/opengl32.dll.so"
0464:err:module:import_dll Loading library opengl32.dll (which is needed by L"C:\\windows\\system32\\wined3d.dll") failed (error c000007a).
0464:err:module:import_dll Library wined3d.dll (which is needed by L"C:\\windows\\system32\\d3d11.dll") not found
0464:err:module:import_dll Library d3d11.dll (which is needed by L"C:\\Program Files (x86)\\Battle.net\\Battle.net.14792\\Qt5Gui.dll") not found
Comment 6 Alexander Vereeken freebsd_triage 2024-05-09 15:17:06 UTC
(In reply to Alexander Vereeken from comment #5)

For instance standalone 32-Bit games do work.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-05-10 07:57:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3bde6b5aeee56da01d237854c5be9854c7a27995

commit 3bde6b5aeee56da01d237854c5be9854c7a27995
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-05-10 07:54:52 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-05-10 07:55:45 +0000

    emulators/wine: Unbreak WoW64 again

    Restore files/patch-dlls_ntdll_unix_loader.c which we "lost" with the
    update to Wine 9.0 by means of an updated version based on a version
    for emulators/wine-devel by Alex S <iwtcex@gmail.com> in PR 278525.

    PR:             278427

 emulators/wine/Makefile                            |  2 +-
 .../files/patch-dlls_ntdll_unix_loader.c (new)     | 25 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
Comment 8 Alex S 2024-05-12 16:18:43 UTC
(In reply to Alexander Vereeken from comment #5)

> opengl32.dll.so

Those .dll.so files are _not_ supposed to reappear. Apparently the PE build was broken somewhere around 8.14. This is exceptionally bad.
Comment 9 Alexander Vereeken freebsd_triage 2024-05-13 09:22:03 UTC
(In reply to Alex S from comment #8)

Hi, thank you for your message.

I will create a report upstream and try to find the commit.
Comment 10 Alex S 2024-05-13 17:54:00 UTC
Upstream will probably tell us to adjust the build configuration to use --enable-archs (like in bug 250607). I'm just annoyed there is no dedicated switch for the configuration script (or is it --enable-archs now?). Misconfigured builds should fail early instead of wasting everyone's time by silently toggling off important bits.
Comment 11 Alex S 2024-05-13 17:55:40 UTC
(In reply to Alex S from comment #10)

> bug 250607

should be bug 278940
Comment 12 Alexander Vereeken freebsd_triage 2024-05-13 21:43:17 UTC
Not done yet, but found out that it was not build able at all with 8.12,8.13

Starting at: https://github.com/wine-mirror/wine/commit/abe79e3b52db97cd955574de4c10b22435b2c22f
Comment 13 Alexander Vereeken freebsd_triage 2024-05-13 21:53:14 UTC
And continues to build in general but without PE at:

https://github.com/wine-mirror/wine/commit/cda2886fd3018c9e8c12791238db481b528f6a65
Comment 14 Alexander Vereeken freebsd_triage 2024-05-13 22:29:13 UTC
(In reply to Alexander Vereeken from comment #12)

Reverting this commit returns to building PE modules.

I will send in an patch for that.
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-05-16 08:31:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3f7e010b24f898f6f4128cc81ee9cb90b1a78277

commit 3f7e010b24f898f6f4128cc81ee9cb90b1a78277
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-05-16 08:29:14 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-05-16 08:30:07 +0000

    emulators/wine-devel: Unbreak WoW64 again

    Restore files/patch-dlls_ntdll_unix_loader.c which we "lost" with
    the update to Wine 9.0 by means of an adjusted version.

    PR:             278427
    Obtained from:  Alex S <iwtcex@gmail.com> in PR 278525

 emulators/wine-devel/Makefile                      |  1 +
 .../files/patch-dlls_ntdll_unix_loader.c (new)     | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)