[PATCH] winebuild: Specify an object format to windres(1).

Charles Davis cdavis5x at gmail.com
Mon Feb 29 02:49:58 CST 2016


This is critical for multilib setups. Otherwise, the resource object
won't get linked due to being in the wrong format.

Signed-off-by: Charles Davis <cdavis5x at gmail.com>
---
 tools/winebuild/res32.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c
index d459a5f..c59fa19 100644
--- a/tools/winebuild/res32.c
+++ b/tools/winebuild/res32.c
@@ -623,6 +623,7 @@ void output_res_o_file( DLLSPEC *spec )
 {
     unsigned int i;
     char *res_file = NULL;
+    const char *format;
     int fd;
     struct strarray *args;
 
@@ -681,7 +682,21 @@ void output_res_o_file( DLLSPEC *spec )
     free( output_buffer );
 
     args = find_tool( "windres", NULL );
+    switch (target_cpu)
+    {
+        case CPU_x86:
+            format = "pe-i386";
+            break;
+        case CPU_x86_64:
+            format = "pe-x86-64";
+            break;
+        default:
+            format = NULL;
+            break;
+    }
     strarray_add( args, "-i", res_file, "-o", output_file_name, NULL );
+    if (format)
+        strarray_add( args, "-F", format, NULL );
     spawn( args );
     strarray_free( args );
 
-- 
2.7.2




More information about the wine-patches mailing list