https://bugs.winehq.org/show_bug.cgi?id=46106
Bug ID: 46106 Summary: Stable: ARM64 build broken with gcc Product: Wine Version: 3.0.3 Hardware: x86 OS: Linux Status: NEW Severity: major Priority: P2 Component: build-env Assignee: wine-bugs@winehq.org Reporter: mstefani@winehq.org Distribution: ---
From Jens Reyer, the Debian Wine maintainer:
"wine-3.0.2-27-g295359a174 causes a build failure on Debian unstable arm64, because now you need clang >= 5.0 to build Wine for arm64 (so far we don't build with clang at all there)."
commit 295359a17447d6ad487b6c652c3a98bbe17cee6e Author: Martin Storsjo martin@martin.st Date: Wed May 9 23:34:57 2018 +0300
arm64: Use __builtin_ms_va_list and __attribute__((ms_abi)) on arm64.
Windows uses a different ABI for va_list on arm64 just like on x86_64.
On x86_64, the calling convention for windows functions is completely different from the one on other platforms. On arm64, they're mostly the same, with the only exception being variadic functions (where all float arguments are passed in integer registers, since the va_list is a single pointer).
Any functions using __builtin_ms_va_start need to be decorated with __attribute__((ms_abi)).
Signed-off-by: Martin Storsjo martin@martin.st Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 8fb8cc03c3edb599dd98f369e14a08f899cbff95) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=46106
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |295359a17447d6ad487b6c652c3 | |a98bbe17cee6e Target Milestone|--- |3.0.x Distribution|--- |Debian CC| |jre.winesim@gmail.com Keywords| |regression Assignee|wine-bugs@winehq.org |mstefani@winehq.org
--- Comment #1 from Michael Stefaniuc mstefani@winehq.org --- After talking to Martin Storsjö and André Hentschel I'll revert that commit in wine-3.0.4: - It breaks compilation with older or non-clang compilers - Not enough to for full windows ABI compatibility on ARM64
https://bugs.winehq.org/show_bug.cgi?id=46106
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
https://bugs.winehq.org/show_bug.cgi?id=46106
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello folks,
--- quote --- After talking to Martin Storsjö and André Hentschel I'll revert that commit in wine-3.0.4: - It breaks compilation with older or non-clang compilers - Not enough to for full windows ABI compatibility on ARM64 --- quote ---
I doubt that such an ARM64 Wine package will be useful at all. What ARM64 Windows console/desktop apps do you intend to run on this setup? The few native (non UWP) apps that exist *g* usually link against the Universal CRT and are very likely susceptible for this problem.
Example: VLC build for ARM64 Windows (yay!)
https://www.videolan.org/vlc/download-windows.html
http://people.videolan.org/~jb/Builds/ARM/vlc-4.0.0-dev-20180508-aarch64.zip
With aarch64-linux-gnu-gcc-8.2.0 cross-toolchain (no Clang):
--- snip --- $ WINEDEBUG=+seh,+relay,+loaddll,+msvcrt,+process wine64 ./vlc.exe
log_clang.txt 2>&1
... 0031:Call user32.SetWindowTextW(00010086,01d9bae8 L"VLC media player") ret=016cbbe8 ... 0031:Call ucrtbase.strlen(019864d0 "8 5 3 1") ret=01107988 0031:Ret ucrtbase.strlen() retval=00000007 ret=01107988 0031:Call ucrtbase.realloc(01d9c780,00000020) ret=01107bac 0031:Call ntdll.RtlReAllocateHeap(00480000,00000000,01d9c780,00000020) ret=7f95dbf748 0031:Ret ntdll.RtlReAllocateHeap() retval=01d9c780 ret=7f95dbf748 0031:Ret ucrtbase.realloc() retval=01d9c780 ret=01107bac 0031:Call ucrtbase.memcpy(01d9c798,019864d0,00000008) ret=011079ec 0031:Ret ucrtbase.memcpy() retval=01d9c798 ret=011079ec 0031:Call ucrtbase.__stdio_common_vsscanf(00000000,01d9c798,ffffffffffffffff,019a2a99 "%d %d %d %d",00000000,01d4f370) ret=013dd2d0 0031:trace:msvcrt:MSVCRT_vsnscanf_l "8 5 3 1" ("%d %d %d %d") 0031:Call KERNEL32.GetLastError() ret=7f95e02920 0031:Ret KERNEL32.GetLastError() retval=00000000 ret=7f95e02920 0031:trace:seh:raise_exception info[0]=0000000000000001 0031:trace:seh:raise_exception info[1]=01d4f43000000000 0031:trace:seh:call_vectored_handlers calling handler at 0x33c1c8 code=c0000005 flags=0 0031:trace:seh:call_vectored_handlers handler at 0x33c1c8 returned 0 0031:trace:seh:call_stack_handlers calling handler at 0x7bcd5b0c code=c0000005 flags=0 0031:Call ucrtbase.signal(0000000b,00000000) ret=14000262c 0031:trace:seh:MSVCRT_signal (11, (nil)) 0031:Ret ucrtbase.signal() retval=00000000 ret=14000262c wine: Unhandled page fault on write access to 0x1d4f43000000000 at address 0x7f95de7b44 (thread 0031), starting debugger... 0031:trace:seh:start_debugger Starting debugger "winedbg --auto 42 212" ... Unhandled exception: page fault on write access to 0x1d4f43000000000 in 64-bit code (0x0000007f95de7b44). Register dump: ARM64 EL0t Mode Pc:0000007f95de7b44 Sp:0000000001d4f070 Lr:0000007f95de78b8 Cpsr:20000000(--C-) x0: 01d4f43000000000 x1: 0000000001d4f40c x2: 0000000000000010 x3: 0000000000000008 x4: 0000000000000001 x5: 0000000001d6e5b8 x6: 0000000001d6f0e0 x7: 00000000fffffffe x8: 0000000000000040 x9: 000000007bcb3aac x10:0000000001d4ebe0 x11:0000000000000010 x12:0000000001d4ebd6 x13:0000007f95e02920 x14:ffffffffffffffbf x15:0000000000000000 ip0:0000007f95e4e240 ip1:0000007f964dfe90 x18:000000007ffc0000 x19:0000000001d4f240 x20:0000000001d4f410 x21:0000000000000000 x22:0000000001d4f408 x23:0000000001d4f40c x24:0000000001d6e466 x25:0000000001983ee8 x26:0000000000000000 x27:0000000000000000 x28:000000000022f0c0 Fp:0000000001d4f070 Stack dump: 0x0000000001d4f070: 0000000001d4f220 0000007f95dfd4c0 0x0000000001d4f080: 0000000001d4f370 0000000001d4f410 0x0000000001d4f090: 0000000000000000 0000000001d4f408 0x0000000001d4f0a0: 0000000001d4f40c 0000000001d4f404 0x0000000001d4f0b0: 0000000000000000 00000000019a2a9a 0x0000000001d4f0c0: ffffffffffffffff 0000000001d9c79a 0x0000000001d4f0d0: 000000007bce8c68 000000007bce8e58 0x0000000001d4f0e0: 000000007bd1c0c0 0000000396665828 0x0000000001d4f0f0: 0000000001d4f1d0 000000007bd1c0c0 0x0000000001d4f100: 0000000001d6e1a8 0000000f96815348 0x0000000001d4f110: 0000000001d4f230 000000007bc9b8d4 0x0000000001d4f120: 0000000001d4f230 0000000001d4f230 Backtrace: =>0 0x0000007f95de7b44 MSVCRT_vsnscanf_l+0xaa0(ap={__stack=0x1d4f418, __gr_top=0x1d4f408, __vr_top=0x1d4f410, __gr_offs=0x1d4f414, __vr_offs=0}) [/home/focht/projects/wine/mainline-src/dlls/ucrtbase/../msvcrt/scanf.h:312] in ucrtbase (0x0000000001d4f070) 1 0x0000007f95de78b8 MSVCRT_vsnscanf_l+0x813(ap={__stack=0x1d4f40c, __gr_top=0x1d4f408, __vr_top=0x1d4f410, __gr_offs=0x1d4f414, __vr_offs=0}) [/home/focht/projects/wine/mainline-src/dlls/ucrtbase/../msvcrt/scanf.h:298] in ucrtbase (0x0000000001d4f220) 2 0x0000007f95dfd4c0 MSVCRT__stdio_common_vsscanf+0xff(valist={__stack=0x0(nil), __gr_top=0x1d9c798, __vr_top=0xffffffffffffffff, __gr_offs=0x19a2a99, __vr_offs=0}) [/home/focht/projects/wine/mainline-src/dlls/ucrtbase/../msvcrt/scanf.c:682] in ucrtbase (0x0000000001d4f2a0) 3 0x000000007bc9ba00 call_entry_point+0x8f() in ntdll (0x0000000001d4f4b0) 4 0x0000000001983ee8 in libqt_plugin (+0xc83ee7) (0x0000000001d4f4b0) 0x0000007f95de7b44 MSVCRT_vsnscanf_l+0xaa0 [/home/focht/projects/wine/mainline-src/dlls/ucrtbase/../msvcrt/scanf.h:312] in ucrtbase: be_arm64_disasm_one_insn: not done
312 else _SET_NUMBER_(int); Modules: Module Address Debug info Name (104 modules) PE 230000- 47b000 Deferred libvlccore PE 6a0000- 6b2000 Deferred libfile_logger_plugin PE 6c0000- 6d1000 Deferred libconsole_logger_plugin PE 6e0000- 6ec000 Deferred libmemory_keystore_plugin PE 6f0000- 702000 Deferred libmmdevice_plugin PE b90000- ba5000 Deferred libhotkeys_plugin PE bb0000- bbd000 Deferred libwin_hotkeys_plugin PE d00000- 1c48000 Export libqt_plugin ELF 7b400000- 7b815000 Deferred kernel32<elf> -PE 7b420000- 7b815000 \ kernel32 ELF 7bc00000- 7bd30000 Dwarf ntdll<elf> -PE 7bc20000- 7bd30000 \ ntdll ELF 7c000000- 7c004000 Deferred <wine-loader> PE 140000000- 140024000 Deferred vlc PE 180000000- 180026000 Deferred libvlc ... ELF 7f9503d000- 7f952bb000 Deferred user32<elf> -PE 7f95060000- 7f952bb000 \ user32 ELF 7f952bb000- 7f9534e000 Deferred shlwapi<elf> -PE 7f952d0000- 7f9534e000 \ shlwapi ELF 7f9534e000- 7f95d3f000 Deferred shell32<elf> -PE 7f95370000- 7f95d3f000 \ shell32 ELF 7f95d3f000- 7f95e64000 Dwarf ucrtbase<elf> -PE 7f95d70000- 7f95e64000 \ ucrtbase ... ELF 7f96819000- 7f9684b000 Deferred ld-linux-aarch64.so.1 ELF 7f9684c000- 7f9684d000 Deferred [vdso].so Threads: process tid prio (all id:s are in hex) ... 0000002a (D) Z:\home\focht\projects\woa-winrt\vlc-4.0.0-dev\vlc.exe 00000032 0 00000031 0 <== 00000030 0 0000002f 0 0000002e 0 0000002d 0 0000002c 0 0000002b 0 System information: Wine build: wine-3.20-7-ga0a7090301 Platform: arm64 Version: Windows 10 Host system: Linux Host version: 4.18.14-yocto-standard --- snip ---
With aarch64-linux-gnu-gcc-7.3.0 + clang 6.0.1:
--- snip --- ... 0031:Call ucrtbase.strlen(019864d0 "8 5 3 1") ret=01107988 0031:Ret ucrtbase.strlen() retval=00000007 ret=01107988 0031:Call ucrtbase.realloc(01d9c780,00000020) ret=01107bac 0031:Call ntdll.RtlReAllocateHeap(00480000,00000000,01d9c780,00000020) ret=7f9519f72c 0031:Ret ntdll.RtlReAllocateHeap() retval=01d9c780 ret=7f9519f72c 0031:Ret ucrtbase.realloc() retval=01d9c780 ret=01107bac 0031:Call ucrtbase.memcpy(01d9c798,019864d0,00000008) ret=011079ec 0031:Ret ucrtbase.memcpy() retval=01d9c798 ret=011079ec 0031:Call ucrtbase.__stdio_common_vsscanf(00000000,01d9c798,ffffffffffffffff,019a2a99 "%d %d %d %d",00000000,01d4f300) ret=013dd2d0 0031:trace:msvcrt:MSVCRT_vsnscanf_l "8 5 3 1" ("%d %d %d %d") 0031:Call KERNEL32.GetLastError() ret=7f951f0870 0031:Ret KERNEL32.GetLastError() retval=00000000 ret=7f951f0870 0031:trace:msvcrt:MSVCRT_vsnscanf_l returning 4 0031:Ret ucrtbase.__stdio_common_vsscanf() retval=00000004 ret=013dd2d0 0031:Call ucrtbase.free(01d9c780) ret=013daac0 ... --- snip ---
BTW ... if you know more ARM64 apps for download/testing, bring it on. It's really hard to find anything.
Regards
[1] https://source.winehq.org/git/wine.git/commit/8fb8cc03c3edb599dd98f369e14a08...
https://bugs.winehq.org/show_bug.cgi?id=46106
--- Comment #3 from Michael Stefaniuc mstefani@winehq.org --- We doubt that there are real users for the ARM64 Wine port; in Debian or in general. So it doesn't really matter in practice. As it regressed the build for Debian it is just easier to revert.
https://bugs.winehq.org/show_bug.cgi?id=46106
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |578ea23ca37c86bfaa66899a26c | |b10182c276be8
--- Comment #4 from Michael Stefaniuc mstefani@winehq.org --- Fixed in 3.0.4.
https://bugs.winehq.org/show_bug.cgi?id=46106
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.0.x |---
https://bugs.winehq.org/show_bug.cgi?id=46106
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Michael Stefaniuc mstefani@winehq.org --- Closing