[ros-diffs] [fireball] 37205: - Update winebuild to Wine-20081105. All ReactOS-specific stuff kept intact.

fireball at svn.reactos.org fireball at svn.reactos.org
Fri Nov 7 11:56:34 CET 2008


Author: fireball
Date: Wed Nov  5 16:14:58 2008
New Revision: 37205

URL: http://svn.reactos.org/svn/reactos?rev=37205&view=rev
Log:
- Update winebuild to Wine-20081105. All ReactOS-specific stuff kept intact.

Modified:
    trunk/reactos/media/doc/README.WINE
    trunk/reactos/tools/winebuild/build.h
    trunk/reactos/tools/winebuild/import.c
    trunk/reactos/tools/winebuild/main.c
    trunk/reactos/tools/winebuild/relay.c
    trunk/reactos/tools/winebuild/res32.c
    trunk/reactos/tools/winebuild/spec16.c
    trunk/reactos/tools/winebuild/spec32.c

Modified: trunk/reactos/media/doc/README.WINE
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -23,7 +23,7 @@
 
 reactos/tools/unicode             # Synced to Wine-20081105 (~Wine-1.1.7)
 reactos/tools/wpp                 # Synced to Wine-20081105 (~Wine-1.1.7)
-reactos/tools/winebuild           # Synced to Wine-20071217
+reactos/tools/winebuild           # Synced to Wine-20081105 (~Wine-1.1.7)
 reactos/tools/wmc                 # Synced to Wine-20071201
 reactos/tools/wrc                 # Synced to Wine-0_9_53
 reactos/tools/widl                # Synced to Wine-0_9_59

Modified: trunk/reactos/tools/winebuild/build.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/build.h?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/build.h [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/build.h [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -117,7 +117,7 @@
 
 enum target_platform
 {
-    PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_WINDOWS
+    PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, PLATFORM_WINDOWS
 };
 
 extern enum target_cpu target_cpu;
@@ -144,14 +144,22 @@
 #define __attribute__(X)
 #endif
 
+#ifndef DECLSPEC_NORETURN
+# if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS)
+#  define DECLSPEC_NORETURN __declspec(noreturn)
+# else
+#  define DECLSPEC_NORETURN __attribute__((noreturn))
+# endif
+#endif
+
 extern void *xmalloc (size_t size);
 extern void *xrealloc (void *ptr, size_t size);
 extern char *xstrdup( const char *str );
 extern char *strupper(char *s);
 extern int strendswith(const char* str, const char* end);
-extern void fatal_error( const char *msg, ... )
-   __attribute__ ((__format__ (__printf__, 1, 2)));
-extern void fatal_perror( const char *msg, ... )
+extern DECLSPEC_NORETURN void fatal_error( const char *msg, ... )
+   __attribute__ ((__format__ (__printf__, 1, 2)));
+extern DECLSPEC_NORETURN void fatal_perror( const char *msg, ... )
    __attribute__ ((__format__ (__printf__, 1, 2)));
 extern void error( const char *msg, ... )
    __attribute__ ((__format__ (__printf__, 1, 2)));

Modified: trunk/reactos/tools/winebuild/import.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/import.c?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/import.c [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/import.c [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -698,30 +698,20 @@
         output( "\tjmp $31,($0)\n" );
         break;
     case CPU_POWERPC:
-        output( "\taddi %s, %s, -0x4\n", ppc_reg(1), ppc_reg(1) );
-        output( "\tstw  %s, 0(%s)\n",    ppc_reg(9), ppc_reg(1) );
-        output( "\taddi %s, %s, -0x4\n", ppc_reg(1), ppc_reg(1) );
-        output( "\tstw  %s, 0(%s)\n",    ppc_reg(8), ppc_reg(1) );
-        output( "\taddi %s, %s, -0x4\n", ppc_reg(1), ppc_reg(1) );
-        output( "\tstw  %s, 0(%s)\n",    ppc_reg(7), ppc_reg(1) );
+        output( "\tmr %s, %s\n", ppc_reg(0), ppc_reg(31) );
         if (target_platform == PLATFORM_APPLE)
         {
-            output( "\tlis %s, ha16(%s+%d)\n", ppc_reg(9), table, pos );
-            output( "\tla  %s, lo16(%s+%d)(%s)\n", ppc_reg(8), table, pos, ppc_reg(9) );
+            output( "\tlis %s, ha16(%s+%d+32768)\n", ppc_reg(31), table, pos );
+            output( "\tla  %s, lo16(%s+%d)(%s)\n", ppc_reg(31), table, pos, ppc_reg(31) );
         }
         else
         {
-            output( "\tlis %s, (%s+%d)@h\n", ppc_reg(9), table, pos );
-            output( "\tla  %s, (%s+%d)@l(%s)\n", ppc_reg(8), table, pos, ppc_reg(9) );
-        }
-        output( "\tlwz  %s, 0(%s)\n", ppc_reg(7), ppc_reg(8) );
-        output( "\tmtctr %s\n", ppc_reg(7) );
-        output( "\tlwz  %s, 0(%s)\n",   ppc_reg(7), ppc_reg(1) );
-        output( "\taddi %s, %s, 0x4\n", ppc_reg(1), ppc_reg(1) );
-        output( "\tlwz  %s, 0(%s)\n",   ppc_reg(8), ppc_reg(1) );
-        output( "\taddi %s, %s, 0x4\n", ppc_reg(1), ppc_reg(1) );
-        output( "\tlwz  %s, 0(%s)\n",   ppc_reg(9), ppc_reg(1) );
-        output( "\taddi %s, %s, 0x4\n", ppc_reg(1), ppc_reg(1) );
+            output( "\tlis %s, (%s+%d+32768)@h\n", ppc_reg(31), table, pos );
+            output( "\tla  %s, (%s+%d)@l(%s)\n", ppc_reg(31), table, pos, ppc_reg(31) );
+        }
+        output( "\tlwz   %s, 0(%s)\n", ppc_reg(31), ppc_reg(31) );
+        output( "\tmtctr %s\n", ppc_reg(31) );
+        output( "\tmr    %s, %s\n", ppc_reg(31), ppc_reg(0) );
         output( "\tbctr\n" );
         break;
     }

Modified: trunk/reactos/tools/winebuild/main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/main.c?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/main.c [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/main.c [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -58,6 +58,8 @@
 
 #ifdef __APPLE__
 enum target_platform target_platform = PLATFORM_APPLE;
+#elif defined(__sun)
+enum target_platform target_platform = PLATFORM_SOLARIS;
 #elif defined(_WINDOWS)
 enum target_platform target_platform = PLATFORM_WINDOWS;
 #else
@@ -118,6 +120,7 @@
 {
     { "macos",   PLATFORM_APPLE },
     { "darwin",  PLATFORM_APPLE },
+    { "solaris", PLATFORM_SOLARIS },
     { "windows", PLATFORM_WINDOWS },
     { "winnt",   PLATFORM_WINDOWS }
 };
@@ -598,10 +601,12 @@
     case MODE_DLL:
         if (spec->subsystem != IMAGE_SUBSYSTEM_NATIVE)
             spec->characteristics |= IMAGE_FILE_DLL;
+        if (!spec_file_name) fatal_error( "missing .spec file\n" );
+        /* fall through */
+    case MODE_EXE:
         load_resources( argv, spec );
         load_import_libs( argv );
-        if (!spec_file_name) fatal_error( "missing .spec file\n" );
-        if (!parse_input_file( spec )) break;
+        if (spec_file_name && !parse_input_file( spec )) break;
         switch (spec->type)
         {
             case SPEC_WIN16:
@@ -614,15 +619,6 @@
             default: assert(0);
         }
         break;
-    case MODE_EXE:
-        if (spec->type == SPEC_WIN16) fatal_error( "Cannot build 16-bit exe files\n" );
-	if (!spec->file_name) fatal_error( "executable must be named via the -F option\n" );
-        load_resources( argv, spec );
-        load_import_libs( argv );
-        if (spec_file_name && !parse_input_file( spec )) break;
-        read_undef_symbols( spec, argv );
-        BuildSpec32File( spec );
-        break;
     case MODE_DEF:
         if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
         if (spec->type == SPEC_WIN16) fatal_error( "Cannot yet build .def file for 16-bit dlls\n" );

Modified: trunk/reactos/tools/winebuild/relay.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/relay.c?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/relay.c [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/relay.c [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -26,8 +26,10 @@
 #include "wine/port.h"
 
 #include <ctype.h>
-
-#include "thread.h"
+#include <stdarg.h>
+
+#define __WINESRC__  /* FIXME: for WINE_VM86_TEB_INFO */
+#include "winternl.h"
 #include "wine/winbase16.h"
 
 #include "build.h"
@@ -383,7 +385,7 @@
  * All routines expect that the 16-bit stack contents (arguments) and the
  * return address (segptr to CallTo16_Ret) were already set up by the
  * caller; nb_args must contain the number of bytes to be conserved.  The
- * 16-bit SS:SP will be set accordinly.
+ * 16-bit SS:SP will be set accordingly.
  *
  * All other registers are either taken from the CONTEXT86 structure
  * or else set to default values.  The target routine address is either
@@ -891,9 +893,11 @@
 
     /* Check for pending events. */
 
-    output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", STRUCTOFFSET(TEB,vm86_pending) );
+    output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n",
+            STRUCTOFFSET(TEB,GdiTebBatch) + STRUCTOFFSET(WINE_VM86_TEB_INFO,vm86_pending) );
     output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") );
-    output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", STRUCTOFFSET(TEB,dpmi_vif) );
+    output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n",
+            STRUCTOFFSET(TEB,GdiTebBatch) + STRUCTOFFSET(WINE_VM86_TEB_INFO,dpmi_vif) );
     output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") );
 
     /* Process pending events. */

Modified: trunk/reactos/tools/winebuild/res32.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/res32.c?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/res32.c [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/res32.c [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -207,7 +207,7 @@
     res->data = file_pos - 2*sizeof(DWORD) + hdr_size;
     get_string( &res->type );
     get_string( &res->name );
-    if ((ULONG_PTR)file_pos & 2) get_word();  /* align to dword boundary */
+    if ((UINT_PTR)file_pos & 2) get_word();  /* align to dword boundary */
     get_dword();                        /* skip data version */
     get_word();                         /* skip mem options */
     res->lang = get_word();

Modified: trunk/reactos/tools/winebuild/spec16.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/spec16.c?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/spec16.c [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/spec16.c [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -435,6 +435,7 @@
 {
     int i, j;
 
+    if (!count) return 0;
     qsort( list, count, sizeof(*list), compare );
 
     for (i = j = 0; i < count; i++)
@@ -461,7 +462,7 @@
     output( "\t.align 4\n" );
     output( "\t%s\n", func_declaration(name) );
     output( "%s:\n", name );
-    output( "subl $4,%%esp\n" );
+    output( "\tsubl $4,%%esp\n" );
     if (UsePIC)
     {
         output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") );
@@ -485,7 +486,7 @@
     output( "\t.align 4\n" );
     output( "\t%s\n", func_declaration(name) );
     output( "%s:\n", name );
-    output( "subl $8,%%esp\n" );
+    output( "\tsubl $8,%%esp\n" );
     if (UsePIC)
     {
         output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") );
@@ -528,6 +529,7 @@
 void BuildSpec16File( DLLSPEC *spec )
 {
     ORDDEF **typelist;
+    ORDDEF *entry_point = NULL;
     int i, j, nb_funcs;
     char header_name[256];
 
@@ -535,11 +537,39 @@
 
     output_standard_file_header();
 
+    if (!spec->file_name)
+    {
+        char *p;
+        spec->file_name = xstrdup( output_file_name );
+        if ((p = strrchr( spec->file_name, '.' ))) *p = 0;
+    }
     if (!spec->dll_name)  /* set default name from file name */
     {
         char *p;
         spec->dll_name = xstrdup( spec->file_name );
         if ((p = strrchr( spec->dll_name, '.' ))) *p = 0;
+    }
+
+    /* store the main entry point as ordinal 0 */
+
+    if (!spec->ordinals)
+    {
+        spec->ordinals = xmalloc( sizeof(spec->ordinals[0]) );
+        spec->ordinals[0] = NULL;
+    }
+    if (spec->init_func && !(spec->characteristics & IMAGE_FILE_DLL))
+    {
+        entry_point = xmalloc( sizeof(*entry_point) );
+        entry_point->type = TYPE_PASCAL;
+        entry_point->ordinal = 0;
+        entry_point->lineno = 0;
+        entry_point->flags = FLAG_REGISTER;
+        entry_point->name = NULL;
+        entry_point->link_name = xstrdup( spec->init_func );
+        entry_point->export_name = NULL;
+        entry_point->u.func.arg_types[0] = 0;
+        assert( !spec->ordinals[0] );
+        spec->ordinals[0] = entry_point;
     }
 
     /* Build sorted list of all argument types, without duplicates */
@@ -594,12 +624,15 @@
              get_asm_short_keyword() );
     output( "\t.long 0\n" );                                               /* ne_crc */
     output( "\t%s 0x%04x\n", get_asm_short_keyword(),                      /* ne_flags */
-             NE_FFLAGS_SINGLEDATA | NE_FFLAGS_LIBMODULE );
+             NE_FFLAGS_SINGLEDATA |
+             ((spec->characteristics & IMAGE_FILE_DLL) ? NE_FFLAGS_LIBMODULE : 0) );
     output( "\t%s 2\n", get_asm_short_keyword() );                         /* ne_autodata */
     output( "\t%s %u\n", get_asm_short_keyword(), spec->heap_size );       /* ne_heap */
     output( "\t%s 0\n", get_asm_short_keyword() );                         /* ne_stack */
-    output( "\t.long 0\n" );                                               /* ne_csip */
-    output( "\t.long 0\n" );                                               /* ne_sssp */
+    if (!entry_point) output( "\t.long 0\n" );                             /* ne_csip */
+    else output( "\t%s .L__wine_%s_0-.L__wine_spec_code_segment,1\n",
+                 get_asm_short_keyword(), make_c_identifier(spec->dll_name) );
+    output( "\t%s 0,2\n", get_asm_short_keyword() );                       /* ne_sssp */
     output( "\t%s 2\n", get_asm_short_keyword() );                         /* ne_cseg */
     output( "\t%s 0\n", get_asm_short_keyword() );                         /* ne_cmod */
     output( "\t%s 0\n", get_asm_short_keyword() );                         /* ne_cbnrestab */

Modified: trunk/reactos/tools/winebuild/spec32.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/spec32.c?rev=37205&r1=37204&r2=37205&view=diff
==============================================================================
--- trunk/reactos/tools/winebuild/spec32.c [iso-8859-1] (original)
+++ trunk/reactos/tools/winebuild/spec32.c [iso-8859-1] Wed Nov  5 16:14:58 2008
@@ -417,13 +417,38 @@
 
     /* Reserve some space for the PE header */
 
-    output( "\t.text\n" );
-    output( "\t.align %d\n", get_alignment(page_size) );
-    output( "__wine_spec_pe_header:\n" );
-    if (target_platform == PLATFORM_APPLE)
+    switch (target_platform)
+    {
+    case PLATFORM_APPLE:
+        output( "\t.text\n" );
+        output( "\t.align %d\n", get_alignment(page_size) );
+        output( "__wine_spec_pe_header:\n" );
         output( "\t.space 65536\n" );
-    else
-        output( "\t.skip 65536\n" );
+        break;
+    case PLATFORM_SOLARIS:
+        output( "\n\t.section \".text\",\"ax\"\n" );
+        output( "__wine_spec_pe_header:\n" );
+        output( "\t.skip %u\n", 65536 + page_size );
+        break;
+    default:
+        output( "\n\t.section \".init\",\"ax\"\n" );
+        switch(target_cpu)
+        {
+        case CPU_x86:
+        case CPU_x86_64:
+        case CPU_ALPHA:
+        case CPU_SPARC:
+            output( "\tjmp 1f\n" );
+            break;
+        case CPU_POWERPC:
+            output( "\tb 1f\n" );
+            break;
+        }
+        output( "__wine_spec_pe_header:\n" );
+        output( "\t.skip %u\n", 65536 + page_size );
+        output( "1:\n" );
+        break;
+    }
 
     /* Output the NT header */
 



More information about the Ros-diffs mailing list