Module: wine Branch: master Commit: 78ce43f01772bc1ddafdf217cb1390f7e7c8c9d1 URL: https://source.winehq.org/git/wine.git/?a=commit;h=78ce43f01772bc1ddafdf217c... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 4 15:19:43 2020 +0200 winegcc: Explicitly pass DLL crt entry point to PE linker when Wine crt is used. Linkers don't agree on its default. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index a5bc0f4576..95797e6b63 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1292,6 +1292,9 @@ 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 && opts->use_msvcrt && !entry_point && (opts->shared || opts->win16_app)) + entry_point = opts->target_cpu == CPU_x86 ? "DllMainCRTStartup(a)12" : "DllMainCRTStartup"; + if (is_pe && entry_point) strarray_add(link_args, strmake("-Wl,--entry,%s%s", is_pe && opts->target_cpu == CPU_x86 ? "_" : "",