https://bugs.winehq.org/show_bug.cgi?id=53157
Bug ID: 53157 Summary: --without-mingw builds on Mac can't unwind exceptions Product: Wine Version: 7.10 Hardware: x86-64 OS: Mac OS X Status: NEW Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: stefan@codeweavers.com
I am trying to get a non-mingw build on MacOS to run my games to get debug symbols for Wine DLLs in Instruments for performance profiling. One of the issues I ran into is that SEH exceptions thrown in the PE side of our code can't be handled. Wine runs into further nested exceptions trying to unwind the stack and crashes.
This is a regression introduced by the following commit:
264bd4fc84020f217807f1e59d3bfa9302e5110c is the first bad commit commit 264bd4fc84020f217807f1e59d3bfa9302e5110c Author: Martin Storsjo martin@martin.st Date: Fri May 29 13:51:04 2020 +0300
wine/asm.h: Don't define __ASM_CFI when using clang as cross compiler.
Reverting this commit on top of Wine 7.10 fixes this particular problem.
Getting a Wine build like this is a bit tricky. clang does not support -mabi=ms, and gcc can't build winemac.drv because of Apple-isms in the system headers that Apple never upstreamed to FSF gcc. (But they did have it in their own gcc before they switched to clang).
To get a non-mingw gcc'ish Wine I do roughly the following:
1) Use wine-7.10, not master, there is yet another regression since then 2) Install gcc-11 with homebrew 3) ~/wine/configure --enable-win64 --without-x --without-mingw --disable-tests CC=gcc-11 4) Build the thing 5) Edit Makefile, replace CC = gcc-11 with CC = clang 6) cd into dlls/winemac.drv, run make 7) optionally do the same in dlls/winecoreaudio.drv 8) optionally undo the Makefile changes if you plan to recompile e.g. ntdll
The game in question is Rocket League; That adds extra troubles with Steam (32 bit, so needs Mojave). I think the problem is independent of Rocket League though. The exception causing the crash is OutputDebugStringA. I don't think the problem is specific to this game though.
https://bugs.winehq.org/show_bug.cgi?id=53157
Stefan Dösinger stefan@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Regression SHA1| |264bd4fc84020f217807f1e59d3 | |bfa9302e5110c CC| |martin@martin.st
https://bugs.winehq.org/show_bug.cgi?id=53157
--- Comment #1 from Stefan Dösinger stefan@codeweavers.com --- Oh, I forgot to add, the exception handling problem happens in a 64 bit process. A 32 bit process doesn't need those CFI statements for SEH exceptions because of the SEH links in %fs:0.
https://bugs.winehq.org/show_bug.cgi?id=53157
--- Comment #2 from Stefan Dösinger stefan@codeweavers.com --- Merge request submitted: https://gitlab.winehq.org/wine/wine/-/merge_requests/249
https://bugs.winehq.org/show_bug.cgi?id=53157
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #3 from Matteo Bruni matteo.mystral@gmail.com --- This was merged:
commit 9618f5ab8f74dfbff32b868baae78d4167466834 Author: Stefan Dösinger stefan@codeweavers.com Date: Wed Jun 15 13:16:26 2022 +0300
include: Emit CFI directives when building on Mac with gcc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53157 Signed-off-by: Stefan Dösinger stefan@codeweavers.com
Notes (gitlab): Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/249
Assuming fixed.
https://bugs.winehq.org/show_bug.cgi?id=53157
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.13.