How to statically compile Wine?

Questions about Wine on Linux
Post Reply
freedomBird
Level 2
Level 2
Posts: 21
Joined: Wed Sep 20, 2017 9:18 pm
Location: China

How to statically compile Wine?

Post by freedomBird » Sun Nov 04, 2018 9:21 pm

Hello, everyone.
I want to compile the source of Wine statically, but when I use the command
./configure --static
, I get the error message
configure: error: unrecognized option: `--static'
How can I go to statically compile Wine? I don't have idea for that. Please help me! Thanks.

User avatar
DarkShadow44
Level 7
Level 7
Posts: 881
Joined: Tue Nov 22, 2016 5:39 pm

Re: How to statically compile Wine?

Post by DarkShadow44 » Mon Nov 05, 2018 11:10 am

What exactly are you trying to achieve by "compiling Wine static"?

freedomBird
Level 2
Level 2
Posts: 21
Joined: Wed Sep 20, 2017 9:18 pm
Location: China

Re: How to statically compile Wine?

Post by freedomBird » Mon Nov 05, 2018 8:51 pm

DarkShadow44 wrote:What exactly are you trying to achieve by "compiling Wine static"?
I want to run Wine executable in the Linux on non X86 CPUs such as MIPS by the QEMU. Since the currently compiled Wine is related to the original X86 platform dependent library, it is intended to statically compile the Wine source. It is therefore intended to generate a Wine program that runs directly on a non-X86 platform. This is my idea. What do you think?

@DarkShadow44, thanks.

User avatar
DarkShadow44
Level 7
Level 7
Posts: 881
Joined: Tue Nov 22, 2016 5:39 pm

Re: How to statically compile Wine?

Post by DarkShadow44 » Tue Nov 06, 2018 6:01 am

I very much doubt it would work like this. You would need to emulate a whole kernel too, you need some sort of distro in which your wine can run, don't you? You can't just throw wine into an emulator without kernel.

Or you go the Project Hangover route. But just know, either way, it's very hard.

freedomBird
Level 2
Level 2
Posts: 21
Joined: Wed Sep 20, 2017 9:18 pm
Location: China

Re: How to statically compile Wine?

Post by freedomBird » Tue Nov 06, 2018 8:31 pm

DarkShadow44 wrote:I very much doubt it would work like this. You would need to emulate a whole kernel too, you need some sort of distro in which your wine can run, don't you? You can't just throw wine into an emulator without kernel.

Or you go the Project Hangover route. But just know, either way, it's very hard.
Yes, the QEMU can use user space mode to run X86 executable file on non X86 CPUs. You can see the section 5.3 and get the message from the QEMU web document.
I had seen the project of Project Hangover from the GitHub. But the project is running a few simple Win64 applications on arm64 Linux and Android, that is not my need. Meanwhile, I don't have no ability to modify the source code of Wine and Qemu, like the Project Hangover do.

Now, I have two choices from the email message of the QEMU developers:
(1)If the Wine executable file was made by static compilation, the normal Qemu can run it directly and it can run successfully.
(2)If the Wine executable file was made by dynamic compilation, I must set up a Qemu based chroot on my host Linux distro and use chroot to get the related DLLS, data files and other things it requires.

So, I ask the function to compile Wine statically on the forum. I try the second function on my PC withe the MIPS architecture. The process is hard. This is what I have gained so far.

@DarkShadow44, thanks again.

User avatar
Bob Wya
Level 12
Level 12
Posts: 2747
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: How to statically compile Wine?

Post by Bob Wya » Wed Nov 07, 2018 7:08 am

@freedomBird

It is almost impossible to build Wine statically. Since Windows programs rely on dynamically loading separate libraries.
This is discussed every few years on the ML and these forums...
E.g. a quick Google search brings up: wine static (forum thread title ftw!)

Your only real hope is Project Hangover (as has been stated already).
But Andre and Stefand have explicitly stated that they are limiting the problem space to Arm64.

Both of these developers are very experienced systems programmers.
Just doing this for Arm64, requires a tonne of work e.g. patching qemu to improve performance and compatibility.
It's a miracle (/ hard work) that they have any working Arm64 demos at all! 8)

Bob

freedomBird
Level 2
Level 2
Posts: 21
Joined: Wed Sep 20, 2017 9:18 pm
Location: China

Re: How to statically compile Wine?

Post by freedomBird » Wed Nov 07, 2018 9:09 pm

@Bob Wya

Thanks for your reply.
Now, I know that I can't build Wine statically. If I want to use Wine executable file on non X86 CPUs by Qemu, I must find the other way.

Post Reply