aboutsummaryrefslogtreecommitdiff
path: root/src/stage2.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-25 20:32:40 -0400
committerAndrew Kelley <andrew@ziglang.org>2020-03-25 20:34:15 -0400
commitfae6cf09619e7a8e64f61b84cca7d9fcd471262f (patch)
tree373d125e6c7eb97f563af264de62eb48fb6b5baa /src/stage2.cpp
parentdd66fbb96a2e1f85e7dacdce18ebc5f85d26d0cc (diff)
downloadzig-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/stage2.cpp')
-rw-r--r--src/stage2.cpp6
1 files changed, 4 insertions, 2 deletions
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";