Commit 346cbb6f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winegcc: Add entry symbol underscore when building linker command.

parent 964cb1ba
...@@ -1185,14 +1185,9 @@ static void build(struct options* opts) ...@@ -1185,14 +1185,9 @@ static void build(struct options* opts)
if (!opts->entry_point) if (!opts->entry_point)
{ {
if (opts->subsystem && !strcmp( opts->subsystem, "native" )) if (opts->subsystem && !strcmp( opts->subsystem, "native" ))
entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "_DriverEntry@8" : "DriverEntry"; entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "DriverEntry@8" : "DriverEntry";
else if (opts->use_msvcrt && !opts->shared && !opts->win16_app) else if (opts->use_msvcrt && !opts->shared && !opts->win16_app)
{ entry_point = opts->unicode_app ? "wmainCRTStartup" : "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 (!is_pe && !opts->shared && opts->unicode_app) else if (!is_pe && !opts->shared && opts->unicode_app)
entry_point = "__wine_spec_exe_wentry"; entry_point = "__wine_spec_exe_wentry";
} }
...@@ -1297,7 +1292,10 @@ static void build(struct options* opts) ...@@ -1297,7 +1292,10 @@ static void build(struct options* opts)
for ( j = 0; j < lib_dirs->size; j++ ) for ( j = 0; j < lib_dirs->size; j++ )
strarray_add(link_args, strmake("-L%s", lib_dirs->base[j])); strarray_add(link_args, strmake("-L%s", lib_dirs->base[j]));
if (is_pe && entry_point) strarray_add(link_args, strmake("-Wl,--entry,%s", entry_point)); if (is_pe && entry_point)
strarray_add(link_args, strmake("-Wl,--entry,%s%s",
is_pe && opts->target_cpu == CPU_x86 ? "_" : "",
entry_point));
strarray_add(link_args, spec_o_name); strarray_add(link_args, spec_o_name);
......
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