Jacek Caban : winegcc: Add entry symbol underscore when building linker command.
Alexandre Julliard
julliard at winehq.org
Mon May 4 15:49:17 CDT 2020
Module: wine
Branch: master
Commit: 346cbb6f266f2e3aa1559981404dfc57dc738e76
URL: https://source.winehq.org/git/wine.git/?a=commit;h=346cbb6f266f2e3aa1559981404dfc57dc738e76
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon May 4 15:19:23 2020 +0200
winegcc: Add entry symbol underscore when building linker command.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/winegcc/winegcc.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index d38ca97488..a5bc0f4576 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -1185,14 +1185,9 @@ static void build(struct options* opts)
if (!opts->entry_point)
{
if (opts->subsystem && !strcmp( opts->subsystem, "native" ))
- entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "_DriverEntry at 8" : "DriverEntry";
+ entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "DriverEntry at 8" : "DriverEntry";
else if (opts->use_msvcrt && !opts->shared && !opts->win16_app)
- {
- 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";
- }
+ entry_point = opts->unicode_app ? "wmainCRTStartup" : "mainCRTStartup";
else if (!is_pe && !opts->shared && opts->unicode_app)
entry_point = "__wine_spec_exe_wentry";
}
@@ -1297,7 +1292,10 @@ static void build(struct options* opts)
for ( j = 0; j < lib_dirs->size; 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);
More information about the wine-cvs
mailing list