From 3622b9ab153ce792aa3add8d3aa71b487edfda9a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 15 Apr 2020 16:06:22 +0200 Subject: [PATCH] winegcc: Use the CRT startup code also for non-PE builds. Signed-off-by: Alexandre Julliard --- tools/winegcc/winegcc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index d6631031864..7d55e19866a 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1187,19 +1187,16 @@ static void build(struct options* opts) /* set default entry point, if needed */ if (!opts->entry_point) { - if (is_pe) + if (opts->subsystem && !strcmp( opts->subsystem, "native" )) + entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "_DriverEntry@8" : "DriverEntry"; + else if (opts->use_msvcrt && !opts->shared && !opts->win16_app) { - if (opts->subsystem && !strcmp( opts->subsystem, "native" )) - entry_point = opts->target_cpu == CPU_x86 ? "_DriverEntry@8" : "DriverEntry"; - else if(opts->use_msvcrt && !opts->shared && !opts->win16_app) - { - if (opts->unicode_app) - entry_point = opts->target_cpu == CPU_x86 ? "_wmainCRTStartup" : "wmainCRTStartup"; - else - entry_point = opts->target_cpu == CPU_x86 ? "_mainCRTStartup" : "mainCRTStartup"; - } + if (opts->unicode_app) + entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "_wmainCRTStartup" : "wmainCRTStartup"; + else + entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "_mainCRTStartup" : "mainCRTStartup"; } - else if (!opts->shared && opts->unicode_app) + else if (!is_pe && !opts->shared && opts->unicode_app) entry_point = "__wine_spec_exe_wentry"; } else entry_point = opts->entry_point;