From 161eb4a000923c28d152781dcc8a080905c7ad32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Sun, 11 Oct 2020 12:25:16 +0000 Subject: [PATCH] initialize std.os.argv in stage1 compiler. it is needed for selfExePath under OpenBSD --- src/stage1.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stage1.zig b/src/stage1.zig index f26622ee89..7214ae21b9 100644 --- a/src/stage1.zig +++ b/src/stage1.zig @@ -25,7 +25,9 @@ comptime { pub const log = stage2.log; pub const log_level = stage2.log_level; -pub export fn main(argc: c_int, argv: [*]const [*:0]const u8) c_int { +pub export fn main(argc: c_int, argv: [*][*:0]u8) c_int { + std.os.argv = argv[0.. @intCast(usize, argc)]; + std.debug.maybeEnableSegfaultHandler(); zig_stage1_os_init();