| author | |
| committer | |
| log | f8cc6a191723d763fc7a8908f3e5beb4eff8317f |
| tree | 0c551d4be6f9b3de844d74040fd39443ecb592c8 |
| parent | e7f555ca550cc73288adbdf4ec8d0e4abbc7a987 |
| signature |
In an MSVC context, `-MT` means
"Use static run-time"
and it is a flag with no parameter.
On POSIX it means
"Specify name of main file output in depfile"
and it is "joined or separate".
The former was interfering with the latter. Now, the MT flag is required
to be specified with a `/` to disambiguate: `/MT`.3 files changed, 104 insertions(+), 17 deletions(-)
src-self-hosted/clang_options.zig+10| ... | ... | @@ -95,6 +95,16 @@ pub fn flagpd1(name: []const u8) CliArg { |
| 95 | 95 | }; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | /// Shortcut function for initializing a `CliArg` | |
| 99 | pub fn flagpsl(name: []const u8) CliArg { | |
| 100 | return .{ | |
| 101 | .name = name, | |
| 102 | .syntax = .flag, | |
| 103 | .zig_equivalent = .other, | |
| 104 | .psl = true, | |
| 105 | }; | |
| 106 | } | |
| 107 | ||
| 98 | 108 | /// Shortcut function for initializing a `CliArg` |
| 99 | 109 | pub fn joinpd1(name: []const u8) CliArg { |
| 100 | 110 | return .{ |
src-self-hosted/clang_options_data.zig+58-16| ... | ... | @@ -34,10 +34,38 @@ flagpd1("M"), |
| 34 | 34 | .pd2 = false, |
| 35 | 35 | .psl = false, |
| 36 | 36 | }, |
| 37 | flagpd1("MG"), | |
| 38 | flagpd1("MM"), | |
| 39 | flagpd1("MMD"), | |
| 40 | flagpd1("MP"), | |
| 37 | .{ | |
| 38 | .name = "MG", | |
| 39 | .syntax = .flag, | |
| 40 | .zig_equivalent = .dep_file, | |
| 41 | .pd1 = true, | |
| 42 | .pd2 = false, | |
| 43 | .psl = false, | |
| 44 | }, | |
| 45 | .{ | |
| 46 | .name = "MM", | |
| 47 | .syntax = .flag, | |
| 48 | .zig_equivalent = .dep_file, | |
| 49 | .pd1 = true, | |
| 50 | .pd2 = false, | |
| 51 | .psl = false, | |
| 52 | }, | |
| 53 | .{ | |
| 54 | .name = "MMD", | |
| 55 | .syntax = .flag, | |
| 56 | .zig_equivalent = .dep_file, | |
| 57 | .pd1 = true, | |
| 58 | .pd2 = false, | |
| 59 | .psl = false, | |
| 60 | }, | |
| 61 | .{ | |
| 62 | .name = "MP", | |
| 63 | .syntax = .flag, | |
| 64 | .zig_equivalent = .dep_file, | |
| 65 | .pd1 = true, | |
| 66 | .pd2 = false, | |
| 67 | .psl = false, | |
| 68 | }, | |
| 41 | 69 | .{ |
| 42 | 70 | .name = "MV", |
| 43 | 71 | .syntax = .flag, |
| ... | ... | @@ -517,14 +545,7 @@ sepd1("Zlinker-input"), |
| 517 | 545 | .pd2 = false, |
| 518 | 546 | .psl = true, |
| 519 | 547 | }, |
| 520 | .{ | |
| 521 | .name = "MT", | |
| 522 | .syntax = .flag, | |
| 523 | .zig_equivalent = .other, | |
| 524 | .pd1 = true, | |
| 525 | .pd2 = false, | |
| 526 | .psl = true, | |
| 527 | }, | |
| 548 | flagpsl("MT"), | |
| 528 | 549 | .{ |
| 529 | 550 | .name = "MTd", |
| 530 | 551 | .syntax = .flag, |
| ... | ... | @@ -5463,9 +5484,30 @@ joinpd1("G="), |
| 5463 | 5484 | .pd2 = false, |
| 5464 | 5485 | .psl = false, |
| 5465 | 5486 | }, |
| 5466 | jspd1("MJ"), | |
| 5467 | jspd1("MQ"), | |
| 5468 | jspd1("MT"), | |
| 5487 | .{ | |
| 5488 | .name = "MJ", | |
| 5489 | .syntax = .joined_or_separate, | |
| 5490 | .zig_equivalent = .dep_file, | |
| 5491 | .pd1 = true, | |
| 5492 | .pd2 = false, | |
| 5493 | .psl = false, | |
| 5494 | }, | |
| 5495 | .{ | |
| 5496 | .name = "MQ", | |
| 5497 | .syntax = .joined_or_separate, | |
| 5498 | .zig_equivalent = .dep_file, | |
| 5499 | .pd1 = true, | |
| 5500 | .pd2 = false, | |
| 5501 | .psl = false, | |
| 5502 | }, | |
| 5503 | .{ | |
| 5504 | .name = "MT", | |
| 5505 | .syntax = .joined_or_separate, | |
| 5506 | .zig_equivalent = .dep_file, | |
| 5507 | .pd1 = true, | |
| 5508 | .pd2 = false, | |
| 5509 | .psl = false, | |
| 5510 | }, | |
| 5469 | 5511 | .{ |
| 5470 | 5512 | .name = "AI", |
| 5471 | 5513 | .syntax = .joined_or_separate, |
| ... | ... | @@ -5589,7 +5631,7 @@ jspd1("MT"), |
| 5589 | 5631 | .{ |
| 5590 | 5632 | .name = "MP", |
| 5591 | 5633 | .syntax = .joined, |
| 5592 | .zig_equivalent = .other, | |
| 5634 | .zig_equivalent = .dep_file, | |
| 5593 | 5635 | .pd1 = true, |
| 5594 | 5636 | .pd2 = false, |
| 5595 | 5637 | .psl = true, |
tools/update_clang_options.zig+36-1| ... | ... | @@ -206,6 +206,34 @@ const known_options = [_]KnownOpt{ |
| 206 | 206 | .name = "MF", |
| 207 | 207 | .ident = "dep_file", |
| 208 | 208 | }, |
| 209 | .{ | |
| 210 | .name = "MT", | |
| 211 | .ident = "dep_file", | |
| 212 | }, | |
| 213 | .{ | |
| 214 | .name = "MG", | |
| 215 | .ident = "dep_file", | |
| 216 | }, | |
| 217 | .{ | |
| 218 | .name = "MJ", | |
| 219 | .ident = "dep_file", | |
| 220 | }, | |
| 221 | .{ | |
| 222 | .name = "MM", | |
| 223 | .ident = "dep_file", | |
| 224 | }, | |
| 225 | .{ | |
| 226 | .name = "MMD", | |
| 227 | .ident = "dep_file", | |
| 228 | }, | |
| 229 | .{ | |
| 230 | .name = "MP", | |
| 231 | .ident = "dep_file", | |
| 232 | }, | |
| 233 | .{ | |
| 234 | .name = "MQ", | |
| 235 | .ident = "dep_file", | |
| 236 | }, | |
| 209 | 237 | .{ |
| 210 | 238 | .name = "F", |
| 211 | 239 | .ident = "framework_dir", |
| ... | ... | @@ -336,7 +364,12 @@ pub fn main() anyerror!void { |
| 336 | 364 | } |
| 337 | 365 | const syntax = objSyntax(obj); |
| 338 | 366 | |
| 339 | if (knownOption(name)) |ident| { | |
| 367 | if (std.mem.eql(u8, name, "MT") and syntax == .flag) { | |
| 368 | // `-MT foo` is ambiguous because there is also an -MT flag | |
| 369 | // The canonical way to specify the flag is with `/MT` and so we make this | |
| 370 | // the only way. | |
| 371 | try stdout.print("flagpsl(\"{}\"),\n", .{name}); | |
| 372 | } else if (knownOption(name)) |ident| { | |
| 340 | 373 | try stdout.print( |
| 341 | 374 | \\.{{ |
| 342 | 375 | \\ .name = "{}", |
| ... | ... | @@ -350,6 +383,8 @@ pub fn main() anyerror!void { |
| 350 | 383 | , .{ name, syntax, ident, pd1, pd2, pslash }); |
| 351 | 384 | } else if (pd1 and !pd2 and !pslash and syntax == .flag) { |
| 352 | 385 | try stdout.print("flagpd1(\"{}\"),\n", .{name}); |
| 386 | } else if (!pd1 and !pd2 and pslash and syntax == .flag) { | |
| 387 | try stdout.print("flagpsl(\"{}\"),\n", .{name}); | |
| 353 | 388 | } else if (pd1 and !pd2 and !pslash and syntax == .joined) { |
| 354 | 389 | try stdout.print("joinpd1(\"{}\"),\n", .{name}); |
| 355 | 390 | } else if (pd1 and !pd2 and !pslash and syntax == .joined_or_separate) { |