how to cross-compile

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
yaocong
Level 2
Level 2
Posts: 19
Joined: Fri Mar 04, 2011 10:20 pm

how to cross-compile

Post by yaocong »

I want to compile wine to another architecture,such as ARM,MIPS,PPC.
But How to do this ?
Thank you in advance.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: how to cross-compile

Post by vitamin »

yaocong wrote:I want to compile wine to another architecture,such as ARM,MIPS,PPC. But How to do this ?
It's not recommended to do so: http://wiki.winehq.org/ARM
Also what exactly are you trying to archive with it? Wine does not emulate CPU, this means that on not x86 platform you won't be able to run native windows applications.
Bruni
Level 2
Level 2
Posts: 13
Joined: Fri Aug 05, 2011 3:26 pm

Post by Bruni »

Vitaliy, perhaps you prematurely discourage him from playing around with cross compiling. Why not to give him a chance? No matter if he starts asking "vain" questions, in the below topic this helped to detect a few issues in winegcc implementation. Wine can gain some benefit.
yaocong
Wine is reported by some users to be compiled for ARM target on a x86 host.
See this topic:
http://forum.winehq.org/viewtopic.php?t=10535

In particular, the posts by KenSharp and André H.
Putty rinning in qemu: http://dawncrow.de/arm4.png

It'd be better to carry on the discussion in that topic and close this one.
jjmckenzie
Moderator
Moderator
Posts: 1153
Joined: Wed Apr 27, 2011 11:01 pm

how to cross-compile

Post by jjmckenzie »

On 8/30/11 10:51 AM, Bruni wrote:
Vitaliy, perhaps you prematurely discourage him from playing around with cross compiling.
Not necessarily. Some folks are looking for a solution to run their
'favorite' Wine programs on non-X86 platforms that are compiled to run
on an x86 platform. Wine cannot 'make this happen' and never, ever
will. You need some sort of (platform CPU) <-> x86 processor emulator.
This is outside of the scope of the Wine project, but for an example
take a look at the Darwine project (if it is still available on
Sourceforge) for an example on how to try.
Why not to give him a chance? No matter if he starts asking "vain" questions, in the below topic this helped to detect a few issues in winegcc implementation. Wine can gain some benefit.
yaocong
Wine is reported by some users to be compiled for ARM target on a x86 host.
See this topic:
http://forum.winehq.org/viewtopic.php?t=10535
Work is ongoing to make Wine compile on ARM, this is true.
In particular, the posts by KenSharp and André H.
Putty rinning in qemu: http://dawncrow.de/arm4.png
Qemu is an emulator, if I recall correctly.
It'd be better to carry on the discussion in that topic and close this one.
Yes.

James
yaocong
Level 2
Level 2
Posts: 19
Joined: Fri Mar 04, 2011 10:20 pm

Post by yaocong »

I want to run x86 binaries in QEMU and redirect the win32api to the wine as a BACKEND on ARM/MIPS platform.

The major modification for the Wine is located at :
1,WINEGCC
2,WINEBUILD
3,NTDLL

Currently I am using a mips64 machine to do the compiling ,so compile job is smooth,but the modification must be done before the compiling process can successfully finished.

Any good suggestion will be appreciated! And I will contribute the the total project to wine.Thank you.
yaocong
Level 2
Level 2
Posts: 19
Joined: Fri Mar 04, 2011 10:20 pm

Post by yaocong »

By the way,the Wine runs natively on the ARM/MIPS ,not in the Qemu sandbox.
Bruni
Level 2
Level 2
Posts: 13
Joined: Fri Aug 05, 2011 3:26 pm

Post by Bruni »

You probably did not note the trace on that screenshot (http://dawncrow.de/arm4.png) and that running putty had resulted from cross compiling by means of winelib. André launched putty binary in qemu emulating an arm machine so that it was convenient for him to take a screenshot, if I got his explanations right.

Code: Select all

dawncrow@qemu-test:~$ uname -m
armv5tejl
dawncrow@qemu-test:~$
Please make it clear:
1. Just what OS architecture do you want to run in qemu?
2. Just what architecture do you want to run wine compiled for?
3. what does run what? Is it an ARM version of OS, which runs an ARM version of wine which, in turn, runs ARM version of qemu which, in turn, runs x86 binaries, or anything else?
yaocong
Level 2
Level 2
Posts: 19
Joined: Fri Mar 04, 2011 10:20 pm

Post by yaocong »

Sorry I have not make the sense clear!

I want to run wine on MIPS architecture in Linux,not by Qemu. and the Qemu is also running on MIPS and just emulates the x86 instructions to MIPS. This is the basic scenario:the two kits are running independently on MIPS.

What I want to do is to run x86 instructions in qemu and the winapi calls will be directed to wine .So the program flow is like this:

win32 applications(X86) -> qemu (translate)-> wine (win32 api)
Bruni
Level 2
Level 2
Posts: 13
Joined: Fri Aug 05, 2011 3:26 pm

Post by Bruni »

Darwine is almost just what you need, excepting the fact that it is meant to run on PPC instead of MIPS and very far from being complete.

The most easy way of running x86 binaries on mips is qemu, any other ways will require many months of hard work.
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Post by DanKegel »

yaocong wrote: win32 applications(X86) -> qemu (translate)-> wine (win32 api)
That's going to be tricky to get working.

I've seen this kind of thing done before, so you're not crazy, but
it is a lot of work.

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

Post by André H. »

Bruni wrote:Darwine is almost just what you need, excepting the fact that it is meant to run on PPC instead of MIPS and very far from being complete.

The most easy way of running x86 binaries on mips is qemu, any other ways will require many months of hard work.
Darwine only tried to do that but on PPC the endianess was the problem.
i'd like to see that feature for my ARM port...

Dan, as i understand him he only got it working (maybe), but where did you already seen that?
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

Transitive technology has such technology. Years ago they worked together with Transgaming to run games on non-x86 architectures (they may have used this on PowerPC and consoles). I don't know how well it worked. Later on Transitive also provided this technology to Apple for running PowerPC OSX apps on x86 I believe.
Bruni
Level 2
Level 2
Posts: 13
Joined: Fri Aug 05, 2011 3:26 pm

Post by Bruni »

The sad truth is that releasing transitive technology under the FOSS license conditions is hardly probable in the foreseeable future. I'm inclined to think that Wine developers will have translating wrappers for ARM for all ~700 x86 instructions before that technology becomes free/open software :D
Locked