Alexandre Julliard : winegcc: Fixup constructors after building a module.

Alexandre Julliard julliard at winehq.org
Thu Apr 16 16:45:12 CDT 2020


Module: wine
Branch: master
Commit: c30d30d328408a9031477e084377f8d7eef11e74
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c30d30d328408a9031477e084377f8d7eef11e74

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr 16 12:21:48 2020 +0200

winegcc: Fixup constructors after building a module.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winegcc/winegcc.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index b2a4f9189e..0682e9aa9a 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -936,6 +936,16 @@ static strarray *get_winebuild_args(struct options *opts)
     return spec_args;
 }
 
+static void fixup_constructors( struct options *opts, const char *file )
+{
+    strarray *args = get_winebuild_args( opts );
+
+    strarray_add( args, "--fixup-ctors" );
+    strarray_add( args, file );
+    spawn( opts->prefix, args, 0 );
+    strarray_free( args );
+}
+
 static void make_wine_builtin( struct options *opts, const char *file )
 {
     strarray *args = get_winebuild_args( opts );
@@ -1354,8 +1364,6 @@ static void build(struct options* opts)
     spawn(opts->prefix, link_args, 0);
     strarray_free (link_args);
 
-    if (is_pe && opts->wine_builtin) make_wine_builtin( opts, output_path );
-
     /* set the base address with prelink if linker support is not present */
     if (opts->prelink && !opts->target)
     {
@@ -1371,6 +1379,9 @@ static void build(struct options* opts)
         }
     }
 
+    if (!is_pe && !opts->shared) fixup_constructors( opts, output_path );
+    if (is_pe && opts->wine_builtin) make_wine_builtin( opts, output_path );
+
     /* create the loader script */
     if (generate_app_loader)
         create_file(output_file, 0755, app_loader_template, strmake("%s.so", output_name));




More information about the wine-cvs mailing list