authorgravatar for tristan.ross@midstall.comTristan Ross <tristan.ross@midstall.com> 2024-02-08 14:28:20-08:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-02-09 17:49:53+02:00
log2a3e601f7779c921b05ae5df424f36101622b656
tree815f1dd989a468980b5afa36fdf94b9b4680bf15
parentddcea2cad486684607039aab45634e0e30e7312a

test.link.macho: fix for non-x86 and arm architectures

This fix is requires to make the build runner even compile when building Zig on architectures like RISC-V.

1 files changed, 7 insertions(+), 3 deletions(-)

test/link/macho.zig+7-3
......@@ -3,9 +3,6 @@
33pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
44 const macho_step = b.step("test-macho", "Run MachO tests");
55
6 const default_target = b.resolveTargetQuery(.{
7 .os_tag = .macos,
8 });
96 const x86_64_target = b.resolveTargetQuery(.{
107 .cpu_arch = .x86_64,
118 .os_tag = .macos,
......@@ -15,6 +12,13 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
1512 .os_tag = .macos,
1613 });
1714
15 const default_target = switch (builtin.cpu.arch) {
16 .x86_64, .aarch64 => b.resolveTargetQuery(.{
17 .os_tag = .macos,
18 }),
19 else => aarch64_target,
20 };
21
1822 // Exercise linker with self-hosted backend (no LLVM)
1923 macho_step.dependOn(testHelloZig(b, .{ .use_llvm = false, .target = x86_64_target }));
2024 macho_step.dependOn(testRelocatableZig(b, .{ .use_llvm = false, .strip = true, .target = x86_64_target }));