From: Gabriel Ivăncescu gabrielopcode@gmail.com
For Link-Time Optimization (LTO) it is required to use gcc-* prefixed utils (gcc-ar, gcc-ranlib, gcc-nm) to invoke the plugin properly, and since they're a superset of the standard utils, we can simply always use them if available.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- tools/winebuild/import.c | 6 ++++-- tools/winebuild/utils.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 9325837b749..baac8786a98 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1439,7 +1439,8 @@ void output_static_lib( const char *output_name, struct strarray files, int crea
if (!create || target.platform != PLATFORM_WINDOWS) { - args = find_tool( "ar", NULL ); + static const char * const commands[] = { "gcc-ar", "ar", NULL }; + args = find_tool( "ar", commands ); strarray_add( &args, create ? "rc" : "r" ); strarray_add( &args, output_name ); } @@ -1457,7 +1458,8 @@ void output_static_lib( const char *output_name, struct strarray files, int crea
if (target.platform != PLATFORM_WINDOWS) { - struct strarray ranlib = find_tool( "ranlib", NULL ); + static const char * const commands[] = { "gcc-ranlib", "ranlib", NULL }; + struct strarray ranlib = find_tool( "ranlib", commands ); strarray_add( &ranlib, output_name ); spawn( ranlib ); } diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 9f51a60c01f..91d83fd6ba4 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -389,7 +389,7 @@ const char *get_nm_command(void) { if (!nm_command.count) { - static const char * const commands[] = { "nm", "gnm", NULL }; + static const char * const commands[] = { "gcc-nm", "nm", "gnm", NULL }; nm_command = find_tool( "nm", commands ); } if (nm_command.count > 1)