put hack back in to disable windows native cpu features

See #508. This can be removed when we upgrade to LLVM 10.
This commit is contained in:
Andrew Kelley
2020-01-21 21:01:36 -05:00
parent 68b6867e76
commit 6e6ec3d71d
2 changed files with 20 additions and 9 deletions

View File

@@ -8785,15 +8785,15 @@ static void init(CodeGen *g) {
const char *target_specific_features = "";
if (g->zig_target->is_native) {
target_specific_cpu_args = ZigLLVMGetHostCPUName();
target_specific_features = ZigLLVMGetNativeFeatures();
// LLVM creates invalid binaries on Windows sometimes.
// See https://github.com/ziglang/zig/issues/508
// As a workaround we do not use target native features on Windows.
// This logic is repeated in stage1.zig
if (g->zig_target->os == OsWindows || g->zig_target->os == OsUefi) {
target_specific_cpu_args = "";
target_specific_features = "";
} else {
target_specific_cpu_args = ZigLLVMGetHostCPUName();
target_specific_features = ZigLLVMGetNativeFeatures();
}
}