From bc10382ec1b87da16943907ba2d0fbd267af07f0 Mon Sep 17 00:00:00 2001 From: Maya Rashish Date: Sat, 16 Feb 2019 12:29:12 +0200 Subject: Add NetBSD support Mostly picking the same paths as FreeBSD. We need a little special handling for crt files, as netbsd uses its own (and not GCC's) for those, with slightly different names. --- std/debug/index.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'std/debug') diff --git a/std/debug/index.zig b/std/debug/index.zig index 7e5be9acef..b8ea7e7f84 100644 --- a/std/debug/index.zig +++ b/std/debug/index.zig @@ -240,7 +240,7 @@ pub fn writeCurrentStackTraceWindows( pub fn printSourceAtAddress(debug_info: *DebugInfo, out_stream: var, address: usize, tty_color: bool) !void { switch (builtin.os) { builtin.Os.macosx => return printSourceAtAddressMacOs(debug_info, out_stream, address, tty_color), - builtin.Os.linux, builtin.Os.freebsd => return printSourceAtAddressLinux(debug_info, out_stream, address, tty_color), + builtin.Os.linux, builtin.Os.freebsd, builtin.Os.netbsd => return printSourceAtAddressLinux(debug_info, out_stream, address, tty_color), builtin.Os.windows => return printSourceAtAddressWindows(debug_info, out_stream, address, tty_color), else => return error.UnsupportedOperatingSystem, } @@ -717,7 +717,7 @@ pub const OpenSelfDebugInfoError = error{ pub fn openSelfDebugInfo(allocator: *mem.Allocator) !DebugInfo { switch (builtin.os) { - builtin.Os.linux, builtin.Os.freebsd => return openSelfDebugInfoLinux(allocator), + builtin.Os.linux, builtin.Os.freebsd, builtin.Os.netbsd => return openSelfDebugInfoLinux(allocator), builtin.Os.macosx, builtin.Os.ios => return openSelfDebugInfoMacOs(allocator), builtin.Os.windows => return openSelfDebugInfoWindows(allocator), else => return error.UnsupportedOperatingSystem, @@ -1141,7 +1141,7 @@ pub const DebugInfo = switch (builtin.os) { sect_contribs: []pdb.SectionContribEntry, modules: []Module, }, - builtin.Os.linux, builtin.Os.freebsd => DwarfInfo, + builtin.Os.linux, builtin.Os.freebsd, builtin.Os.netbsd => DwarfInfo, else => @compileError("Unsupported OS"), }; -- cgit v1.2.3