Wine 64 bit

Josh DuBois duboisj at codeweavers.com
Tue Apr 28 09:26:42 CDT 2015


I was interested in compiling 64-bit wine on OS X the other day and hit 
some problems, so I thought I would resurrect this thread.  I used gcc 
4.8 from macports, because as far as I could tell there wasn't a chance 
of using any version of clang without patching it. Using gcc I hit 
winehq bug 38380 right away:

https://bugs.winehq.org/show_bug.cgi?id=38380

With Ken's help I tried the attached patch, which allowed a few places 
where wine has assembly code calling 64-bit windows functions to 
assemble with Apple's broken assembler.

The only other problem I hit was the pagezero thing discussed below:

On 1/23/15 12:03 AM, cdavis5x at gmail.com wrote:
>>> 0003-configure-Support-64-bit-compilation-on-Mac-OS.patch
>> Regarding the -pagezero_size option: 1) it might as well be unconditional.  The 32-bit code assumes a 4096-byte page-zero, implicit in the base address of WINE_DOS.
> It’s conditional in my tree because I have another patch that turns off the __PAGEZERO segment, then sticks the WINE_DOS segment at address 0. I submitted that patch once, but Alexandre rejected it because we lack V86 support anyway on Mac OS, so what’s it matter if Win16 and Win9x programs can’t access the IVT, BDA or DOS Data Segment? :) I guess I could make it unconditional (since he’s not going to take my patch to make it 0 on 32-bit), but it’d be redundant on 32-bit, because the default size of the __PAGEZERO segment there is 4k.
Did any resolution to this problem ever appear?  If that were fixed and 
we had a workaround for the broken Apple assembler, I think you could 
compile and test 64-bit wine on OS X.  (The mac driver still won't 
compile without clang, but passing --disable-winemac.drv at least 
allowed use of the X11 driver.)

I haven't tested much so far, but I at least got a working prefix and 
ran notepad (once with relay logging, even).
-------------- next part --------------
>From fb1af7167de85284bed57c815a6112ba97999b9c Mon Sep 17 00:00:00 2001
From: Josh DuBois <duboisj at codeweavers.com>
Date: Tue, 28 Apr 2015 09:20:13 -0500
Subject: [PATCH] Avoid movs between rcx, rdx and xmm registers to allow
 compilation with Apple's assembler.

---
 dlls/ntdll/relay.c         | 8 ++++----
 dlls/oleaut32/typelib.c    | 8 ++++----
 dlls/rpcrt4/ndr_stubless.c | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c
index 57ad2e1..0ba2731 100644
--- a/dlls/ntdll/relay.c
+++ b/dlls/ntdll/relay.c
@@ -624,10 +624,10 @@ __ASM_GLOBAL_FUNC( relay_call,
                    "movq 8(%rsp),%rdx\n\t"
                    "movq 16(%rsp),%r8\n\t"
                    "movq 24(%rsp),%r9\n\t"
-                   "movq %rcx,%xmm0\n\t"
-                   "movq %rdx,%xmm1\n\t"
-                   "movq %r8,%xmm2\n\t"
-                   "movq %r9,%xmm3\n\t"
+                   "movq 0(%rsp),%xmm0\n\t"
+                   "movq 8(%rsp),%xmm1\n\t"
+                   "movq 16(%rsp),%xmm2\n\t"
+                   "movq 24(%rsp),%xmm3\n\t"
                    "callq *%rax\n\t"
                    /* trace the return value */
                    "leaq -0x30(%rbp),%rsp\n\t"
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index b8325c0..29bab33 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -6456,10 +6456,10 @@ __ASM_GLOBAL_FUNC( call_method,
                    "movq 8(%rsp),%rdx\n\t"
                    "movq 16(%rsp),%r8\n\t"
                    "movq 24(%rsp),%r9\n\t"
-                   "movq %rcx,%xmm0\n\t"
-                   "movq %rdx,%xmm1\n\t"
-                   "movq %r8,%xmm2\n\t"
-                   "movq %r9,%xmm3\n\t"
+                   "movq 0(%rsp),%xmm0\n\t"
+                   "movq 8(%rsp),%xmm1\n\t"
+                   "movq 16(%rsp),%xmm2\n\t"
+                   "movq 24(%rsp),%xmm3\n\t"
                    "callq *%rax\n\t"
                    "leaq -16(%rbp),%rsp\n\t"
                    "popq %rdi\n\t"
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c
index 030bfb3..c9d9930 100644
--- a/dlls/rpcrt4/ndr_stubless.c
+++ b/dlls/rpcrt4/ndr_stubless.c
@@ -1077,10 +1077,10 @@ __ASM_GLOBAL_FUNC( call_server_func,
                    "movq 8(%rsp),%rdx\n\t"
                    "movq 16(%rsp),%r8\n\t"
                    "movq 24(%rsp),%r9\n\t"
-                   "movq %rcx,%xmm0\n\t"
-                   "movq %rdx,%xmm1\n\t"
-                   "movq %r8,%xmm2\n\t"
-                   "movq %r9,%xmm3\n\t"
+                   "movq 0(%rsp),%xmm0\n\t"
+                   "movq 8(%rsp),%xmm1\n\t"
+                   "movq 16(%rsp),%xmm2\n\t"
+                   "movq 24(%rsp),%xmm3\n\t"
                    "callq *%rax\n\t"
                    "leaq -16(%rbp),%rsp\n\t"  /* restore stack */
                    "popq %rdi\n\t"
-- 
1.8.5.2 (Apple Git-48)



More information about the wine-devel mailing list