Public bug reported:

The Wine package in Ubuntu 24.04 on arm64 is entirely broken
(9.0~repack-4build3); wine hangs on startup.

The arm64 Wine package in Ubuntu 22.04 (6.0.3~repack-1) did work
correctly though, so this is a regression.

The crashes are caused by the Debian/Ubuntu packaging. Upstream Wine
errors out if you don't have Clang available while building it, while
the Debian/Ubuntu 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 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 version of Wine.

Thus, in order to restore functionality, the packaging can be tweaked
like this:

```
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 <mgilb...@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/patches/series
index 2680f9f650b..d2e3f1f30f0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -32,7 +32,6 @@ fixes/virtual-protect.patch
 fixes/printer-resolution.patch
 fixes/temporary-directory.patch
 
-arm/gcc.patch
 arm/binary-name.patch
 arm/shift-overflow.patch
 arm/format-strings.patch
diff --git a/debian/rules b/debian/rules
index 1ee433c6065..69c37d2d972 100755
--- a/debian/rules
+++ b/debian/rules
@@ -69,10 +69,11 @@ ifeq ($(DEB_HOST_ARCH), armhf)
 CONFLAGS+=--with-float-abi=hard --with-unwind=no
 endif
 
-# the x18 register is reserved in windows on arm64, avoid clobbering it
-# (see https://bugs.winehq.org/show_bug.cgi?id=38780)
 ifeq ($(DEB_HOST_ARCH), arm64)
-export DEB_CFLAGS_MAINT_APPEND+=-ffixed-x18
+# -fstack-clash-protection is not supported by Clang on arm64, and
+# if removed from DEB_BUILD_MAINT_OPTIONS, -fno-stack-clash-protection
+# is passed instead.
+export DEB_CFLAGS_MAINT_APPEND+=-Wno-unused-command-line-argument -Wno-error
 endif
 
 # ignore arm-specific unused functions
```

Unfortunately, the build isn't entirely warning free, so in my testing
above, I've just added a -Wno- option to disable a warning, and -Wno-
error to avoid treating all warnings as errors. (I understand that this
isn't kosher for proper upstream.)


This issue hasn't had much visibility before, but as Github Actions these days 
have arm64 linux runners, being able to install a working Wine there would be 
be quite valuable for people wanting to test run arm64 Windows binaries. (The 
Ubuntu 22.04 version is somewhat usable, but a more modern version of Wine 
would be very valuable.)


Secondly, in Ubuntu 22.04, the arm64 and armhf versions of Wine (wine64
and wine32) could be coinstalled for a properly working wow64 setup of
Wine (where the installation can handle both arm and aarch64 windows
binaries). This doesn't quite work as such in upstream Wine 9.0 (I
wasn't aware that it actually did work before), as packaged in Ubuntu
24.04.

This can be fixed with one commit from
https://gitlab.winehq.org/mstorsjo/wine/-/commits/wow64-arm-9.0 on Wine
9.0 (the topmost configure one is not necessary for Debian/Ubuntu
packaging, where the install structure is different than in a plain
install). This issue was fixed later upstream in
https://gitlab.winehq.org/wine/wine/-/merge_requests/7204;
cherrypickable fixes for Wine 10.0 are available at
https://gitlab.winehq.org/mstorsjo/wine/-/commits/wow64-arm-10.0 too.

** Affects: wine (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2102681

Title:
  Wine in Ubuntu 24.04/arm64 entirely broken

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/wine/+bug/2102681/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to