[PATCH v2] winegcc: --out-implib needs to propagate -m32/-m64 to winebuild

Kevin Puetz PuetzKevinA at JohnDeere.com
Thu Feb 3 16:08:25 CST 2022


This was already passed through for linking, and for spec.o files,
but was overlooked when implementing -Wl,--out-implib

Signed-off-by: Kevin Puetz <PuetzKevinA at JohnDeere.com>
--

This version will also send -m32/-m64 to subcommands that don't care
e.g. winebuild --fixup-constructors peeks at the ELF magic number instead,
and winebuld --builtin just modifies an existing PE header in-place.

But that's harmless; winebuild will always parse and accept -m16/32/64,
and it does interact with --target, so it's reasonable to always pass
them together just to have fewer details to think about.
---
 tools/winegcc/winegcc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 0aafca1271a..44d86fb130a 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -897,6 +897,8 @@ static struct strarray get_winebuild_args(struct options *opts)
         strarray_add( &spec_args, "--target" );
         strarray_add( &spec_args, opts->target_alias );
     }
+    if (opts->force_pointer_size)
+        strarray_add(&spec_args, strmake("-m%u", 8 * opts->force_pointer_size ));
     for (i = 0; i < opts->prefix.count; i++)
         strarray_add( &spec_args, strmake( "-B%s", opts->prefix.str[i] ));
     strarray_addall( &spec_args, opts->winebuild_args );
@@ -1025,8 +1027,6 @@ static const char *build_spec_obj( struct options *opts, const char *spec_file,
     }
 
     spec_o_name = get_temp_file(output_name, ".spec.o");
-    if (opts->force_pointer_size)
-        strarray_add(&spec_args, strmake("-m%u", 8 * opts->force_pointer_size ));
     if (opts->pic && !is_pe) strarray_add(&spec_args, "-fPIC");
     strarray_add(&spec_args, opts->shared ? "--dll" : "--exe");
     if (opts->fake_module)
-- 
2.34.1




More information about the wine-devel mailing list