synchronize the target features for compiling C code

d91fc0fdd8 changed zig's behavior to
disable the SSE feature when cross compiling for i386-freestanding.

This commit does the same when compiling C Code.
master
Andrew Kelley 2019-10-28 14:37:32 -04:00
parent 6fdeaac338
commit f2d0d9820d
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 6 additions and 6 deletions

View File

@ -8469,12 +8469,7 @@ static void init(CodeGen *g) {
// uses as base cpu.
// TODO https://github.com/ziglang/zig/issues/2883
target_specific_cpu_args = "pentium4";
if (g->zig_target->os == OsFreestanding) {
target_specific_features = "-sse";
}
else {
target_specific_features = "";
}
target_specific_features = (g->zig_target->os == OsFreestanding) ? "-sse": "";
} else {
target_specific_cpu_args = "";
target_specific_features = "";
@ -8779,6 +8774,11 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa
args.append("-target-feature");
args.append("-Xclang");
args.append(riscv_default_features);
} else if (g->zig_target->os == OsFreestanding && g->zig_target->arch == ZigLLVM_x86) {
args.append("-Xclang");
args.append("-target-feature");
args.append("-Xclang");
args.append("-sse");
}
}
if (g->zig_target->os == OsFreestanding) {