Module: wine Branch: master Commit: 90bed22eb715201de3ddde0b08d4d6b9357c7635 URL: https://source.winehq.org/git/wine.git/?a=commit;h=90bed22eb715201de3ddde0b0...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Aug 6 12:28:53 2019 +0200
winegcc: Use -nodefaultlibs -nostartfiles for builtin DLLs.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tools/winegcc/winegcc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 222c750..a7476dd 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -383,6 +383,7 @@ static int try_link( const strarray *prefix, const strarray *link_tool, const ch
static strarray *get_link_args( struct options *opts, const char *output_name ) { + int use_wine_crt = opts->wine_builtin && opts->shared; const strarray *link_tool = get_translator( opts ); strarray *flags = strarray_alloc(); unsigned int i; @@ -437,8 +438,8 @@ static strarray *get_link_args( struct options *opts, const char *output_name ) else strarray_add( flags, opts->gui_app ? "-mwindows" : "-mconsole" );
if (opts->unicode_app) strarray_add( flags, "-municode" ); - if (opts->nodefaultlibs) strarray_add( flags, "-nodefaultlibs" ); - if (opts->nostartfiles) strarray_add( flags, "-nostartfiles" ); + if (opts->nodefaultlibs || use_wine_crt) strarray_add( flags, "-nodefaultlibs" ); + if (opts->nostartfiles || use_wine_crt) strarray_add( flags, "-nostartfiles" );
if (opts->subsystem) { @@ -1172,7 +1173,7 @@ static void build(struct options* opts) strarray_add(link_args, "-lc"); }
- if (opts->nodefaultlibs && is_pe) strarray_add( link_args, "-lgcc" ); + if ((opts->nodefaultlibs || opts->shared) && is_pe) strarray_add( link_args, "-lgcc" );
spawn(opts->prefix, link_args, 0); strarray_free (link_args);