From: Jacek Caban Subject: [PATCH] winebuild: Don't use llvm-lib to build static libs containing importlibs. Message-Id: <8dc0fb8f-2847-f24f-b2b7-05c5f6720531@codeweavers.com> Date: Fri, 12 Feb 2021 15:35:21 +0100 It's not supported by LLVM 10. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50653 Signed-off-by: Jacek Caban --- tools/winebuild/import.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 5ed7c2f7335..a9a0e72abbf 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1860,20 +1860,19 @@ static void assemble_files( const char *prefix ) } /* build a library from the current asm files and any additional object files in argv */ -static void build_library( const char *output_name, char **argv, const char *importlib ) +static void build_library( const char *output_name, char **argv, int create ) { - int create = !importlib || importlib != output_name; struct strarray args; - if (target_platform != PLATFORM_WINDOWS) + if (!create || target_platform != PLATFORM_WINDOWS) { args = find_tool( "ar", NULL ); - strarray_add( &args, create ? "rc" : "r", output_name, importlib, NULL ); + strarray_add( &args, create ? "rc" : "r", output_name, NULL ); } else { args = find_link_tool(); - strarray_add( &args, "/lib", strmake( "-out:%s", output_name ), importlib, NULL ); + strarray_add( &args, "/lib", strmake( "-out:%s", output_name ), NULL ); } strarray_addall( &args, as_files ); strarray_addv( &args, argv ); @@ -1996,19 +1995,12 @@ void output_static_lib( DLLSPEC *spec, char **argv ) { if (is_pe()) { - const char *importlib = NULL; - if (spec) - { - importlib = (argv[0] && target_platform == PLATFORM_WINDOWS) - ? get_temp_file_name( output_file_name, ".a" ) - : output_file_name; - build_windows_import_lib( importlib, spec ); - } - if (argv[0] || !spec) build_library( output_file_name, argv, importlib ); + if (spec) build_windows_import_lib( output_file_name, spec ); + if (argv[0] || !spec) build_library( output_file_name, argv, !spec ); } else { if (spec) build_unix_import_lib( spec ); - build_library( output_file_name, argv, NULL ); + build_library( output_file_name, argv, 1 ); } }