From: Rémi Bernon rbernon@codeweavers.com
Modern windows uses 10.0, but compiling a program with this version prevents it from running on Windows with STATUS_INVALID_IMAGE_FORMAT. --- tools/winegcc/winegcc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 8f5b7df71a1..a837c204a52 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1621,7 +1621,7 @@ int main(int argc, char **argv) includedir = get_includedir( bindir ); target = init_argv0_target( argv[0] ); path_dirs = strarray_frompath( getenv( "PATH" )); - subsystem = "console"; + subsystem = "console:6.0";
/* setup tmp file removal at exit */ atexit(clean_temp_files); @@ -1767,12 +1767,12 @@ int main(int argc, char **argv) } else if (strcmp("-mwindows", args.str[i]) == 0) { - if (strncmp( subsystem, "windows", 7 )) subsystem = "windows"; + if (strncmp( subsystem, "windows", 7 )) subsystem = "windows:6.0"; raw_compiler_arg = 0; } else if (strcmp("-mconsole", args.str[i]) == 0) { - if (strncmp( subsystem, "console", 7 )) subsystem = "console"; + if (strncmp( subsystem, "console", 7 )) subsystem = "console:6.0"; raw_compiler_arg = 0; } else if (strcmp("-municode", args.str[i]) == 0) @@ -1903,6 +1903,8 @@ int main(int argc, char **argv) if (!strcmp(Wl.str[j], "--subsystem") && j < Wl.count - 1) { subsystem = xstrdup( Wl.str[++j] ); + if (!strcmp( subsystem, "windows" ) || !strcmp( subsystem, "console" )) + subsystem = strmake( "%s:6.0", subsystem ); continue; } if (!strcmp(Wl.str[j], "--entry") && j < Wl.count - 1)