From f78890e8caf3b81c55c0b60f86c55ea138d1d631 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 29 Dec 2009 21:36:43 +0100 Subject: [PATCH] winebuild: Get rid of the support for building old style 16-bit modules. --- tools/winebuild/build.h | 1 - tools/winebuild/main.c | 7 --- tools/winebuild/spec16.c | 96 ---------------------------------------- tools/winebuild/winebuild.man.in | 12 +++-- 4 files changed, 8 insertions(+), 108 deletions(-) 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 @@ -463,81 +463,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 * * Output code for a 16-bit module. @@ -831,27 +756,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 * * Output the complete data for a spec 16-bit 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 -- 2.11.4.GIT