diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-25 20:32:40 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-25 20:34:15 -0400 |
| commit | fae6cf09619e7a8e64f61b84cca7d9fcd471262f (patch) | |
| tree | 373d125e6c7eb97f563af264de62eb48fb6b5baa /src/link.cpp | |
| parent | dd66fbb96a2e1f85e7dacdce18ebc5f85d26d0cc (diff) | |
| download | zig-fae6cf09619e7a8e64f61b84cca7d9fcd471262f.tar.gz zig-fae6cf09619e7a8e64f61b84cca7d9fcd471262f.zip | |
improved handling of native system directories
* `-isystem` instead of `-I` for system include directories
fixes a problem with native system directories interfering with zig's
bundled libc.
* separate Stage2Target.is_native into Stage2Target.is_native_os and
Stage2Target.is_native_cpu.
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/link.cpp b/src/link.cpp index d39736e2a7..25b913be21 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -635,7 +635,7 @@ static const char *build_libunwind(CodeGen *parent, Stage2ProgressNode *progress c_file->args.append("-fPIC"); c_file->args.append("-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS"); c_file->args.append("-Wa,--noexecstack"); - if (parent->zig_target->is_native) { + if (parent->zig_target->is_native_os && parent->zig_target->is_native_cpu) { c_file->args.append("-D_LIBUNWIND_IS_NATIVE_ONLY"); } if (parent->build_mode == BuildModeDebug) { @@ -1829,7 +1829,7 @@ static void construct_linker_job_elf(LinkJob *lj) { } } - if (!g->zig_target->is_native) { + if (!g->zig_target->is_native_os) { lj->args.append("--allow-shlib-undefined"); } } @@ -2460,7 +2460,7 @@ static void construct_linker_job_macho(LinkJob *lj) { lj->args.append(buf_ptr(compiler_rt_o_path)); } - if (g->zig_target->is_native) { + if (g->zig_target->is_native_os) { for (size_t lib_i = 0; lib_i < g->link_libs_list.length; lib_i += 1) { LinkLib *link_lib = g->link_libs_list.at(lib_i); if (target_is_libc_lib_name(g->zig_target, buf_ptr(link_lib->name))) { |
