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.
This commit is contained in:
Maya Rashish
2019-02-16 12:29:12 +02:00
parent ba56f365c8
commit bc10382ec1
23 changed files with 1101 additions and 67 deletions

View File

@@ -184,7 +184,8 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out
// On Darwin/MacOS/iOS, we always link libSystem which contains libc.
if (g->zig_target.os == OsMacOSX ||
g->zig_target.os == OsIOS ||
g->zig_target.os == OsFreeBSD)
g->zig_target.os == OsFreeBSD ||
g->zig_target.os == OsNetBSD)
{
g->libc_link_lib = create_link_lib(buf_create_from_str("c"));
g->link_libs_list.append(g->libc_link_lib);