aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-10-03 00:57:02 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-10-03 00:57:02 -0400
commit6a0c4289974dbe27d8980425e7e6061078ecf896 (patch)
tree6666e67a07fce13ac2e216a63909b5c307f10dad /src
parentb5054625093ef22b3f228199b6fbf70e1c50b703 (diff)
downloadzig-6a0c4289974dbe27d8980425e7e6061078ecf896.tar.gz
zig-6a0c4289974dbe27d8980425e7e6061078ecf896.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp12
1 files changed, 10 insertions, 2 deletions
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 = "";