authorgravatar for sivecano@gmail.comSivecano <sivecano@gmail.com> 2025-12-29 05:55:03+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-29 05:55:03+01:00
logec13e8eaaafc34193f245e593333f512681f168f
treedb354f6464085b4f04aa97d1fdceee24c57f5c07
parent744e22b18afe0113ff79f0305eecaa3427b57db6

emit error and crash when trying to use the broken -femit-h option (#30229)

I know the real solution would be to fix this. But this is still way better than unexplained bugs. I hope this is the correct way to do this. I've tested it and it seems to work as advertised. This may not fix it in the build system... but yk, better than nothing. Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30229 Reviewed-by: Andrew Kelley <andrewrk@noreply.codeberg.org> Co-authored-by: Sivecano <sivecano@gmail.com> Co-committed-by: Sivecano <sivecano@gmail.com>

1 files changed, 1 insertions(+), 0 deletions(-)

src/main.zig+1
...@@ -1503,6 +1503,7 @@ fn buildOutputType(...@@ -1503,6 +1503,7 @@ fn buildOutputType(
1503 } else if (mem.eql(u8, arg, "-fno-emit-bin")) {1503 } else if (mem.eql(u8, arg, "-fno-emit-bin")) {
1504 emit_bin = .no;1504 emit_bin = .no;
1505 } else if (mem.eql(u8, arg, "-femit-h")) {1505 } else if (mem.eql(u8, arg, "-femit-h")) {
1506 fatal("-femit-h is currently broken, see https://github.com/ziglang/zig/issues/9698", .{});
1506 emit_h = .yes_default_path;1507 emit_h = .yes_default_path;
1507 } else if (mem.cutPrefix(u8, arg, "-femit-h=")) |rest| {1508 } else if (mem.cutPrefix(u8, arg, "-femit-h=")) |rest| {
1508 emit_h = .{ .yes = rest };1509 emit_h = .{ .yes = rest };