Module: wine Branch: master Commit: 9e133a9a22aee61f7b402e446fdf34cc984a2dbd URL: https://source.winehq.org/git/wine.git/?a=commit;h=9e133a9a22aee61f7b402e446...
Author: Chip Davis cdavis@codeweavers.com Date: Fri Sep 24 19:56:23 2021 -0500
winegcc: Only add -static-libgcc if -nodefaultlibs weren't given. (Clang).
The flag does nothing if -nodefaultlibs or -nostdlib were given, because the driver does not automatically link to libgcc/compiler-rt in that case. Clang will warn about this, which is annoying, which clutters up the output, and which makes it impossible to use -Werror when building with Clang.
Signed-off-by: Chip Davis cdavis@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tools/winegcc/winegcc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 8e72c6bcfee..2bf13570bba 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -538,7 +538,8 @@ static struct strarray get_link_args( struct options *opts, const char *output_n strarray_add( &flags, "-Wl,--large-address-aware" );
/* make sure we don't need a libgcc_s dll on Windows */ - strarray_add( &flags, "-static-libgcc" ); + if (!opts->nodefaultlibs && !opts->use_msvcrt) + strarray_add( &flags, "-static-libgcc" );
if (opts->debug_file && strendswith(opts->debug_file, ".pdb")) strarray_add(&link_args, strmake("-Wl,-pdb,%s", opts->debug_file));