-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zig ld: handle -v linker arg #20512
zig ld: handle -v linker arg #20512
Conversation
The "-v" argument is the same as "--version", but the linker should not exit after the version is printed.
@@ -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")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're here, could you add a branch that handles -V
as well, which just does warn("ignoring request for supported emulations: unimplemented", .{});
? It should likewise not exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're here, could you add a branch that handles
-V
as well, which just doeswarn("ignoring request for supported emulations: unimplemented", .{});
? It should likewise not exit.
I'll have a look at this one in the meantime
Verified this behavior with GNU |
The "-V' argument lists the supported emulations. While linker emulation is not implemented, it's beneficial to warn user regarding this.
cc @kubkon (also needs approval to run CI) |
Thanks! |
The "-v" argument is the same as "--version", but the linker should not exit after the version is printed.
CMake passes this argument during ABI info detection, and currently zig cc fails because this flag is not supported.
Fixes #20493