Commit 539da1b0 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 10e4a55b
...@@ -59,11 +59,6 @@ C_SRCS = \ ...@@ -59,11 +59,6 @@ C_SRCS = \
RC_SRCS = version.rc RC_SRCS = version.rc
EXTRA_OBJS = relay16asm.o
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@
relay16asm.o: $(WINEBUILD)
$(WINEBUILD) $(WINEBUILDFLAGS) -o $@ --relay16
@DEPENDENCIES@ # everything below this line is overwritten by make depend @DEPENDENCIES@ # everything below this line is overwritten by make depend
...@@ -268,9 +268,8 @@ extern void output_spec16_file( DLLSPEC *spec ); ...@@ -268,9 +268,8 @@ extern void output_spec16_file( DLLSPEC *spec );
extern void output_fake_module16( DLLSPEC *spec16 ); extern void output_fake_module16( DLLSPEC *spec16 );
extern void output_res_o_file( DLLSPEC *spec ); extern void output_res_o_file( DLLSPEC *spec );
extern void output_asm_relays(void); 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 BuildSpec32File( DLLSPEC *spec );
extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ); extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 );
......
...@@ -101,7 +101,6 @@ enum exec_mode_values ...@@ -101,7 +101,6 @@ enum exec_mode_values
MODE_EXE, MODE_EXE,
MODE_DEF, MODE_DEF,
MODE_IMPLIB, MODE_IMPLIB,
MODE_RELAY16,
MODE_RESOURCES MODE_RESOURCES
}; };
...@@ -269,7 +268,6 @@ static const char usage_str[] = ...@@ -269,7 +268,6 @@ static const char usage_str[] =
" --def Build a .def file from a .spec file\n" " --def Build a .def file from a .spec file\n"
" --exe Build a .c file for an executable\n" " --exe Build a .c file for an executable\n"
" --implib Build an import library\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" " --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"; "The mode options are mutually exclusive; you must specify one and only one.\n\n";
...@@ -286,7 +284,6 @@ enum long_options_values ...@@ -286,7 +284,6 @@ enum long_options_values
LONG_OPT_LDCMD, LONG_OPT_LDCMD,
LONG_OPT_NMCMD, LONG_OPT_NMCMD,
LONG_OPT_NXCOMPAT, LONG_OPT_NXCOMPAT,
LONG_OPT_RELAY16,
LONG_OPT_RESOURCES, LONG_OPT_RESOURCES,
LONG_OPT_SAVE_TEMPS, LONG_OPT_SAVE_TEMPS,
LONG_OPT_SUBSYSTEM, LONG_OPT_SUBSYSTEM,
...@@ -308,7 +305,6 @@ static const struct option long_options[] = ...@@ -308,7 +305,6 @@ static const struct option long_options[] =
{ "ld-cmd", 1, 0, LONG_OPT_LDCMD }, { "ld-cmd", 1, 0, LONG_OPT_LDCMD },
{ "nm-cmd", 1, 0, LONG_OPT_NMCMD }, { "nm-cmd", 1, 0, LONG_OPT_NMCMD },
{ "nxcompat", 1, 0, LONG_OPT_NXCOMPAT }, { "nxcompat", 1, 0, LONG_OPT_NXCOMPAT },
{ "relay16", 0, 0, LONG_OPT_RELAY16 },
{ "resources", 0, 0, LONG_OPT_RESOURCES }, { "resources", 0, 0, LONG_OPT_RESOURCES },
{ "save-temps", 0, 0, LONG_OPT_SAVE_TEMPS }, { "save-temps", 0, 0, LONG_OPT_SAVE_TEMPS },
{ "subsystem", 1, 0, LONG_OPT_SUBSYSTEM }, { "subsystem", 1, 0, LONG_OPT_SUBSYSTEM },
...@@ -500,9 +496,6 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) ...@@ -500,9 +496,6 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
if (optarg[0] == 'n' || optarg[0] == 'N') if (optarg[0] == 'n' || optarg[0] == 'N')
spec->dll_characteristics &= ~IMAGE_DLLCHARACTERISTICS_NX_COMPAT; spec->dll_characteristics &= ~IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
break; break;
case LONG_OPT_RELAY16:
set_exec_mode( MODE_RELAY16 );
break;
case LONG_OPT_RESOURCES: case LONG_OPT_RESOURCES:
set_exec_mode( MODE_RESOURCES ); set_exec_mode( MODE_RESOURCES );
break; break;
...@@ -660,10 +653,6 @@ int main(int argc, char **argv) ...@@ -660,10 +653,6 @@ int main(int argc, char **argv)
if (!parse_input_file( spec )) break; if (!parse_input_file( spec )) break;
output_import_lib( spec, argv ); output_import_lib( spec, argv );
break; 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: case MODE_RESOURCES:
load_resources( argv, spec ); load_resources( argv, spec );
output_res_o_file( spec ); output_res_o_file( spec );
......
...@@ -903,23 +903,15 @@ static void BuildPendingEventCheck(void) ...@@ -903,23 +903,15 @@ static void BuildPendingEventCheck(void)
/******************************************************************* /*******************************************************************
* BuildRelays16 * output_asm_relays16
* *
* Build all the 16-bit relay callbacks * 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 */ /* File header */
output( "/* File generated automatically. Do not edit! */\n\n" );
output( "\t.text\n" ); output( "\t.text\n" );
output( "%s:\n\n", asm_name("__wine_spec_thunk_text_16") ); output( "%s:\n\n", asm_name("__wine_spec_thunk_text_16") );
output( "%s\n", asm_globl("__wine_call16_start") ); output( "%s\n", asm_globl("__wine_call16_start") );
...@@ -958,14 +950,11 @@ void BuildRelays16(void) ...@@ -958,14 +950,11 @@ void BuildRelays16(void)
output( "\n\t.data\n\t.align %d\n", get_alignment(4) ); 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_DataSelector") );
output( "%s\n\t.long 0\n", asm_globl("CallTo16_TebSelector") ); 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( "\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(); build_call_from_regs_x86();
output_function_size( "__wine_spec_thunk_text_32" ); output_function_size( "__wine_spec_thunk_text_32" );
output_gnu_stack_note();
} }
......
...@@ -773,6 +773,7 @@ void output_spec16_file( DLLSPEC *spec16 ) ...@@ -773,6 +773,7 @@ void output_spec16_file( DLLSPEC *spec16 )
output_stubs( spec16 ); output_stubs( spec16 );
output_exports( spec32 ); output_exports( spec32 );
output_imports( spec16 ); output_imports( spec16 );
if (is_undefined( "__wine_call_from_16" )) output_asm_relays16();
if (spec16->main_module) if (spec16->main_module)
{ {
output( "\n\t%s\n", get_asm_string_section() ); output( "\n\t%s\n", get_asm_string_section() );
......
...@@ -50,10 +50,6 @@ Build a .def file from a spec file. The .spec file is specified via the ...@@ -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 Build a PE import library from a spec file. The .spec file is
specified via the -E option. specified via the -E option.
.TP .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 .B \--resources
Generate a .o file containing all the input resources. This is useful Generate a .o file containing all the input resources. This is useful
when building with a PE compiler, since the PE binutils cannot handle when building with a PE compiler, since the PE binutils cannot handle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment