https://bugs.winehq.org/show_bug.cgi?id=33349
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |405e128b0b3a9661bd3db59608c | |d9a44f4ff9810 Resolution|--- |FIXED Summary|Use Thumb binaries on ARM? |Add support for 32-bit ARM | |Thumb-2 Wine build Status|NEW |RESOLVED
--- Comment #11 from Anastasius Focht focht@gmx.net --- Hello folks,
this is fixed by recent commit series.
* https://source.winehq.org/git/wine.git/commitdiff/c1a700f018ae86b31c61b0ce4e... ("winebuild: Generate Thumb2-compatible assembly code on ARM.")
* https://source.winehq.org/git/wine.git/commitdiff/7c48d8d44ba70cbfee21e66202... ("winebuild: Support non-PIC mode for ARM targets.")
* https://source.winehq.org/git/wine.git/commitdiff/54cd0e9187da7b592054dc6cbc... ("ntdll: Make inline asm compatible with Thumb-2.")
* https://source.winehq.org/git/wine.git/commitdiff/37c24eabc7ce287ac2941d18bb... ("ntdll: Support Thumb mode in signal handling.")
* https://source.winehq.org/git/wine.git/commitdiff/621c06a082a5507885f2c98815... ("rpcrt4: Make inline asm compatible with Thumb-2.")
* https://source.winehq.org/git/wine.git/commitdiff/6083c69a3b4f4432e06ed8803e... ("vcomp: Make inline asm compatible with Thumb-2.")
* https://source.winehq.org/git/wine.git/commitdiff/405e128b0b3a9661bd3db59608... ("configure: Default to Thumb-2 mode for ARM. ")
Thanks Alexandre.
I've reactivated one of my older 64-bit ARM playground boards for testing (HiKey960 with 4x Cortex A73 + 4x Cortex A53 Big.Little CPU and ARM Mali G71 MP8 GPU). I still had a Yocto based aarch64/armv7ve-hf multilib distro flashed on it to be able to run both, aarch64 and armv7(th2hf) Wine at the same time on the same system.
All Wine builtins seem to work properly so far with Thumb2 build of Wine. I've tested with 'wordpad' and the like. Additionally I ran some 32-bit ARM Thumb(2) apps I found on the Internet:
* Notepad2 for ARM32 * Miranda32 for ARM * VC++ redist
They all started up fine, showing main user interface. There were some relocation block processing errors:
--- snip --- ... 0024:err:module:LdrProcessRelocationBlock resulting immediate value won't fit: 000100d0 ... --- snip ---
but the apps still started.
---
To be able to build Wine with Poky SDK (Yocto) cross-toolchains I still had to apply two patches:
* bug 46053 ("Support cross-toolchains that need target sysroot explicitly passed via '--sysroot' command-line option (Yocto/Poky SDK)")
* bug 46079 ("Support 32-bit ARM hard-float cross-toolchains with GNU binutils assembler that doesn't implicitly assume '.fpu {vfp,neon}' (Yocto/Poky SDK)") -> that one needed an additional tweak to support -march=xx injection as well. I ran into a problem that unified assembler syntax lead to very obscure build errors because the (cross) toolchain builtin default 'armv5t' won't work with some UAL mov immediate encodings by design (mov vs. movs etc.). With a small patch to 'configure.ac' (and regenerate) to inject '-march=xx' and '-mfpu=xx' options to TARGETFLAGS I was able to fix it.
Toolchain tune (in Yocto speak): armv7vet2hf-neon-vfpv4
--- snip --- ... CC = arm-pokymllib32-linux-gnueabi-gcc -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/focht/projects/poky-sdk-install/sysroots/aarch64-poky-linux CXX = arm-pokymllib32-linux-gnueabi-g++ -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/focht/projects/poky-sdk-install/sysroots/aarch64-poky-linux CPPBIN = arm-pokymllib32-linux-gnueabi-cpp CROSSCC = CFLAGS = -g -O2 -mthumb -mfloat-abi=hard -march=armv7ve -mfpu=neon -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 CPPFLAGS = CROSSCFLAGS = CROSSLDFLAGS = EXTRACFLAGS = -Wall -pipe -fcf-protection=none -fno-stack-protector -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -gdwarf-2 -gstrict-dwarf EXTRACROSSCFLAGS= MSVCRTFLAGS = -fno-builtin -fshort-wchar TARGETFLAGS = -b arm-pokymllib32-linux-gnueabi -mthumb -mfloat-abi=hard -march=armv7ve -mfpu=neon LDDLLFLAGS = -fPIC -fasynchronous-unwind-tables LDEXECFLAGS = LIBS = -ldl ... TOOLSDIR = /home/focht/projects/wine/mainline-build-x86_64 LD = arm-pokymllib32-linux-gnueabi-ld --sysroot=/home/focht/projects/poky-sdk-install/sysroots/aarch64-poky-linux LDFLAGS = -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now DLLFLAGS = -D_REENTRANT -fPIC -fasynchronous-unwind-tables --- snip ---
--- snip --- $ uname -a Linux hikey960 4.20.0+ #1 SMP PREEMPT Wed Jan 2 19:22:38 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
$ file /home/focht/projects/wine/mainline-install-arm/bin/wine /home/focht/projects/wine/mainline-install-arm/bin/wine: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=c2b4472be6bf82afe65195ad56217f34f69f3a3d, for GNU/Linux 3.2.0, with debug_info, not stripped --- snip ---
$ wine --version wine-6.0-111-gf03db0f75e9
Regards