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 b505462509

See #302
This commit is contained in:
Andrew Kelley
2017-10-03 00:57:02 -04:00
parent b505462509
commit 6a0c428997
2 changed files with 32 additions and 11 deletions

View File

@@ -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 = "";