From d589047e80133c5f673a7d40dd1cfa50258dcc4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 23 Jun 2022 09:19:53 +0300 Subject: [PATCH] zld: ignore -search_paths_first Ignore MachO-specific flag -search_paths_first, since it is the default in zld and ld64. Also see Jakub's comment[1]: Changing topic slightly, @motiejus dunno if you noticed, with this change building arm64 Zig binary fails on macos - it complains about unknown -search_paths_first flag. This one is an easy fix: we should ignore it since this is the default behaviour in both ld64 and zld. [1]: https://github.com/ziglang/zig/pull/11906#issuecomment-1163545849 --- src/main.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.zig b/src/main.zig index 6942d0ba49..b2b795d25f 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1475,6 +1475,8 @@ fn buildOutputType( mem.eql(u8, linker_arg, "-static")) { force_static_libs = true; + } else if (mem.eql(u8, linker_arg, "-search_paths_first")) { + // ignore, since it's the default behavior in both ld64 and zld } else { try linker_args.append(linker_arg); }