From 3a22ad70354903ccde2e7274c97e5393ef32d274 Mon Sep 17 00:00:00 2001 From: Aikawa Yataro Date: Sat, 6 Jul 2024 02:05:55 +0000 Subject: [PATCH 1/2] zig ld: handle -v linker arg The "-v" argument is the same as "--version", but the linker should not exit after the version is printed. --- src/main.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.zig b/src/main.zig index 3ba1276abfbf..b3241f8107ea 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2475,6 +2475,8 @@ fn buildOutputType( fatal("unable to parse /version '{s}': {s}", .{ arg, @errorName(err) }); }; have_version = true; + } else if (mem.eql(u8, arg, "-v")) { + try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n"); } else if (mem.eql(u8, arg, "--version")) { try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n"); process.exit(0); From 73021c1e0c72534b28c35714e9b1ff32824f5cb8 Mon Sep 17 00:00:00 2001 From: Aikawa Yataro Date: Tue, 23 Jul 2024 16:00:18 +0000 Subject: [PATCH 2/2] zig ld: handle -V linker arg The "-V' argument lists the supported emulations. While linker emulation is not implemented, it's beneficial to warn user regarding this. --- src/main.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.zig b/src/main.zig index b3241f8107ea..b3fc0ad6de9b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2475,6 +2475,8 @@ fn buildOutputType( fatal("unable to parse /version '{s}': {s}", .{ arg, @errorName(err) }); }; have_version = true; + } else if (mem.eql(u8, arg, "-V")) { + warn("ignoring request for supported emulations: unimplemented", .{}); } else if (mem.eql(u8, arg, "-v")) { try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n"); } else if (mem.eql(u8, arg, "--version")) {