use -nostdinc and sometimes -nolibc when compiling C code

This commit is contained in:
Andrew Kelley
2019-02-26 14:50:20 -05:00
parent 0eed72d687
commit 1ec1097bd3
2 changed files with 14 additions and 1 deletions

View File

@@ -8151,8 +8151,15 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) {
}
args.append("-nobuiltininc");
args.append("-nostdinc");
args.append("-nostdinc++");
if (g->libc_link_lib == nullptr) {
args.append("-nolibc");
}
args.append("-fno-spell-checking");
args.append("-isystem");
args.append(buf_ptr(g->zig_c_headers_dir));