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
eyedasan
Newbie
Newbie
Posts: 4
Joined: Thu Dec 09, 2010 4:18 am

How to recompile Wine on ARM

Post by eyedasan »

I am trying to Recomiple the Wine 1.3.8 for the Arm.
I configured as follows,

> export CC=arm_v5t_le-gcc
> ./configure --prefix=/usr/local/Wine_Arm --host=arm --with-wine-tools=$PWD --without-freetype

then,

> make
config.status: creating tools/Makefile
make[1]: Entering directory `/home/Kanna/wine-1.3.8/tools'
arm_v5t_le-gcc -c -I. -I. -I../include -I../include -D__WINESRC__ -Wall -pipe -fno-strength-reduce -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -g -O2 -o makedep.o makedep.c
arm_v5t_le-gcc -g -O2 -o makedep makedep.o
/home/Kanna/wine-1.3.8/tools/makedep -C. -S.. -T.. fnt2bdf.c fnt2fon.c make_ctests.c makedep.c relpath.c sfnt2fnt.c
/home/Kanna/wine-1.3.8/tools/makedep: /home/Kanna/wine-1.3.8/tools/makedep: cannot execute binary file

I am getting the above error, because i am using x86 for cross-compiling the wine to ARM, the makedep is compiled for ARM, so it cannot run on the x86.

Please help to compile the Wine for ARM Platform.

Regards,
Kannadasan S.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: How to recompile Wine on ARM

Post by vitamin »

eyedasan wrote:I am getting the above error, because i am using x86 for cross-compiling the wine to ARM, the makedep is compiled for ARM, so it cannot run on the x86.
If you cross-compiling you'll need to point Wine to x86 build directory. Ex:

Code: Select all

mkdir /home/Kanna/wine-linux-build
mkdir /home/Kanna/wine-arm-build

cd /home/Kanna/wine-linux-build
../wine-1.3.8/configure && make
cd /home/Kanna/wine-arm-build
../wine-1.3.8/configure --host=arm --with-wine-tools=../wine-linux-build
make
eyedasan
Newbie
Newbie
Posts: 4
Joined: Thu Dec 09, 2010 4:18 am

Hi Vitamin

Post by eyedasan »

Thanks for the information, i followed the steps as you told.
but I am getting the Following Error,

Code: Select all

v

../../wine-linux-build//tools/widl/widl -b arm  -I../../wine-1.3.8/include -I. -I../../wine-1.3.8/include -I../include    -t -T stdole2.tlb ../../wine-1.3.8/include/stdole2.idl
error: Invalid target specification 'arm'
make[1]: *** [stdole2.tlb] Error 2
make[1]: Leaving directory `/home/Kanna/wine-arm-build/include'
make: *** [include] Error 2
Please provide the Information.

Regards,
Kannadasan S.
eyedasan
Newbie
Newbie
Posts: 4
Joined: Thu Dec 09, 2010 4:18 am

Re: How to recompile Wine on ARM

Post by eyedasan »

Hi Vitamin,

After compiling the wine to ARM, can we able to run the windows exe directly or we need the Source of that particular windows application?

Regards,
Kannadasan S.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Hi Vitamin

Post by vitamin »

eyedasan wrote:

Code: Select all

../../wine-linux-build//tools/widl/widl -b arm  -I../../wine-1.3.8/include -I. -I../../wine-1.3.8/include -I../include    -t -T stdole2.tlb ../../wine-1.3.8/include/stdole2.idl
error: Invalid target specification 'arm'
File a bug.
eyedasan wrote:After compiling the wine to ARM, can we able to run the windows exe directly or we need the Source of that particular windows application?
No, Wine does not emulate CPU. You will only be able to run winelib apps.
eyedasan
Newbie
Newbie
Posts: 4
Joined: Thu Dec 09, 2010 4:18 am

How to recompile Wine on ARM

Post by eyedasan »

Hi Vitamin,

Our Target specification as follows,

ARM9 Core 300 MHz Processor
128 MB RAM
128 MB Flash

Is it possible to port the Wine on the above platform?
What is the Minimun Memory Footprint required to port wine on any platform?

Regards,
Kannadasan S.
rygle
Newbie
Newbie
Posts: 4
Joined: Fri Feb 22, 2008 8:23 pm

Post by rygle »

@Eyedasan

Sorry to disappoint you, but what Vitamin was saying is that Wine can only run on an x86 processor. It does not have the code to emulate an x86 processor on the ARM platform, or the PPC platform, or anything else. This code would need to be added, which is very serious work. That is why Wine stands for Wine Is Not an Emulator.

What Wine does is it intercepts API calls that Windows executables make and translates the Windows API call into an API call that works on Linux or Mac. But whether it's Linux or Mac, the processor must be x86. That's why Wine will not run on older Power Macs, but it will on newer x86 Macs.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

rygle wrote:Sorry to disappoint you, but what Vitamin was saying is that Wine can only run on an x86 processor.
I didn't say that, because it's isn't true. Wine can run on architectures other then x86. However in such setup Wine will not be able to run x86 Windows programs. It can still run winelib programs (programs recompiled with winegcc).

eyedasan, I'm not sure what you need Wine for. On such a hardware it will consume all 100% of resources just by itself. Regardless you still need Xorg to have functioning Wine, which leaves nothing at all for the app itself.
KenSharp
Level 4
Level 4
Posts: 110
Joined: Mon Jul 13, 2009 8:52 pm

Bug open

Post by KenSharp »

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

Post by André H. »

So let's have a look at:
> export CC=arm_v5t_le-gcc
> ./configure --prefix=/usr/local/Wine_Arm --host=arm --with-wine-tools=$PWD --without-freetype
--host=arm is the wrong way, as explained in the bug, also arm_v5t_le-gcc scares me. that shouldn't look like that IMHO.

i have a (not fully working) crosscompiling setup which looks like:
../configure --host=arm-linux-gnueabi --with-wine-tools=../164/ --without-freetype host_alias=arm-linux-gnueabi

this doesn't even need a "export CC", but FWIW it would be arm-linux-gnueabi-gcc

Further i have no good experience with crosscompiling Wine for ARM, i normally build directly on the ARM system(which is quite more fun with dual-core ARM at 1GHz).
After compiling the wine to ARM, can we able to run the windows exe directly or we need the Source of that particular windows application?
No you won't as vitamin already said, but he is also right about winelib.
You can recompile existing apps for winelib and run them on ARM, i e.g. did that with putty as you can see here: http://dawncrow.de/arm4.png
ARM9 Core 300 MHz Processor
128 MB RAM
128 MB Flash

Is it possible to port the Wine on the above platform?
Yes, it is. But I'm afraid your user experience will not be that great with 300 MHz.
What device is that?
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: How to recompile Wine on ARM

Post by André H. »

eyedasan wrote:I am trying to Recomiple the Wine 1.3.8 for the Arm.
Also you should try a more recent version of Wine, e.g. Wine 1.3.17
KenSharp
Level 4
Level 4
Posts: 110
Joined: Mon Jul 13, 2009 8:52 pm

Post by KenSharp »

Every time I try to cross-compile in Ubuntu Maverick I get a different result! Something is obviously broken and I doubt it's Wine, but it is a bloody nuisance.

Code: Select all

ccache arm-linux-gnueabi-gcc -c -I/home/test/wine-git/dlls/winex11.drv -I. -I/home/test/wine-git/include -I../../include -I/usr/include -D__WINESRC__  -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  -o x11drv_main.o /home/test/wine-git/dlls/winex11.drv/x11drv_main.c
/home/test/wine-git/dlls/winex11.drv/x11drv_main.c: In function ‘process_attach’:
/home/test/wine-git/dlls/winex11.drv/x11drv_main.c:534:33: error: ‘SONAME_LIBX11’ undeclared (first use in this function)
/home/test/wine-git/dlls/winex11.drv/x11drv_main.c:534:33: note: each undeclared identifier is reported only once for each function it appears in
make: *** [x11drv_main.o] Error 1
At the moment, I seem to be getting a consistent failure, as above.
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Post by André H. »

that most likely means that configure finds your x11 headers, but doesn't find the x11 library.
e.g. for me in config.h:
#define SONAME_LIBX11 "libX11.so.6"
KenSharp
Level 4
Level 4
Posts: 110
Joined: Mon Jul 13, 2009 8:52 pm

Post by KenSharp »

Well, until I can figure that one out I decided to just build with --without-x which completed successfully. But...

Code: Select all

$ qemu-arm ./wine --version
Unknown binary format
Error -1 while loading ./wine
Ugh! I'm sure I had a partial build that worked at least that much before, but as I have said... result definitely do vary.

Out of interest what is host_alias=arm-linux-gnueabi for?
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Post by André H. »

./wine is a script, qemu seems to expect a arm binary

from ./configure --help:
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
KenSharp
Level 4
Level 4
Posts: 110
Joined: Mon Jul 13, 2009 8:52 pm

Post by KenSharp »

Ugh! Good point!

I get the --host= but I don't know where host_alias= is used.

Code: Select all

$ qemu-arm ./wine --version
/lib/ld-linux.so.3: No such file or directory
Pffft. And there isn't, it's looking in the wrong place. How can I make it look in the correct place?

I don't understand why I'm having such a hard time with this. I wonder if this will be easier when upgraded to Natty.
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Post by André H. »

if host_alias makes no different, then it's most likely some obsolete stuff i copied from somewhere.
for qemu, try the qemu stuff from http://wiki.winehq.org/ARM in reverse
KenSharp
Level 4
Level 4
Posts: 110
Joined: Mon Jul 13, 2009 8:52 pm

Post by KenSharp »

This one looks genuine:

Code: Select all

ccache arm-linux-gnueabi-gcc -c -I/home/test/wine-git/dlls/ntdll -I. -I/home/test/wine-git/include -I../../include  -D__WINESRC__ -D_NTSYSTEM_ -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  -o signal_arm.o /home/test/wine-git/dlls/ntdll/signal_arm.c
{standard input}: Assembler messages:
{standard input}:575: Error: selected processor does not support Thumb mode `stmib r0,{r0-pc}'
{standard input}:577: Error: selected processor does not support Thumb mode `stmib r0,{r1}'
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Post by André H. »

yeah, that's a valid bug, didn't expect stmib to be unsupported on non-thumb devices
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Post by André H. »

KenSharp
Level 4
Level 4
Posts: 110
Joined: Mon Jul 13, 2009 8:52 pm

Post by KenSharp »

With patch:

Code: Select all

ccache arm-linux-gnueabi-gcc -c -I/home/test/wine-git/dlls/ntdll -I. -I/home/test/wine-git/include -I../../include  -D__WINESRC__ -D_NTSYSTEM_ -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  -o signal_arm.o /home/test/wine-git/dlls/ntdll/signal_arm.c
{standard input}: Assembler messages:
{standard input}:590: Error: r15 not allowed here -- `str PC,[r0,#0x40]'
jim11
Level 1
Level 1
Posts: 6
Joined: Tue Apr 26, 2011 1:14 am

similar error

Post by jim11 »

I apologise if this is a dumb question, but I am attempting to do the same thing (i.e. compiling wine for ARM except this is an ARMv7) I have followed the configuration commands (./configure --host=arm-linux-gnueabi --with-wine-tools=../wine-tools [<- compiled these from a separate tree] --without-freetype) and now I am using the make command. I keep getting this error:

In file included from ../../../include/windef.h:252,
from ../../../include/wine/library.h:27,
from ../../../libs/wine/config.c:36:
../../../include/winnt.h:1526: error: redefinition of ‘struct _CONTEXT’
../../../include/winnt.h:1566: error: conflicting types for ‘CONTEXT’
../../../include/winnt.h:1006: note: previous declaration of ‘CONTEXT’ was here
make[1]: *** [config.o] Error 1
make[1]: Leaving directory `/home/****/wine-git/wineOnArm/libs/wine'
make: *** [libs/wine] Error 2

-----------------------------------------------------------------------------------
At first I thought it was a left over config from another branch I made, but after I ran a make distclean on my previous branches. The error persists. I think I read in Vitamin's Blog entry about having to erase some CONTEXTs is this what he's talking about? Other important info, I am using CodeSourcery 2009-q27 cross-compilers. The objective is to get wine running on a gumstix. (Even if all I can do is recompile programs from source with the winelibs) Sorry to hijack the blog, but this seemed like the most appropriate place. Also would anyone have a working wine tarball that I could just deploy, or is the only way to compile from source. I have done a lot of google hunting, but came up with null...so I figured I would ask the source. Anyways thanks in advance for any help and your time!
jim11
Level 1
Level 1
Posts: 6
Joined: Tue Apr 26, 2011 1:14 am

Post by jim11 »

Nevermind I solved it with the nuke it from orbit and try again approach. Unfortunately the forum isn't letting me delete the other post, so sorry for the useless post.
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: similar error

Post by André H. »

jim11 wrote:I think I read in Vitamin's Blog entry
Do you have a link?
jim11 wrote:about having to erase some CONTEXTs is this what he's talking about?
The fact that the compiler warns about a duplicated CONTEXT struct tell's me that there are most likely both defines: __x86_64__ and __arm__
jim11
Level 1
Level 1
Posts: 6
Joined: Tue Apr 26, 2011 1:14 am

Post by jim11 »

You're correct about the defines, when I checked this morning the __x86_64__ had already been defined, so it came into conflict when I tried to compile the other wine under ARM. Hence why I restarted with a fresh chain and was able to get further this morning. As far as a link to the Blog entry I haven't been able to relocate, I may have been getting confused with some other ARM research I have been doing in addition to this. But now I have a completely new make error, I'm getting a winebuild:

arm-linux-gnueabi-as failed with status 1
winegcc: /home/***/wine-git/wine-tools/tools/winebuild/winebuild failed make[1]: *** [acledit.dll.so] Error2

I think it has something to do with the wine compiler (hence the error message :-), so when I find sometime today I think I am going to try to manual cross compile the acledit.dll with the CodeSourcery tools. That is unless you have an easier method? Of course I really don't know how much of this I need, because I am just trying to compile and run a single command line windows application. Thanks for any help in advance!
Locked