winebuild: Don't use llvm-lib to build static libs containing importlibs.

It's not supported by LLVM 10.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50653
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-02-12 15:35:21 +01:00 committed by Alexandre Julliard
parent 062644361b
commit 6d9b331184
1 changed files with 7 additions and 15 deletions

View File

@ -1838,20 +1838,19 @@ static void assemble_files( const char *prefix )
} }
/* build a library from the current asm files and any additional object files in argv */ /* 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; struct strarray args;
if (target_platform != PLATFORM_WINDOWS) if (!create || target_platform != PLATFORM_WINDOWS)
{ {
args = find_tool( "ar", NULL ); 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 else
{ {
args = find_link_tool(); 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_addall( &args, as_files );
strarray_addv( &args, argv ); strarray_addv( &args, argv );
@ -1974,19 +1973,12 @@ void output_static_lib( DLLSPEC *spec, char **argv )
{ {
if (is_pe()) if (is_pe())
{ {
const char *importlib = NULL; if (spec) build_windows_import_lib( output_file_name, spec );
if (spec) if (argv[0] || !spec) build_library( output_file_name, argv, !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 );
} }
else else
{ {
if (spec) build_unix_import_lib( spec ); if (spec) build_unix_import_lib( spec );
build_library( output_file_name, argv, NULL ); build_library( output_file_name, argv, 1 );
} }
} }