diff options
| author | Ryan Saunderson <rsdimenus@gmail.com> | 2019-08-07 12:51:30 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-07 10:51:30 -0700 |
| commit | 8fcf21fefce56695820b5ec31161589822df8762 (patch) | |
| tree | 63299b3cd576decba53c1c9fd94f79cd206d17d7 /src | |
| parent | 7f23dac6dce2ce897295e8186f164f695cacdbc9 (diff) | |
| download | zig-8fcf21fefce56695820b5ec31161589822df8762.tar.gz zig-8fcf21fefce56695820b5ec31161589822df8762.zip | |
modify header precedence for zig cc, resolves intrinsics issues (#3027)
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index ef24716dff..881b83c169 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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"); |
