[PATCH v2 01/10] Revert "makefiles: Use static importlibs on all platforms."

Rémi Bernon rbernon at codeweavers.com
Wed Nov 17 04:51:46 CST 2021


This reverts commit a9b5bb326a1514e2c4185633ab34b22c9bbc9863.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

v2: Add a win32u fix for a random explorer.exe crash on startup,
    although maybe unrelated to the issues seen before.

    Fix call to CancelIoEx / GetOverlappedResult which didn't previously
    wait on Wine, causing 32bit segmentation fault after the result was
    later overwritten on the stack.

    PATCH 1 is still only there for the tests to run.

 tools/makedep.c | 78 +++++++++++++++++++++++++++++++++----------------
 1 file changed, 53 insertions(+), 25 deletions(-)

diff --git a/tools/makedep.c b/tools/makedep.c
index 9ea46aed8d8..d5412eccfa4 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -2189,10 +2189,19 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra
         for (j = 0; j < subdirs.count; j++)
         {
             if (submakes[j]->importlib && !strcmp( submakes[j]->importlib, name ))
-                lib = obj_dir_path( submakes[j], strmake( "lib%s.a", name ));
-            else
-                lib = get_static_lib( submakes[j], name );
-            if (lib) break;
+            {
+                if (is_cross || !*dll_ext || submakes[j]->staticimplib)
+                    lib = obj_dir_path( submakes[j], strmake( "lib%s.a", name ));
+                else
+                {
+                    strarray_add_uniq( deps, strmake( "%s/lib%s.def", submakes[j]->obj_dir, name ));
+                    if (needs_implib_symlink( submakes[j] ))
+                        strarray_add_uniq( deps, strmake( "dlls/lib%s.def", name ));
+                }
+                break;
+            }
+
+            if ((lib = get_static_lib( submakes[j], name ))) break;
         }
 
         if (lib)
@@ -2579,8 +2588,12 @@ static void output_uninstall_rules( struct makefile *make )
 static struct strarray output_importlib_symlinks( const struct makefile *make )
 {
     struct strarray ret = empty_strarray;
-    const char *lib, *dst, *ext[2] = { "a", "cross.a" };
-    int i, count = 1 + !!crosstarget;
+    const char *lib, *dst, *ext[4];
+    int i, count = 0;
+
+    ext[count++] = (*dll_ext && !make->implib_objs.count) ? "def" : "a";
+    if (crosstarget) ext[count++] = "cross.a";
+    if (needs_delay_lib( make )) ext[count++] = "delay.a";
 
     for (i = 0; i < count; i++)
     {
@@ -3307,27 +3320,42 @@ static void output_module( struct makefile *make )
     if (spec_file && make->importlib)
     {
         char *importlib_path = obj_dir_path( make, strmake( "lib%s", make->importlib ));
-
-        strarray_add( &make->clean_files, strmake( "lib%s.a", make->importlib ));
-        if (!*dll_ext && needs_delay_lib( make ))
+        if (*dll_ext && !make->implib_objs.count)
         {
-            strarray_add( &make->clean_files, strmake( "lib%s.delay.a", make->importlib ));
-            output( "%s.delay.a ", importlib_path );
+            strarray_add( &make->clean_files, strmake( "lib%s.def", make->importlib ));
+            output( "%s.def: %s %s\n", importlib_path, tools_path( make, "winebuild" ), spec_file );
+            output( "\t%s%s -w --def -o $@", cmd_prefix( "BUILD" ), tools_path( make, "winebuild" ) );
+            output_filenames( target_flags );
+            if (make->is_win16) output_filename( "-m16" );
+            output_filename( "--export" );
+            output_filename( spec_file );
+            output( "\n" );
+            add_install_rule( make, make->importlib,
+                              strmake( "lib%s.def", make->importlib ),
+                              strmake( "d%s/lib%s.def", so_dir, make->importlib ));
+        }
+        else
+        {
+            strarray_add( &make->clean_files, strmake( "lib%s.a", make->importlib ));
+            if (!*dll_ext && needs_delay_lib( make ))
+            {
+                strarray_add( &make->clean_files, strmake( "lib%s.delay.a", make->importlib ));
+                output( "%s.delay.a ", importlib_path );
+            }
+            output( "%s.a: %s %s", importlib_path, tools_path( make, "winebuild" ), spec_file );
+            output_filenames_obj_dir( make, make->implib_objs );
+            output( "\n" );
+            output( "\t%s%s -w --implib -o $@", cmd_prefix( "BUILD" ), tools_path( make, "winebuild" ) );
+            output_filenames( target_flags );
+            if (make->is_win16) output_filename( "-m16" );
+            output_filename( "--export" );
+            output_filename( spec_file );
+            output_filenames_obj_dir( make, make->implib_objs );
+            output( "\n" );
+            add_install_rule( make, make->importlib,
+                              strmake( "lib%s.a", make->importlib ),
+                              strmake( "d%s/lib%s.a", so_dir, make->importlib ));
         }
-        output( "%s.a: %s %s", importlib_path, tools_path( make, "winebuild" ), spec_file );
-        output_filenames_obj_dir( make, make->implib_objs );
-        output( "\n" );
-        output( "\t%s%s -w --implib -o $@", cmd_prefix( "BUILD" ), tools_path( make, "winebuild" ) );
-        output_filenames( target_flags );
-        if (make->is_win16) output_filename( "-m16" );
-        output_filename( "--export" );
-        output_filename( spec_file );
-        output_filenames_obj_dir( make, make->implib_objs );
-        output( "\n" );
-        add_install_rule( make, make->importlib,
-                          strmake( "lib%s.a", make->importlib ),
-                          strmake( "d%s/lib%s.a", so_dir, make->importlib ));
-
         if (crosstarget)
         {
             struct strarray cross_files = strarray_replace_extension( &make->implib_objs, ".o", ".cross.o" );
-- 
2.33.1




More information about the wine-devel mailing list