authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-06-15 11:48:19+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-06-15 11:52:03+02:00
log82047633281252aed14b44831e8920950f8c7dd6
treecbab39e7bcb541b2028ef7a4a26b0a317a7080e0
parent2034ca82b474b34aaca57d49b1cff38a9f4ec9a5

zld: use ld64 defaults for searching system libs

By default, `ld64` uses `-search_paths_first` which firstly tries to find a dylib, followed by an archive in each directory.

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

src/link/MachO.zig+4-3
......@@ -758,10 +758,11 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
758758 }
759759 }
760760
761 // Search for static libraries first, then dynamic libraries.
762 // TODO Respect flags such as -search_paths_first to the linker.
761 // Assume ld64 default: -search_paths_first
762 // Look in each directory for a dylib (tbd), and then for archive
763 // TODO implement alternative: -search_dylibs_first
763764 // TODO text-based API, or .tbd files.
764 const exts = &[_][]const u8{ "a", "dylib" };
765 const exts = &[_][]const u8{ "dylib", "a" };
765766
766767 for (search_lib_names.items) |l_name| {
767768 var found = false;