diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 8e21a45f55d..06e2887daf8 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -269,7 +269,6 @@ extern void output_res_o_file( DLLSPEC *spec ); extern void BuildRelays16(void); extern void BuildRelays32(void); -extern void BuildSpec16File( DLLSPEC *spec ); 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 d04d2769f8a..aa487efbe2a 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -633,13 +633,6 @@ int main(int argc, char **argv) if (spec->subsystem != IMAGE_SUBSYSTEM_NATIVE) spec->characteristics |= IMAGE_FILE_DLL; if (!spec_file_name) fatal_error( "missing .spec file\n" ); - if (spec->type == SPEC_WIN32 && spec->main_module) /* embedded 16-bit module */ - { - spec->type = SPEC_WIN16; - load_resources( argv, spec ); - if (parse_input_file( spec )) BuildSpec16File( spec ); - break; - } /* fall through */ case MODE_EXE: load_resources( argv, spec ); diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index c06b4a1932b..a9e67ad17b2 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -462,81 +462,6 @@ static int sort_func_list( ORDDEF **list, int count, } -/******************************************************************* - * output_init_code - * - * Output the dll initialization code. - */ -static void output_init_code( const DLLSPEC *spec ) -{ - char name[80]; - - sprintf( name, ".L__wine_spec_%s_init", make_c_identifier(spec->dll_name) ); - - output( "\n/* dll initialization code */\n\n" ); - output( "\t.text\n" ); - output( "\t.align 4\n" ); - output( "\t%s\n", func_declaration(name) ); - output( "%s:\n", name ); - output( "\tsubl $4,%%esp\n" ); - if (UsePIC) - { - output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); - output( "1:\tleal .L__wine_spec_file_name-1b(%%eax),%%ecx\n" ); - output( "\tpushl %%ecx\n" ); - output( "\tleal .L__wine_spec_dos_header-1b(%%eax),%%ecx\n" ); - output( "\tpushl %%ecx\n" ); - } - else - { - output( "\tpushl $.L__wine_spec_file_name\n" ); - output( "\tpushl $.L__wine_spec_dos_header\n" ); - } - output( "\tcall %s\n", asm_name("__wine_dll_register_16") ); - output( "\taddl $12,%%esp\n" ); - output( "\tret\n" ); - output_function_size( name ); - - sprintf( name, ".L__wine_spec_%s_fini", make_c_identifier(spec->dll_name) ); - - output( "\t.align 4\n" ); - output( "\t%s\n", func_declaration(name) ); - output( "%s:\n", name ); - output( "\tsubl $8,%%esp\n" ); - if (UsePIC) - { - output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); - output( "1:\tleal .L__wine_spec_dos_header-1b(%%eax),%%ecx\n" ); - output( "\tpushl %%ecx\n" ); - } - else - { - output( "\tpushl $.L__wine_spec_dos_header\n" ); - } - output( "\tcall %s\n", asm_name("__wine_dll_unregister_16") ); - output( "\taddl $12,%%esp\n" ); - output( "\tret\n" ); - output_function_size( name ); - - if (target_platform == PLATFORM_APPLE) - { - output( "\t.mod_init_func\n" ); - output( "\t.align %d\n", get_alignment(4) ); - output( "\t.long .L__wine_spec_%s_init\n", make_c_identifier(spec->dll_name) ); - output( "\t.mod_term_func\n" ); - output( "\t.align %d\n", get_alignment(4) ); - output( "\t.long .L__wine_spec_%s_fini\n", make_c_identifier(spec->dll_name) ); - } - else - { - output( "\t.section \".init\",\"ax\"\n" ); - output( "\tcall .L__wine_spec_%s_init\n", make_c_identifier(spec->dll_name) ); - output( "\t.section \".fini\",\"ax\"\n" ); - output( "\tcall .L__wine_spec_%s_fini\n", make_c_identifier(spec->dll_name) ); - } -} - - /******************************************************************* * output_module16 * @@ -830,27 +755,6 @@ static void output_module16( DLLSPEC *spec ) } -/******************************************************************* - * BuildSpec16File - * - * Build a Win16 assembly file from a spec file. - */ -void BuildSpec16File( DLLSPEC *spec ) -{ - output_standard_file_header(); - output_module16( spec ); - output_init_code( spec ); - - output( "\n\t%s\n", get_asm_string_section() ); - output( ".L__wine_spec_file_name:\n" ); - output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name ); - - output_stubs( spec ); - output_get_pc_thunk(); - output_gnu_stack_note(); -} - - /******************************************************************* * output_spec16_file * diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in index e0dd72b14ed..7ca151c3177 100644 --- a/tools/winebuild/winebuild.man.in +++ b/tools/winebuild/winebuild.man.in @@ -167,9 +167,9 @@ option. Generate 32-bit, respectively 64-bit code. .TP .BI \-M,\ --main-module= module -Specify that we are building a 16-bit dll, that will ultimately be -linked together with the 32-bit dll specified in \fImodule\fR. Only -meaningful in \fB--dll\fR mode. +When building a 16-bit dll, set the name of its 32-bit counterpart to +\fImodule\fR. This is used to enforce that the load order for the +16-bit dll matches that of the 32-bit one. .TP .BI \-N,\ --dll-name= dllname Set the internal name of the module. It is only used in Win16 @@ -307,7 +307,11 @@ The entry point will be imported by ordinal instead of by name. The name is still exported. .TP .BI -arch= cpu[,cpu] -The entry point is only available on the specified CPU architecture(s). +The entry point is only available on the specified CPU +architecture(s). The names \fBwin32\fR and \fBwin64\fR match all +32-bit, respectively 64-bit, CPU architectures. In 16-bit dlls, +specifying \fB-arch=win32\fR causes the entry point to be exported +from the 32-bit wrapper module. .SS "Function ordinals" Syntax: .br