[PATCH 1/2] winebuild: add support for -march

Stephen Kitt steve at sk2.org
Sun Dec 13 14:01:19 CST 2015


winebuild supports -mcpu but not -march; this patch adds support for
the latter. Allowing -march to be specified makes it easier to build
Wine for ARMv5 on Debian armel (ARMv4) in particular, using only
CFLAGS and LDFLAGS instead of overriding CC (which causes issues for
people trying to cross-compile or use tools such as distcc or ccache
in certain configurations).

Signed-off-by: Stephen Kitt <steve at sk2.org>
---
 tools/winebuild/build.h          | 1 +
 tools/winebuild/main.c           | 2 ++
 tools/winebuild/utils.c          | 1 +
 tools/winebuild/winebuild.man.in | 2 +-
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 4a71eed..e32e7a9 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -362,6 +362,7 @@ extern struct strarray *cc_command;
 extern struct strarray *ld_command;
 extern struct strarray *nm_command;
 extern char *cpu_option;
+extern char *arch_option;
 extern int thumb_mode;
 
 #endif  /* __WINE_BUILD_H */
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index d1717c0..08c8c2c 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -89,6 +89,7 @@ struct strarray *cc_command = NULL;
 struct strarray *ld_command = NULL;
 struct strarray *nm_command = NULL;
 char *cpu_option = NULL;
+char *arch_option = NULL;
 
 #ifdef __thumb__
 int thumb_mode = 1;
@@ -408,6 +409,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
             else if (!strcmp( optarg, "arm" )) thumb_mode = 0;
             else if (!strcmp( optarg, "thumb" )) thumb_mode = 1;
             else if (!strncmp( optarg, "cpu=", 4 )) cpu_option = xstrdup( optarg + 4 );
+            else if (!strncmp( optarg, "arch=", 5 )) arch_option = xstrdup( optarg + 5 );
             else fatal_error( "Unknown -m option '%s'\n", optarg );
             break;
         case 'M':
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index 83eb803..4860a19 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -388,6 +388,7 @@ struct strarray *get_as_command(void)
         if (force_pointer_size)
             strarray_add_one( args, (force_pointer_size == 8) ? "-m64" : "-m32" );
         if (cpu_option) strarray_add_one( args, strmake("-mcpu=%s", cpu_option) );
+        if (arch_option) strarray_add_one( args, strmake("-march=%s", arch_option) );
         return args;
     }
 
diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in
index df91cb8..2063738 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -156,7 +156,7 @@ option.
 .B \-m16, -m32, -m64
 Generate respectively 16-bit, 32-bit or 64-bit code.
 .TP
-.BI \-marm,\ \-mthumb,\ \-mcpu= option
+.BI \-marm,\ \-mthumb,\ \-march= option ,\ \-mcpu= option
 Set code generation options for the assembler.
 .TP
 .BI \-M,\ --main-module= module
-- 
2.6.2




More information about the wine-patches mailing list