Package: wine
Version: 9.0~repack-7
Severity: grave
Justification: renders package unusable
X-Debbugs-Cc:
debian-arm@lists.debian.org,
martin@martin.st
User:
debian-arm@lists.debian.org
Usertags: arm64
Dear Maintainer,
When starting Wine (9.0~repack-7) on Debian Trixie, e.g. with a simple command like "wine wineboot", it hangs.
The issue is caused by the Debian packaging. Upstream Wine errors out if you don't have Clang available while building it, while the Debian packaging has edited away this configure check - see
https://salsa.debian.org/wine-team/wine/-/blob/debian13-wine09/debian/patches/arm/gcc.patch.
Editing away the check may have seemed to have worked when it was first done (in
https://salsa.debian.org/wine-team/wine/-/commit/2c3ae8a186f255958da213fe35510908d9ca50ca
for Wine 7.0), but for the current Wine versions, this no longer results in a functioning build of Wine.
Initially, compiling wine for arm64 with GCC would error out at configure time, due to `__builtin_ms_va_list` not being supported - see
https://gitlab.winehq.org/wine/wine/-/blob/wine-5.0/configure.ac?ref_type=tags#L211-216.
If this configure check was removed/bypassed, compiling would still fail for the exact same reason.
However this changed in
https://gitlab.winehq.org/wine/wine/-/commit/dac1e16dd4edc8404c59dc63ae708cd8bb50a38a
(since Wine 6.0-rc4). This made the use of `__builtin_ms_va_list` and `__builtin_ms_va_start` etc optional on the code level. This was not intended to make it possible to build Wine with a compiler that doesn't support them; the assumption was still that configure disallows such build configurations. The reason for the change was that the Wine headers are also included when building the widl tool, which is used as part of mingw-w64-tools; this allowed building the widl tool on Linux/aarch64 with GCC.
But if the configure check was bypassed, building still succeeded, but you'd get a build of Wine that uses the wrong ABI for varargs. This is the case of the Wine 7.0 and 8.0 builds in Debian bullseye-backports and bookworm. They roughly seem to work, but if executing any code with varargs (e.g. any nontrivial use of printf), it crashes.
Further along, in
https://gitlab.winehq.org/wine/wine/-/commit/11486a7b48aa43421ada5a557d892feabf27b372
(since Wine 7.4), the configure check was changed from requiring `__builtin_ms_va_list` to explicitly requiring a PE cross compiler. Bypassing this check also still mostly seemed benign at the time (Wine 8.0 in Debian bookworm also mostly seems to work, but also has incorrect handling of varargs), but at some point later, the code probably strictly started assuming that arm64 builds have the userland DLLs built as PE, not ELF. Thus since
Wine 9.0, it simply hangs on startup when the requirement for a PE cross compiler has been bypassed.
Applying a change like this produces a working build of Wine 9.0:
```
diff --git a/debian/control.in b/debian/control.in
index cbe264ca228..46ffe53d824 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -12,6 +12,9 @@ Standards-Version: 4.7.0
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
+ clang [arm64],
+ lld [arm64],
+ llvm [arm64],
gcc-mingw-w64-i686 [i386],
gcc-mingw-w64-x86-64 [amd64],
libz-mingw-w64-dev,
diff --git a/debian/patches/arm/gcc.patch b/debian/patches/arm/gcc.patch deleted file mode 100644
index 7e1fbad836b..00000000000
--- a/debian/patches/arm/gcc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-description: build with gcc instead of clang on arm64
-author: Michael Gilbert <
mgilbert@debian.org>
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -1047,7 +1047,7 @@ This is an error since --enable-archs=$w
- LDFLAGS=$saved_LDFLAGS
- done
-
--if test $HOST_ARCH = aarch64
-+if test $HOST_ARCH = ""
- then
- test "x$PE_ARCHS" != x || AC_MSG_ERROR([PE cross-compilation is required f
or ARM64, please install clang/llvm-dlltool/lld, or llvm-mingw.])
- DLLEXT=""
diff --git a/debian/patches/series b/debian/p