From 6a0c4289974dbe27d8980425e7e6061078ecf896 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 3 Oct 2017 00:57:02 -0400 Subject: use __chkstk_ms compiler-rt functions for __chkstk I had to revert the target native features thing because there is still some incorrect behavior with f128. Reopens #508 partially reverts b5054625093ef22b3f228199b6fbf70e1c50b703 See #302 --- src/codegen.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index efcf6ea3e3..5889ba316a 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -5008,8 +5008,16 @@ static void init(CodeGen *g) { const char *target_specific_cpu_args; const char *target_specific_features; if (g->is_native_target) { - target_specific_cpu_args = ZigLLVMGetHostCPUName(); - target_specific_features = ZigLLVMGetNativeFeatures(); + // LLVM creates invalid binaries on Windows sometimes. + // See https://github.com/zig-lang/zig/issues/508 + // As a workaround we do not use target native features on Windows. + if (g->zig_target.os == ZigLLVM_Win32) { + target_specific_cpu_args = ""; + target_specific_features = ""; + } else { + target_specific_cpu_args = ZigLLVMGetHostCPUName(); + target_specific_features = ZigLLVMGetNativeFeatures(); + } } else { target_specific_cpu_args = ""; target_specific_features = ""; -- cgit v1.2.3