avoid passing -march=native when not supported
Clang does not support -march=native for all targets. Arguably it should always work, but in reality it gives: error: the clang compiler does not support '-march=native' If we move CPU detection logic into Zig itelf, we will not need this, instead we will always pass target features and CPU configuration explicitly. For now, we simply avoid passing the flag when it is known to not be supported.
This commit is contained in:
@@ -8762,7 +8762,9 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa
|
||||
}
|
||||
|
||||
if (g->zig_target->is_native) {
|
||||
args.append("-march=native");
|
||||
if (target_supports_clang_march_native(g->zig_target)) {
|
||||
args.append("-march=native");
|
||||
}
|
||||
} else {
|
||||
args.append("-target");
|
||||
args.append(buf_ptr(&g->llvm_triple_str));
|
||||
|
||||
Reference in New Issue
Block a user