authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-18 09:27:41+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-18 09:28:00+02:00
logcb45c5521ab5360e2b8c5d1ce16d351d526a3fe5
tree5f2a7bf072f90ee1e95e508307642a97a9e172c0
parentdaaec68aec6e78999a0066621dfd382025505918

zld: refactor warnings


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

src/link/MachO.zig+7-2
......@@ -681,12 +681,15 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
681681 var positionals = std.ArrayList([]const u8).init(arena);
682682
683683 try positionals.appendSlice(self.base.options.objects);
684
684685 for (comp.c_object_table.items()) |entry| {
685686 try positionals.append(entry.key.status.success.object_path);
686687 }
688
687689 if (module_obj_path) |p| {
688690 try positionals.append(p);
689691 }
692
690693 try positionals.append(comp.compiler_rt_static_lib.?.full_object_path);
691694
692695 // libc++ dep
......@@ -705,7 +708,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
705708 // By this time, we depend on these libs being dynamically linked libraries and not static libraries
706709 // (the check for that needs to be earlier), but they could be full paths to .dylib files, in which
707710 // case we want to avoid prepending "-l".
708 // TODO I think then they should go as an input file instead of via shared_libs.
711 // TODO I think they should go as an input file instead of via shared_libs.
709712 if (Compilation.classifyFileExt(link_lib) == .shared_library) {
710713 try shared_libs.append(link_lib);
711714 continue;
......@@ -764,6 +767,8 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
764767 var found = false;
765768 for (search_lib_dirs.items) |lib_dir| {
766769 const full_path = try fs.path.join(arena, &[_][]const u8{ lib_dir, l_name_ext });
770
771 // Check if the dylib file exists.
767772 const tmp = fs.cwd().openFile(full_path, .{}) catch |err| switch (err) {
768773 error.FileNotFound => continue,
769774 else => |e| return e,
......@@ -776,7 +781,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
776781 }
777782
778783 if (!found) {
779 log.warn("library '-l{s}' not found", .{l_name});
784 log.warn("library not found for '-l{s}'", .{l_name});
780785 log.warn("Library search paths:", .{});
781786 for (search_lib_dirs.items) |lib_dir| {
782787 log.warn(" {s}", .{lib_dir});