| ... | ... | @@ -681,12 +681,15 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 681 | 681 | var positionals = std.ArrayList([]const u8).init(arena); |
| 682 | 682 | |
| 683 | 683 | try positionals.appendSlice(self.base.options.objects); |
| 684 | |
| 684 | 685 | for (comp.c_object_table.items()) |entry| { |
| 685 | 686 | try positionals.append(entry.key.status.success.object_path); |
| 686 | 687 | } |
| 688 | |
| 687 | 689 | if (module_obj_path) |p| { |
| 688 | 690 | try positionals.append(p); |
| 689 | 691 | } |
| 692 | |
| 690 | 693 | try positionals.append(comp.compiler_rt_static_lib.?.full_object_path); |
| 691 | 694 | |
| 692 | 695 | // libc++ dep |
| ... | ... | @@ -705,7 +708,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 705 | 708 | // By this time, we depend on these libs being dynamically linked libraries and not static libraries |
| 706 | 709 | // (the check for that needs to be earlier), but they could be full paths to .dylib files, in which |
| 707 | 710 | // 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. |
| 709 | 712 | if (Compilation.classifyFileExt(link_lib) == .shared_library) { |
| 710 | 713 | try shared_libs.append(link_lib); |
| 711 | 714 | continue; |
| ... | ... | @@ -764,6 +767,8 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 764 | 767 | var found = false; |
| 765 | 768 | for (search_lib_dirs.items) |lib_dir| { |
| 766 | 769 | const full_path = try fs.path.join(arena, &[_][]const u8{ lib_dir, l_name_ext }); |
| 770 | |
| 771 | // Check if the dylib file exists. |
| 767 | 772 | const tmp = fs.cwd().openFile(full_path, .{}) catch |err| switch (err) { |
| 768 | 773 | error.FileNotFound => continue, |
| 769 | 774 | else => |e| return e, |
| ... | ... | @@ -776,7 +781,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 776 | 781 | } |
| 777 | 782 | |
| 778 | 783 | if (!found) { |
| 779 | | log.warn("library '-l{s}' not found", .{l_name}); |
| 784 | log.warn("library not found for '-l{s}'", .{l_name}); |
| 780 | 785 | log.warn("Library search paths:", .{}); |
| 781 | 786 | for (search_lib_dirs.items) |lib_dir| { |
| 782 | 787 | log.warn(" {s}", .{lib_dir}); |