sparc solaris changes in wine

Juraj Hercek juraj at syncad.com
Mon Oct 6 06:17:14 CDT 2003


Hello,

We've done couple of changes in wine in order to compile with gcc-3.3.1 
using binutils-2.14 and run on solaris
---
mercy% uname -a
SunOS mercy 5.8 Generic_108528-19 sun4u sparc SUNW,Sun-Blade-1000
---
I'm not posting this patch to wine-patch yet, since there are couple of 
things I'm not sure are solved in "correct" way. Diff file made on 
2003-10-06 06:13 EST is attached. I've configured wine this way: 
"./configure --without-opengl CFLAGS="-g3 -O0""

Here go my questions regarding to this files:
* dlls/x11drv/xvidmode.c
    I've been just ifdeffing out anything I couldn't compile because of 
missing LIBXXF86VM. Maybe original author of the code knows what 
*exactly* should be ifdeffed out.

* libs/wine/port.c
    Hm, good old wine_switch_to_stack() I've been changing aproximately 
one year ago was changed a lot from that time. Anyways current change 
I've done in this file prevents crash caused by instruction "0xfed9d100 
<start_process+16>:  st %i0, [%fp +0x44]" (unused function argument arg 
resolves to %fp+0x44 address... (why? it's not used in that function, 
maybe -g3 -O0 flags?)). Substracting 96 bytes from original stack 
"emulates" ommited save instruction in wine_switch_to_stack() and 
ensures, that store instruction doesn't crash. Well, I guess original 
wine_switch_to_stack() code could work with older versions of gcc (very 
probably with gcc-3.2)...

* programs/Makefile.in
    Just removed winegdb from building - we still don't have sparc 
register map (and related) defined.

* tools/bin2res.c
    include <limits.h> ensures PATH_MAX used later is defined.

* tools/winebuild/import.c
    This is another hack needed because of gcc-3.3.1 I guess. I don't 
know if this would work also on x86 platform, but on solaris fixes 
gas's  "Error: operation combines symbols in different segments". 
Gcc-3.3.1 compiles imports and delayed_imports into the different 
sections (.data.rel.local, .data.rel), thus gas threw the error 
mentioned above.

* windows/winproc.c
    Finally, allignment problem on sparc platform - I've just ifdeffed 
out packing includes, so  structs are alligned to (default) 4 byte boundary.

I'd appreciate any comments - especially those related to gcc-3.3.1.

Regards ;-),
Juraj

-------------- next part --------------
? output.txt
? wine-solaris-20031006.diff
? dlls/comctl32/a.out
? dlls/comctl32/comctl32.spec.s
? dlls/ddraw/a.out
? dlls/ddraw/ddraw.spec.s
? tools/makedep.o.aBaiw5
? tools/winebuild.tar.gz
? tools/winebuild/ddraw.spec.s
? tools/winebuild/out.txt
? windows/winproc.ii
Index: dlls/iphlpapi/ifenum.c
===================================================================
RCS file: /home/wine/wine/dlls/iphlpapi/ifenum.c,v
retrieving revision 1.6
diff -u -r1.6 ifenum.c
--- dlls/iphlpapi/ifenum.c	5 Sep 2003 23:08:37 -0000	1.6
+++ dlls/iphlpapi/ifenum.c	6 Oct 2003 10:13:07 -0000
@@ -785,14 +785,27 @@
 
   fd = socket(PF_INET, SOCK_DGRAM, 0);
   if (fd != -1) {
+#if defined(__sparc__)
+    struct lifreq ifr;
+#else
     struct ifreq ifr;
+#endif
 
+#if defined(__sparc__)
+    strncpy(ifr.lifr_name, name, IFNAMSIZ);
+    ifr.lifr_name[IFNAMSIZ-1] = '\0';
+#else
     strncpy(ifr.ifr_name, name, IFNAMSIZ);
     ifr.ifr_name[IFNAMSIZ-1] = '\0';
+#endif
     if ((ioctl(fd, SIOCGIFMTU, &ifr)))
       ret = ERROR_INVALID_DATA;
     else {
+#if defined(__sparc__)
+      *mtu = ifr.lifr_mtu;
+#else
       *mtu = ifr.ifr_mtu;
+#endif
       ret = NO_ERROR;
     }
   }
Index: dlls/x11drv/xvidmode.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/xvidmode.c,v
retrieving revision 1.23
diff -u -r1.23 xvidmode.c
--- dlls/x11drv/xvidmode.c	30 Sep 2003 00:31:42 -0000	1.23
+++ dlls/x11drv/xvidmode.c	6 Oct 2003 10:13:07 -0000
@@ -101,7 +101,7 @@
     return 1;
 }
 
-static Bool in_desktop_mode;
+static Bool in_desktop_mode = 0;
 static const unsigned int depths[]  = {8, 16, 32};
 
 void X11DRV_XF86VM_Init(void)
@@ -454,6 +454,7 @@
 #endif
 }
 
+#ifdef HAVE_LIBXXF86VM
 /* implementation of EnumDisplaySettings for XF86VM */
 BOOL X11DRV_XF86VM_EnumDisplaySettingsExW( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DWORD flags)
 {
@@ -492,6 +493,7 @@
     TRACE("mode %ld -- not present\n", n);
     return FALSE;
 }
+#endif
 
 /* implementation of ChangeDisplaySettings for XF86VM */
 LONG X11DRV_XF86VM_ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode,
@@ -612,17 +614,20 @@
  */
 BOOL X11DRV_EnumDisplaySettingsExW( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DWORD flags)
 {
+#ifdef HAVE_LIBXXF86VM
     if (dd_modes) 
     {
         /* XVidMode */
         return X11DRV_XF86VM_EnumDisplaySettingsExW(name, n, devmode, flags);
     }
-    else if (in_desktop_mode)
+    else
+    if (in_desktop_mode)
     {
         /* desktop */
         return X11DRV_desktop_EnumDisplaySettingsExW(name, n, devmode, flags);
     }
     else
+#endif
     {
         /* no resolution changing */
         return X11DRV_nores_EnumDisplaySettingsExW(name, n, devmode, flags);
@@ -674,6 +679,7 @@
     {
         TRACE("Return to original display mode\n");
     }
+#ifdef HAVE_LIBXXF86VM
     if (dd_modes) 
     {
         /* XVidMode */
@@ -687,6 +693,7 @@
                                                         hwnd, flags, lpvoid );
     }
     else
+#endif
     {
         /* no resolution changing */
         return X11DRV_nores_ChangeDisplaySettingsExW( devname, devmode,
Index: libs/wine/port.c
===================================================================
RCS file: /home/wine/wine/libs/wine/port.c,v
retrieving revision 1.1
diff -u -r1.1 port.c
--- libs/wine/port.c	29 Aug 2003 22:23:42 -0000	1.1
+++ libs/wine/port.c	6 Oct 2003 10:13:07 -0000
@@ -69,7 +69,7 @@
 __ASM_GLOBAL_FUNC( wine_switch_to_stack,
                    "mov %o0, %l0\n\t" /* store first argument */
                    "mov %o1, %l1\n\t" /* store second argument */
-                   "mov %o2, %sp\n\t" /* store stack */
+                   "sub %o2, 96, %sp\n\t" /* store stack */
                    "call %l0, 0\n\t" /* call func */
                    "mov %l1, %o0\n\t" /* delay slot:  arg for func */
                    "ta 0x01"); /* breakpoint - we never get here */
Index: programs/Makefile.in
===================================================================
RCS file: /home/wine/wine/programs/Makefile.in,v
retrieving revision 1.39
diff -u -r1.39 Makefile.in
--- programs/Makefile.in	23 Jun 2003 19:51:21 -0000	1.39
+++ programs/Makefile.in	6 Oct 2003 10:13:07 -0000
@@ -26,7 +26,6 @@
 	wineboot \
 	winecfg \
 	wineconsole \
-	winedbg \
 	winefile \
 	winemenubuilder \
 	winemine \
@@ -53,7 +52,6 @@
 	wineboot \
 	winecfg \
 	wineconsole \
-	winedbg \
 	winefile \
 	winemenubuilder \
 	winemine \
@@ -74,7 +72,6 @@
 	wineboot \
 	winecfg \
 	wineconsole \
-	winedbg \
 	winefile \
 	winemine \
 	winepath \
@@ -85,7 +82,6 @@
 	rpcss.exe \
 	wcmd.exe \
 	wineconsole.exe \
-	winedbg.exe \
 	winemenubuilder.exe \
 	winevdm.exe \
 	winhelp.exe
Index: tools/bin2res.c
===================================================================
RCS file: /home/wine/wine/tools/bin2res.c,v
retrieving revision 1.18
diff -u -r1.18 bin2res.c
--- tools/bin2res.c	3 Oct 2003 03:34:10 -0000	1.18
+++ tools/bin2res.c	6 Oct 2003 10:13:07 -0000
@@ -24,6 +24,7 @@
 #include "wine/port.h"
 
 #include <stdio.h>
+#include <limits.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
Index: tools/winebuild/import.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/import.c,v
retrieving revision 1.52
diff -u -r1.52 import.c
--- tools/winebuild/import.c	13 Aug 2003 21:57:42 -0000	1.52
+++ tools/winebuild/import.c	6 Oct 2003 10:13:07 -0000
@@ -806,7 +806,7 @@
 
     fprintf( outfile, "#ifndef __GNUC__\nstatic void __asm__dummy_import(void) {\n#endif\n\n" );
     pos = 20 * (nb_imm + 1);  /* offset of imports.data from start of imports */
-    fprintf( outfile, "asm(\".data\\n\\t.align %d\\n\"\n", get_alignment(8) );
+    fprintf( outfile, "asm(\".section\\t\\\".data.rel.local\\\"\\n\\t.align %d\\n\"\n", get_alignment(8) );
     for (i = 0; i < nb_imports; i++)
     {
         if (dll_imports[i]->delay) continue;
@@ -1082,7 +1082,7 @@
         idx++;
     }
 
-    fprintf( outfile, "\n    \".data\\n\\t.align %d\\n\"\n", get_alignment(8) );
+    fprintf( outfile, "\n    \".section\\t\\\".data.rel\\\"\\n\\t.align %d\\n\"\n", get_alignment(8) );
     pos = nb_delayed * 32;
     for (i = 0; i < nb_imports; i++)
     {
Index: windows/winproc.c
===================================================================
RCS file: /home/wine/wine/windows/winproc.c,v
retrieving revision 1.108
diff -u -r1.108 winproc.c
--- windows/winproc.c	5 Sep 2003 23:15:39 -0000	1.108
+++ windows/winproc.c	6 Oct 2003 10:13:07 -0000
@@ -47,7 +47,9 @@
 WINE_DECLARE_DEBUG_CHANNEL(relay);
 WINE_DEFAULT_DEBUG_CHANNEL(win);
 
-#include "pshpack1.h"
+#if !defined(__sparc__)
+#  include "pshpack1.h"
+#endif
 
 /* Window procedure 16-to-32-bit thunk */
 typedef struct
@@ -78,7 +80,10 @@
     BYTE       jmp;                  /* jmp  proc (relative jump) */
     WNDPROC    proc;
 } WINPROC_JUMP;
-#include "poppack.h"
+
+#if !defined(__sparc__)
+#  include "poppack.h"
+#endif
 
 typedef union
 {


More information about the wine-devel mailing list