mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 08:33:15 +00:00
workaround for invalid binary created on windows
when target native features are used. See #508
This commit is contained in:
parent
845f22101b
commit
588d2862d9
@ -4959,8 +4959,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 = "";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user