How to recompile Wine on ARM

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Tue Apr 26, 2011 12:53 pm

i'm still interested in a link to a text telling you to delete a context...

for your new problem i wonder if your target supports thumb. Missing thumb support can lead to problems with some toolchains.

You should also specify the target to configure.
like that:
./configure --host=arm-linux-gnueabi --with-wine-tools=../wine-tools --without-freetype CFLAGS=" -mcpu=arm7tdmi" LDFLAGS=" -mcpu=arm7tdmi"

jim11
Level 1
Level 1
Posts: 6
Joined: Tue Apr 26, 2011 1:14 am

Post by jim11 » Tue Apr 26, 2011 4:39 pm

Alright I dug through my internet history and found the link: http://www.winehq.org/wwn/285#Cross-Com ... 20Wine|WWN. In it Steve Edwards gives a basic example of how to recompile wine for the arm, but what he says is "Note there is no support for arm in Wineserver, kernel32 or ntdll so winelib won't run yet. Most everything else should compile as Winelib works on i386, PPC and SPARC. You might be able to get by, by stubbing the set_thread_context stuff out for simple apps." Which I misinterpreted as "delete the context," so that ones my bad. Some how when I got the error last night that was what came to my head. Also thanks for your response earlier, I will definitely give that a try!

KenSharp
Level 4
Level 4
Posts: 103
Joined: Mon Jul 13, 2009 8:52 pm
Location: England
Contact:

Post by KenSharp » Tue Apr 26, 2011 7:28 pm

André H. wrote:./configure --host=arm-linux-gnueabi --with-wine-tools=../wine-tools --without-freetype CFLAGS=" -mcpu=arm7tdmi" LDFLAGS=" -mcpu=arm7tdmi"
Adding -mcpu=arm7tdmi to CFLAGS and LDFLAGS creates a nice new (worrying) error:

Code: Select all

ccache arm-linux-gnueabi-gcc -c -I/home/test/wine-git/dlls/user32 -I. -I/home/test/wine-git/include -I../../include  -D__WINESRC__ -D_USER32_ -D_WINABLE_ -D_REENTRANT -fPIC -Wall -pipe -fno-strength-reduce -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -Wlogical-op  -g -O0 -mcpu=arm7tdmi  -o message.o /home/test/wine-git/dlls/user32/message.c
/home/test/wine-git/dlls/user32/message.c: In function ‘handle_internal_message’:
/home/test/wine-git/dlls/user32/message.c:1886:1: error: unrecognizable insn:
(insn 10 9 11 3 /home/test/wine-git/dlls/user32/message.c:1844 (set (reg:SI 166)
        (plus:SI (reg:SI 165)
            (const_int 2147483648 [0x80000000]))) -1 (nil))
/home/test/wine-git/dlls/user32/message.c:1886:1: internal compiler error: in extract_insn, at recog.c:2103
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.
Compiler broken? :?
$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.5.1-7ubuntu1) 4.5.1

jim11
Level 1
Level 1
Posts: 6
Joined: Tue Apr 26, 2011 1:14 am

Post by jim11 » Wed Apr 27, 2011 10:58 am

KenSharp, take this for what it is worth but I'm using the Sourcery G++ Lite 2008q3-72 found here http://www.codesourcery.com/sgpp/lite/a ... iption3057 and have had success with it in the past for projects on the arm. That being said even if you install and use this cross compiler you're going to run into the problems I'm having with the acledit dll. The only upside is that the problems I'm running into on my x86 box that I use for cross compiling, I also run when I try to compile natively on the arm device.

The full error is:

make[1]: Entering directory `/home/****/ARM_Wine/wineForArm/dlls/acledit'
/home/****/wine-git/wine-tools/tools/winegcc/winegcc -b arm-linux-gnueabi -B/home/****/wine-git/wine-tools/tools/winebuild --sysroot=../.. -fasynchronous-unwind-tables -shared ../../../dlls/acledit/acledit.spec main.o -o acledit.dll.so ../../libs/port/libwine_port.a -mcpu=arm7tdmi
winebuild: arm-linux-gnueabi-as failed with status 1
winegcc: /home/****/wine-git/wine-tools/tools/winebuild/winebuild failed
make[1]: *** [acledit.dll.so] Error 2
make[1]: Leaving directory `/home/****/ARM_Wine/wineForArm/dlls/acledit'
make: *** [dlls/acledit] Error 2

-------------------------------------------------------------------------------------

Andre as to your suggestion about whether the device supports "thumb," I assumed you were talking about gthumb which I downloaded to the native device and then tried to recompile wine which ended up being a no go. (But we may be talking about two different things, so if you would please clarify exactly what you're referring to as "thumb") One of my colleagues suggested that the error might actually be between my gcc and winegcc, because one maybe compiling in a different format that the assembler cannot understand, but I haven't tested this yet. Again thanks for your help!

KenSharp
Level 4
Level 4
Posts: 103
Joined: Mon Jul 13, 2009 8:52 pm
Location: England
Contact:

Post by KenSharp » Wed Apr 27, 2011 11:09 am

I have no problem with acledit.

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Wed Apr 27, 2011 12:02 pm

Hi,
jim11 wrote:Alright I dug through my internet history and found the link: http://www.winehq.org/wwn/285#Cross-Com ... 20Wine|WWN.
Cool, thx for the link!
That's from 2005, i started the ARM Port 2009, so that's basically too old.
jim11 wrote: André as to your suggestion about whether the device supports "thumb," I assumed you were talking about gthumb which I downloaded to the native device and then tried to recompile wine which ended up being a no go. (But we may be talking about two different things, so if you would please clarify exactly what you're referring to as "thumb") One of my colleagues suggested that the error might actually be between my gcc and winegcc, because one maybe compiling in a different format that the assembler cannot understand, but I haven't tested this yet. Again thanks for your help!
see http://en.wikipedia.org/wiki/ARM_Thumb#Thumb
But that's not the Problem, i think i found the real Bug in winegcc and winebuild, i'll send a patch and let you know.
KenSharp wrote:

Code: Select all

Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.
Compiler broken? :?
$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.5.1-7ubuntu1) 4.5.1
Most likely, please do what the output says.

jim11
Level 1
Level 1
Posts: 6
Joined: Tue Apr 26, 2011 1:14 am

Post by jim11 » Wed Apr 27, 2011 1:13 pm

Cool thanks Andre and the thumb thing makes a lot more sense now! I was genuinely wondering how gthumb had anything to do with arm. :-) I'm still pretty new at this.

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Wed Apr 27, 2011 1:24 pm

:wink:

i sent a patchset, you already can try it out if you want:

http://www.winehq.org/pipermail/wine-pa ... 01306.html
http://www.winehq.org/pipermail/wine-pa ... 01307.html

see http://wiki.winehq.org/FAQ#head-ce0f398 ... b020e234bb just in case you wonder how to apply them

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Thu Apr 28, 2011 3:35 pm

patches got in

KenSharp
Level 4
Level 4
Posts: 103
Joined: Mon Jul 13, 2009 8:52 pm
Location: England
Contact:

Post by KenSharp » Sat Apr 30, 2011 4:07 pm

In latest git:

Code: Select all

ccache arm-linux-gnueabi-gcc -c -I/home/test/wine-git/dlls/msvcrt -I. -I/home/test/wine-git/include -I../../include  -D__WINESRC__ -D_MT -D_REENTRANT -fPIC -Wall -pipe -fno-strength-reduce -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -Wlogical-op  -g -O0 -mcpu=arm7tdmi  -o wcs.o /home/test/wine-git/dlls/msvcrt/wcs.c
In file included from /home/test/wine-git/dlls/msvcrt/wcs.c:38:0:
/home/test/wine-git/dlls/msvcrt/printf.h: In function ‘create_positional_ctx_a’:
/home/test/wine-git/dlls/msvcrt/printf.h:610:13: error: incompatible type for argument 9 of ‘pf_printf_a’
/home/test/wine-git/dlls/msvcrt/printf.h:338:5: note: expected ‘va_list’ but argument is of type ‘void *’
In file included from /home/test/wine-git/dlls/msvcrt/wcs.c:40:0:
/home/test/wine-git/dlls/msvcrt/printf.h: In function ‘create_positional_ctx_w’:
/home/test/wine-git/dlls/msvcrt/printf.h:610:13: error: incompatible type for argument 9 of ‘pf_printf_w’
/home/test/wine-git/dlls/msvcrt/printf.h:338:5: note: expected ‘va_list’ but argument is of type ‘void *’
/home/test/wine-git/dlls/msvcrt/wcs.c: In function ‘MSVCRT_vsprintf_p_l’:
/home/test/wine-git/dlls/msvcrt/wcs.c:886:17: error: incompatible type for argument 9 of ‘pf_printf_a’
/home/test/wine-git/dlls/msvcrt/printf.h:338:5: note: expected ‘va_list’ but argument is of type ‘void *’
/home/test/wine-git/dlls/msvcrt/wcs.c: In function ‘MSVCRT_vswprintf_p_l’:
/home/test/wine-git/dlls/msvcrt/wcs.c:940:17: error: incompatible type for argument 9 of ‘pf_printf_w’
/home/test/wine-git/dlls/msvcrt/printf.h:338:5: note: expected ‘va_list’ but argument is of type ‘void *’

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Mon May 02, 2011 1:49 pm

KenSharp wrote:In latest git
That's most likely a compiler bug

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Wed May 11, 2011 2:23 pm

André H. wrote:
KenSharp wrote:In latest git
That's most likely a compiler bug
I was wrong, it was faulty code and is fixed in todays git.

Fiusso
Newbie
Newbie
Posts: 2
Joined: Sat Jul 02, 2011 3:45 pm

Post by Fiusso » Sat Jul 02, 2011 3:55 pm

Hey, André, I had a look at arm_talk.odp from file archive of Wineconf 2010 and saw that you wanted a good name for your work on Wine for ARM. Is "ARMagnac" a fit one for it?

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Sat Jul 02, 2011 4:03 pm

Wow that name is great, i'll see how i can use it.

at wineconf we searched a name for the ability to run CE Applications in Wine and easily choosed WineCE :) We never searched for an alternative name to Wine on ARM, but ARMagnac is quite perfect. I just doubt it's easy to pronounce ;)

Fiusso
Newbie
Newbie
Posts: 2
Joined: Sat Jul 02, 2011 3:45 pm

Post by Fiusso » Sun Jul 03, 2011 2:24 am

One more thing I want to say. There is a component of qemu, which name is TCG, and it is able, for example, to translate x86 assembly instructions into ARM ones at runtime. Currently, TCG is far from being ready to use it in Wine, lacking performance optimizations.
Also, you may chance upon the TCG Interpreter (TCI) - this is not what Wine needs. As far as I got, it is just a mechanism implemented on the top of the original TCG to run bytecode in VM's and is much slower.
Useful links:
http://tomoyo.sourceforge.jp/cgi-bin/lx ... kvm-0.12.3
http://lists.gnu.org/archive/html/qemu- ... 01337.html
http://vm-kernel.org/blog/2009/07/08/qe ... emulation/
http://wiki.qemu.org/Documentation/TCG/frontend-ops

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Sun Jul 03, 2011 5:45 am

I once had a similiar idea and asked Pierre d'Herbemont, who tried to integrate qemu in darwine(Wine for PowerPC) and he spotted me to something like http://qemu-omap3.googlecode.com/svn/tr ... /qruncom.c but meanwhile it seems to me qemu has dropped libqemu and now that you told me about TCG i guess i know why.

now we talked about all three points of porting Wine to ARM as of http://wiki.winehq.org/ARM

- winelib
- WineCE
- having a chance of making some translation to run x86 Win Apps

As of now winelib works very good, but i always only get asked for the other two "goals" :)

Logesh
Newbie
Newbie
Posts: 1
Joined: Tue Mar 31, 2015 12:30 am

Re: How to recompile Wine on ARM

Post by Logesh » Tue Mar 31, 2015 12:41 am

Cross-compile Wine for ARM

While i give Make i get the following Error,Can any body tell the solution to overcome this,



path.c: In function ‘PATH_Arc’:
/usr/include/bits/mathinline.h:741:1: error: impossible constraint in ‘asm’
/usr/include/bits/mathinline.h:759:1: error: impossible constraint in ‘asm’
make[1]: *** [path.o] Error 1
make[1]: Leaving directory `/home/yash4/Vinayak/ARM_Build_WINE/ARM_Build/wine-arm-build/dlls/gdi32'
make: *** [dlls/gdi32] Error 2



Thanks
Logesh

User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Re: How to recompile Wine on ARM

Post by André H. » Mon Apr 06, 2015 1:22 pm

Logesh wrote:Cross-compile Wine for ARM

While i give Make i get the following Error,Can any body tell the solution to overcome this,
You only give us limited information, how should we help you?
On which platform are you building? What about configure?
it seems like you are using the native gcc for crosscompiling on x86(_64), but that's just a guess

PS: That path made me smile: :lol:
ARM_Build_WINE/ARM_Build/wine-arm-build/

Locked