mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
modify header precedence for zig cc, resolves intrinsics issues (#3027)
This commit is contained in:
parent
7f23dac6dc
commit
8fcf21fefc
@ -8292,15 +8292,18 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa
|
||||
}
|
||||
}
|
||||
|
||||
//note(dimenus): appending libc headers before c_headers breaks intrinsics
|
||||
//and other compiler specific items
|
||||
// According to Rich Felker libc headers are supposed to go before C language headers.
|
||||
args.append("-isystem");
|
||||
args.append(buf_ptr(g->zig_c_headers_dir));
|
||||
|
||||
for (size_t i = 0; i < g->libc_include_dir_len; i += 1) {
|
||||
Buf *include_dir = g->libc_include_dir_list[i];
|
||||
args.append("-isystem");
|
||||
args.append(buf_ptr(include_dir));
|
||||
}
|
||||
|
||||
// According to Rich Felker libc headers are supposed to go before C language headers.
|
||||
args.append("-isystem");
|
||||
args.append(buf_ptr(g->zig_c_headers_dir));
|
||||
|
||||
if (g->zig_target->is_native) {
|
||||
args.append("-march=native");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user