• Bug#1100695: wine: Wine hangs on startup on arm64

    From =?utf-8?q?Martin_Storsj=C3=B6?=@21:1/5 to All on Mon Mar 17 14:30:02 2025
    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
  • From Debian Bug Tracking System@21:1/5 to All on Wed Apr 2 06:30:02 2025
    This is a multi-part message in MIME format...

    Your message dated Wed, 02 Apr 2025 04:24:04 +0000
    with message-id <E1tzpe0-008E0C-Ej@fasolo.debian.org>
    and subject line Bug#1100695: fixed in wine 10.0~rc2~repack-3
    has caused the Debian Bug report #1100695,
    regarding wine: Wine hangs on startup on arm64
    to be marked as done.

    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.

    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)


    --
    1100695: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100695
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    Received: (at submit) by bugs.debian.org; 17 Mar 2025 13:17:24 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
    (2021-04-09) on buxtehude.debian.org
    X-Spam-Level:
    X-Spam-Status: No, score=-15.0 required=4.0 tests=BAYES_00,
    BODY_INCLUDES_PACKAGE,FOURLA,HAS_PACKAGE,MD5_SHA1_SUM,RCVD_IN_PBL,
    RDNS_NONE,SPF_NEUTRAL,XMAILER_REPORTBUG autolearn=ham
    autolearn_force=no version=3.4.6-bugs.debian.org_2005_01_02 X-Spam-Bayes: score:0.0000 Tokens: new, 104; hammy, 150; neutral, 510; spammy,
    0. spammytokens: hammytokens:0.000-+--XDebbugsCc,
    0.000-+--X-Debbugs-Cc, 0.000-+--trixie, 0.000-+--bookworm,
    0.000-+--armhf
    Return-path: <martin@martin.st>
    Received: from [152.70.51.136] (port=44278 helo=[172.17.0.2])
    by buxtehude.debian.org with esmtp (Exim 4.94.2)
    (envelope-from <martin@martin.st>)
    id 1tuALL-001uC8-7B
    for submit@bugs.