commit 2a3e601f7779c921b05ae5df424f36101622b656 (tree)
parent ddcea2cad486684607039aab45634e0e30e7312a
Author: Tristan Ross <tristan.ross@midstall.com>
Date: Thu, 8 Feb 2024 14:28:20 -0800
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.
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/test/link/macho.zig b/test/link/macho.zig
@@ -3,9 +3,6 @@
pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
const macho_step = b.step("test-macho", "Run MachO tests");
- const default_target = b.resolveTargetQuery(.{
- .os_tag = .macos,
- });
const x86_64_target = b.resolveTargetQuery(.{
.cpu_arch = .x86_64,
.os_tag = .macos,
@@ -15,6 +12,13 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
.os_tag = .macos,
});
+ const default_target = switch (builtin.cpu.arch) {
+ .x86_64, .aarch64 => b.resolveTargetQuery(.{
+ .os_tag = .macos,
+ }),
+ else => aarch64_target,
+ };
+
// Exercise linker with self-hosted backend (no LLVM)
macho_step.dependOn(testHelloZig(b, .{ .use_llvm = false, .target = x86_64_target }));
macho_step.dependOn(testRelocatableZig(b, .{ .use_llvm = false, .strip = true, .target = x86_64_target }));