File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -4959,8 +4959,16 @@ static void init(CodeGen *g) {
4959
4959
const char *target_specific_cpu_args;
4960
4960
const char *target_specific_features;
4961
4961
if (g->is_native_target ) {
4962
- target_specific_cpu_args = ZigLLVMGetHostCPUName ();
4963
- target_specific_features = ZigLLVMGetNativeFeatures ();
4962
+ // LLVM creates invalid binaries on Windows sometimes.
4963
+ // See https://github.com/zig-lang/zig/issues/508
4964
+ // As a workaround we do not use target native features on Windows.
4965
+ if (g->zig_target .os == ZigLLVM_Win32) {
4966
+ target_specific_cpu_args = " " ;
4967
+ target_specific_features = " " ;
4968
+ } else {
4969
+ target_specific_cpu_args = ZigLLVMGetHostCPUName ();
4970
+ target_specific_features = ZigLLVMGetNativeFeatures ();
4971
+ }
4964
4972
} else {
4965
4973
target_specific_cpu_args = " " ;
4966
4974
target_specific_features = " " ;
You can’t perform that action at this time.
0 commit comments