Pass inferred cpu_arch to defaultVersionRange

This is mainly because arm64 macOS doesn't support all
versions supported by x86_64 macOS. This is just a temporary
thing until both architectures support the same set of OSes.
This commit is contained in:
Jakub Konka
2021-11-24 20:34:13 +01:00
parent 42a351e099
commit c42439dff9
4 changed files with 20 additions and 10 deletions

View File

@@ -9305,7 +9305,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
buf_appendf(contents, "pub const abi = std.Target.Abi.%s;\n", cur_abi);
buf_appendf(contents, "pub const cpu = std.Target.Cpu.baseline(.%s);\n", cur_arch);
buf_appendf(contents, "pub const stage2_arch: std.Target.Cpu.Arch = .%s;\n", cur_arch);
buf_appendf(contents, "pub const os = std.Target.Os.Tag.defaultVersionRange(.%s);\n", cur_os);
buf_appendf(contents, "pub const os = std.Target.Os.Tag.defaultVersionRange(.%s, .%s);\n", cur_os, cur_arch);
buf_appendf(contents,
"pub const target = std.Target{\n"
" .cpu = cpu,\n"