winebuild on sparc, RFC

Austin English austinenglish at gmail.com
Sat Aug 28 11:55:05 CDT 2010


Howdy,

Out of curiosity, I've been testing compiling Wine on Sparc. I've sent
a few patches to fix a few problems that have crept up over the years.
There are two big bugs left though:
http://bugs.winehq.org/show_bug.cgi?id=24050
and
http://bugs.winehq.org/show_bug.cgi?id=24142

The first blocks running wine, the second blocks building it. For the
second, however, I found an old patch:
http://www.mail-archive.com/[email protected]/msg23307.html

and rediffed it to current wine. With it, wine mostly compiles (mshtml
gets a 'Bus error' when compiling, but no gcc warning/error). I'm not
sure if the patch is correct, and I've contacted Eric to ask him to
submit the patch, but didn't receive a reply. If it's correct, I'll
send it in, with his name on it.

So, those of you who know winebuild (or better yet, Sparc), would you
please check the attached patch.

Thanks!
-Austin
-------------- next part --------------
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index a221a9d..a561af9 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -810,7 +810,10 @@ static void output_immediate_import_thunks(void)
     if (!nb_imm) return;
 
     output( "\n/* immediate import thunks */\n\n" );
-    output( "\t.text\n" );
+    if (target_cpu == CPU_SPARC)
+        output( "\t.data\n" );
+    else
+        output( "\t.text\n" );
     output( "\t.align %d\n", get_alignment(8) );
     output( "%s:\n", asm_name(import_thunks));
 
@@ -935,7 +938,10 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
     if (!nb_delayed) return;
 
     output( "\n/* delayed import thunks */\n\n" );
-    output( "\t.text\n" );
+    if (target_cpu == CPU_SPARC)
+        output( "\t.data\n" );
+    else
+        output( "\t.text\n" );
     output( "\t.align %d\n", get_alignment(8) );
     output( "%s:\n", asm_name(delayed_import_loaders));
     output( "\t%s\n", func_declaration("__wine_delay_load_asm") );
@@ -1153,7 +1159,10 @@ static void output_external_link_imports( DLLSPEC *spec )
     for (i = 0; i < ext_link_imports.count; i++)
         output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(ext_link_imports.names[i]) );
 
-    output( "\n\t.text\n" );
+    if (target_cpu == CPU_SPARC)
+        output( "\t.data\n" );
+    else
+        output( "\t.text\n" );
     output( "\t.align %d\n", get_alignment(get_ptr_size()) );
     output( "%s:\n", asm_name("__wine_spec_external_link_thunks") );
 
@@ -1283,6 +1292,16 @@ void output_imports( DLLSPEC *spec )
     output_delayed_imports( spec );
     output_immediate_import_thunks();
     output_delayed_import_thunks( spec );
+
+    if (target_cpu == CPU_SPARC)
+        {
+            /* DJANKOV Q&D */
+            output( "\n\t.data\n" );
+            output( "\t.align %d\n", get_alignment(4) );
+            output( "%s:\n", asm_name("_end") );
+            output( "\t.long 0\n" );
+        }
+
     output_external_link_imports( spec );
     if (nb_imports || ext_link_imports.count || has_stubs(spec) || has_relays(spec))
         output_get_pc_thunk();
-- 
1.4.4.4


More information about the wine-devel mailing list