Alexandre Julliard : winebuild: Output the 16-bit asm relay functions as needed and get rid of --relay16 mode .

Alexandre Julliard julliard at winehq.org
Mon Jan 18 10:58:50 CST 2010


Module: wine
Branch: master
Commit: 539da1b073be3a0c74f82d6b9a0fb00c1f214c14
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=539da1b073be3a0c74f82d6b9a0fb00c1f214c14

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Jan 16 15:58:48 2010 +0100

winebuild: Output the 16-bit asm relay functions as needed and get rid of --relay16 mode.

---

 dlls/krnl386.exe16/Makefile.in   |    5 -----
 tools/winebuild/build.h          |    3 +--
 tools/winebuild/main.c           |   11 -----------
 tools/winebuild/relay.c          |   17 +++--------------
 tools/winebuild/spec16.c         |    1 +
 tools/winebuild/winebuild.man.in |    4 ----
 6 files changed, 5 insertions(+), 36 deletions(-)

diff --git a/dlls/krnl386.exe16/Makefile.in b/dlls/krnl386.exe16/Makefile.in
index be18b05..1e25735 100644
--- a/dlls/krnl386.exe16/Makefile.in
+++ b/dlls/krnl386.exe16/Makefile.in
@@ -59,11 +59,6 @@ C_SRCS = \
 
 RC_SRCS = version.rc
 
-EXTRA_OBJS = relay16asm.o
-
 @MAKE_DLL_RULES@
 
-relay16asm.o: $(WINEBUILD)
-	$(WINEBUILD) $(WINEBUILDFLAGS) -o $@ --relay16
-
 @DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 23b9bd1..5620763 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -268,9 +268,8 @@ extern void output_spec16_file( DLLSPEC *spec );
 extern void output_fake_module16( DLLSPEC *spec16 );
 extern void output_res_o_file( DLLSPEC *spec );
 extern void output_asm_relays(void);
+extern void output_asm_relays16(void);
 
-extern void BuildRelays16(void);
-extern void BuildRelays32(void);
 extern void BuildSpec32File( DLLSPEC *spec );
 
 extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 );
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 2563d53..4a11519 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -101,7 +101,6 @@ enum exec_mode_values
     MODE_EXE,
     MODE_DEF,
     MODE_IMPLIB,
-    MODE_RELAY16,
     MODE_RESOURCES
 };
 
@@ -269,7 +268,6 @@ static const char usage_str[] =
 "       --def                 Build a .def file from a .spec file\n"
 "       --exe                 Build a .c file for an executable\n"
 "       --implib              Build an import library\n"
-"       --relay16             Build the 16-bit relay assembly routines\n"
 "       --resources           Build a .o file for the resource files\n\n"
 "The mode options are mutually exclusive; you must specify one and only one.\n\n";
 
@@ -286,7 +284,6 @@ enum long_options_values
     LONG_OPT_LDCMD,
     LONG_OPT_NMCMD,
     LONG_OPT_NXCOMPAT,
-    LONG_OPT_RELAY16,
     LONG_OPT_RESOURCES,
     LONG_OPT_SAVE_TEMPS,
     LONG_OPT_SUBSYSTEM,
@@ -308,7 +305,6 @@ static const struct option long_options[] =
     { "ld-cmd",        1, 0, LONG_OPT_LDCMD },
     { "nm-cmd",        1, 0, LONG_OPT_NMCMD },
     { "nxcompat",      1, 0, LONG_OPT_NXCOMPAT },
-    { "relay16",       0, 0, LONG_OPT_RELAY16 },
     { "resources",     0, 0, LONG_OPT_RESOURCES },
     { "save-temps",    0, 0, LONG_OPT_SAVE_TEMPS },
     { "subsystem",     1, 0, LONG_OPT_SUBSYSTEM },
@@ -500,9 +496,6 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
             if (optarg[0] == 'n' || optarg[0] == 'N')
                 spec->dll_characteristics &= ~IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
             break;
-        case LONG_OPT_RELAY16:
-            set_exec_mode( MODE_RELAY16 );
-            break;
         case LONG_OPT_RESOURCES:
             set_exec_mode( MODE_RESOURCES );
             break;
@@ -660,10 +653,6 @@ int main(int argc, char **argv)
         if (!parse_input_file( spec )) break;
         output_import_lib( spec, argv );
         break;
-    case MODE_RELAY16:
-        if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
-        BuildRelays16();
-        break;
     case MODE_RESOURCES:
         load_resources( argv, spec );
         output_res_o_file( spec );
diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c
index 221fc5a..7073d74 100644
--- a/tools/winebuild/relay.c
+++ b/tools/winebuild/relay.c
@@ -903,23 +903,15 @@ static void BuildPendingEventCheck(void)
 
 
 /*******************************************************************
- *         BuildRelays16
+ *         output_asm_relays16
  *
  * Build all the 16-bit relay callbacks
  */
-void BuildRelays16(void)
+void output_asm_relays16(void)
 {
-    if (target_cpu != CPU_x86)
-    {
-        output( "/* File not used with this architecture. Do not edit! */\n\n" );
-        return;
-    }
-
     /* File header */
 
-    output( "/* File generated automatically. Do not edit! */\n\n" );
     output( "\t.text\n" );
-
     output( "%s:\n\n", asm_name("__wine_spec_thunk_text_16") );
 
     output( "%s\n", asm_globl("__wine_call16_start") );
@@ -958,14 +950,11 @@ void BuildRelays16(void)
     output( "\n\t.data\n\t.align %d\n", get_alignment(4) );
     output( "%s\n\t.long 0\n", asm_globl("CallTo16_DataSelector") );
     output( "%s\n\t.long 0\n", asm_globl("CallTo16_TebSelector") );
-    if (UsePIC) output( "wine_ldt_copy_ptr:\t.long %s\n", asm_name("wine_ldt_copy") );
 
     output( "\t.text\n" );
-    output( "%s:\n\n", asm_name("__wine_spec_thunk_text_32") );
+    output( "%s:\n", asm_name("__wine_spec_thunk_text_32") );
     build_call_from_regs_x86();
     output_function_size( "__wine_spec_thunk_text_32" );
-
-    output_gnu_stack_note();
 }
 
 
diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c
index a9e67ad..e60b4bc 100644
--- a/tools/winebuild/spec16.c
+++ b/tools/winebuild/spec16.c
@@ -773,6 +773,7 @@ void output_spec16_file( DLLSPEC *spec16 )
     output_stubs( spec16 );
     output_exports( spec32 );
     output_imports( spec16 );
+    if (is_undefined( "__wine_call_from_16" )) output_asm_relays16();
     if (spec16->main_module)
     {
         output( "\n\t%s\n", get_asm_string_section() );
diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in
index 4897290..88452d3 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -50,10 +50,6 @@ Build a .def file from a spec file. The .spec file is specified via the
 Build a PE import library from a spec file. The .spec file is
 specified via the -E option.
 .TP
-.B \--relay16
-Generate the assembly code for the 16-bit relay routines. This is for
-Wine internal usage only, you should never need to use this option.
-.TP
 .B \--resources
 Generate a .o file containing all the input resources. This is useful
 when building with a PE compiler, since the PE binutils cannot handle




More information about the wine-cvs mailing list