git: 33856e566b10 - main - emulators/wine: Avoid "NtRaiseException Unhandled exception"

From: Gerald Pfeifer <gerald_at_FreeBSD.org>
Date: Sat, 03 Aug 2024 10:07:25 UTC
The branch main has been updated by gerald:

URL: https://cgit.FreeBSD.org/ports/commit/?id=33856e566b1098a567e48acba1add66ccc3ee4e4

commit 33856e566b1098a567e48acba1add66ccc3ee4e4
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-08-03 10:06:17 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-08-03 10:06:38 +0000

    emulators/wine: Avoid "NtRaiseException Unhandled exception"
    
    This backports
      commit ba5653b298e084faea153473a2eeefe2d0acd150
      Author: Gerald Pfeifer <gerald@FreeBSD.org>
      Date:   Mon Jul 29 21:47:34 2024 +0000
    from emulators/wine-devel.
    
    Users have been reporting a number of cases of the following error:
      002c:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8b2b7
      0024:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0
    
    PR:             279927, 280000
---
 emulators/wine/Makefile                       |  2 +-
 emulators/wine/files/patch-include_wine_asm.h | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/emulators/wine/Makefile b/emulators/wine/Makefile
index af0135ab95e2..f34ff18eacac 100644
--- a/emulators/wine/Makefile
+++ b/emulators/wine/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	wine
 DISTVERSION=	9.0
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	1
 CATEGORIES=	emulators
 MASTER_SITES=	https://dl.winehq.org/wine/source/9.0/
diff --git a/emulators/wine/files/patch-include_wine_asm.h b/emulators/wine/files/patch-include_wine_asm.h
new file mode 100644
index 000000000000..3e3f76da8d7e
--- /dev/null
+++ b/emulators/wine/files/patch-include_wine_asm.h
@@ -0,0 +1,25 @@
+This patch is borrowed from emulators/wine-proton. According to several
+users confirming in PR 279927 and PR 280000 this fixes
+
+  002c:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8b2b7
+  0024:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8b2b7 
+
+for them. Of course this should better be addressed via upstream (which
+we'll try to do).
+
+
+--- UTC
+--- include/wine/asm.h.orig	2024-02-24 10:23:40.551780000 +0300
++++ include/wine/asm.h	2024-02-24 10:23:43.285931000 +0300
+@@ -242,9 +242,9 @@
+                        ".byte 0x75,0x03\n\t"      /* jne 1f */ \
+                        ".byte 0x0f,0x05\n\t"      /* syscall */ \
+                        ".byte 0xc3\n\t"           /* ret */ \
+-                       "jmp 1f\n\t" \
++                       ".byte 0xeb,0x01\n\t"      /* jmp 1f */ \
+                        ".byte 0xc3\n"             /* ret */ \
+-                       "1:\t.byte 0xff,0x14,0x25\n\t" /* 1: callq *(0x7ffe1000) */ \
++                       ".byte 0xff,0x14,0x25\n\t" /* 1: callq *(0x7ffe1000) */ \
+                        ".long 0x7ffe1000\n\t" \
+                        "ret" )
+ # else