[PATCH 2/6] winegcc: Allow explicit static and dynamic linking.

Zebediah Figura zfigura at codeweavers.com
Tue Oct 19 01:08:08 CDT 2021


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 tools/winegcc/winegcc.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 5204553f739..c8bf5681fb0 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -2002,7 +2002,14 @@ int main(int argc, char **argv)
                             if (!strcmp(Wl.str[j], "--whole-archive") ||
                                 !strcmp(Wl.str[j], "--no-whole-archive") ||
                                 !strcmp(Wl.str[j], "--start-group") ||
-                                !strcmp(Wl.str[j], "--end-group"))
+                                !strcmp(Wl.str[j], "--end-group") ||
+                                !strcmp(Wl.str[j], "-Bdynamic") ||
+                                !strcmp(Wl.str[j], "-Bstatic") ||
+                                !strcmp(Wl.str[j], "-dn") ||
+                                !strcmp(Wl.str[j], "-dy") ||
+                                !strcmp(Wl.str[j], "-call_shared") ||
+                                !strcmp(Wl.str[j], "-non_shared") ||
+                                !strcmp(Wl.str[j], "-static"))
                             {
                                 strarray_add( &opts.files, strmake( "-Wl,%s", Wl.str[j] ));
                                 continue;
@@ -2012,7 +2019,6 @@ int main(int argc, char **argv)
                                 opts.out_implib = strdup( Wl.str[++j] );
                                 continue;
                             }
-                            if (!strcmp(Wl.str[j], "-static")) linking = -1;
                             strarray_add(&opts.linker_args, strmake("-Wl,%s",Wl.str[j]));
                         }
                         raw_compiler_arg = raw_linker_arg = 0;
@@ -2033,7 +2039,10 @@ int main(int argc, char **argv)
 		    break;
                 case '-':
                     if (strcmp("-static", opts.args.str[i]+1) == 0)
-                        linking = -1;
+                    {
+                        strarray_add( &opts.files, opts.args.str[i] );
+                        raw_compiler_arg = raw_linker_arg = 0;
+                    }
                     else if (is_option( &opts, i, "--sysroot", &option_arg ))
                     {
                         opts.sysroot = option_arg;
@@ -2092,7 +2101,6 @@ int main(int argc, char **argv)
     }
 
     if (opts.processor == proc_cpp) linking = 0;
-    if (linking == -1) error("Static linking is not supported\n");
 
     if (!opts.wine_objdir && is_pe_target( &opts )) opts.use_msvcrt = 1;
 
-- 
2.33.0




More information about the wine-devel mailing list