From 974a6fe757fd53873e7dace177ad3ae3c425b504 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 8 Mar 2023 14:34:17 -0700 Subject: [PATCH] std.Build.RunStep: support -fqemu solving bad dynamic linker --- lib/std/Build/RunStep.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/std/Build/RunStep.zig b/lib/std/Build/RunStep.zig index 9ab9972c2e..9a1c887d7d 100644 --- a/lib/std/Build/RunStep.zig +++ b/lib/std/Build/RunStep.zig @@ -555,7 +555,9 @@ fn runCommand( try Step.handleVerbose(step.owner, self.cwd, argv); const result = spawnChildAndCollect(self, argv, has_side_effects) catch |err| term: { - if (err == error.InvalidExe) interpret: { + // InvalidExe: cpu arch mismatch + // FileNotFound: can happen with a wrong dynamic linker path + if (err == error.InvalidExe or err == error.FileNotFound) interpret: { // TODO: learn the target from the binary directly rather than from // relying on it being a CompileStep. This will make this logic // work even for the edge case that the binary was produced by a