diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 242944674c59b6e96f27f730e8472430fc035bec..b64c9a0a234b2c410454202137f3b178aa049354 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -361,5 +361,6 @@ extern char **lib_path;
 extern char *as_command;
 extern char *ld_command;
 extern char *nm_command;
+extern char *cpu_option;
 
 #endif  /* __WINE_BUILD_H */
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index f6d39b06f0bae7aa75e012a44e50b958aa74407e..55908d58689d366f5832426859fd6004caac2389 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -88,6 +88,7 @@ static int fake_module;
 char *as_command = NULL;
 char *ld_command = NULL;
 char *nm_command = NULL;
+char *cpu_option = NULL;
 
 static int nb_res_files;
 static char **res_files;
@@ -379,11 +380,11 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
             lib_path[nb_lib_paths++] = xstrdup( optarg );
             break;
         case 'm':
-            if (strcmp( optarg, "16" ) && strcmp( optarg, "32" ) && strcmp( optarg, "64" ))
-                fatal_error( "Invalid -m option '%s', expected -m16, -m32 or -m64\n", optarg );
             if (!strcmp( optarg, "16" )) spec->type = SPEC_WIN16;
             else if (!strcmp( optarg, "32" )) force_pointer_size = 4;
-            else force_pointer_size = 8;
+            else if (!strcmp( optarg, "64" )) force_pointer_size = 8;
+            else if (!strncmp( optarg, "cpu=", 4 )) cpu_option = xstrdup( optarg + 4 );
+            else fatal_error( "Invalid -m option '%s', expected -m16, -m32, -m64 or -mcpu\n", optarg );
             break;
         case 'M':
             spec->main_module = xstrdup( optarg );
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index ad637b63573111bb778cbdc61015f1301fd71cc5..931fc4960d475e418cc9fde40bc3ecc5e63f1d6b 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -362,6 +362,8 @@ struct strarray *get_as_command(void)
             break;
         }
     }
+
+    if (cpu_option) strarray_add_one( args, strmake("-mcpu=%s", cpu_option) );
     return args;
 }