From fae6cf09619e7a8e64f61b84cca7d9fcd471262f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 25 Mar 2020 20:32:40 -0400 Subject: 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. --- src/stage2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/stage2.cpp') diff --git a/src/stage2.cpp b/src/stage2.cpp index c83b1aa77c..f8a485f93b 100644 --- a/src/stage2.cpp +++ b/src/stage2.cpp @@ -181,7 +181,8 @@ static void get_native_target(ZigTarget *target) { &target->abi, &oformat); target->os = get_zig_os_type(os_type); - target->is_native = true; + target->is_native_os = true; + target->is_native_cpu = true; if (target->abi == ZigLLVM_UnknownEnvironment) { target->abi = target_default_abi(target->arch, target->os); } @@ -204,7 +205,8 @@ Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, cons target->llvm_cpu_features = ZigLLVMGetNativeFeatures(); target->cache_hash = "native\n\n"; } else if (strcmp(mcpu, "baseline") == 0) { - target->is_native = false; + target->is_native_os = false; + target->is_native_cpu = false; target->llvm_cpu_name = ""; target->llvm_cpu_features = ""; target->cache_hash = "baseline\n\n"; -- cgit v1.2.3