| ... | ... | @@ -572,6 +572,9 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 572 | 572 | try self.populateMissingMetadata(); |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | var lib_not_found = false; |
| 576 | var framework_not_found = false; |
| 577 | |
| 575 | 578 | if (needs_full_relink) { |
| 576 | 579 | for (self.objects.items) |*object| { |
| 577 | 580 | object.free(self.base.allocator, self); |
| ... | ... | @@ -688,7 +691,6 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 688 | 691 | } |
| 689 | 692 | |
| 690 | 693 | var libs = std.ArrayList([]const u8).init(arena); |
| 691 | | var lib_not_found = false; |
| 692 | 694 | for (search_lib_names.items) |lib_name| { |
| 693 | 695 | // Assume ld64 default: -search_paths_first |
| 694 | 696 | // Look in each directory for a dylib (stub first), and then for archive |
| ... | ... | @@ -760,13 +762,14 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 760 | 762 | } |
| 761 | 763 | } else { |
| 762 | 764 | log.warn("framework not found for '-framework {s}'", .{framework}); |
| 763 | | log.warn("Framework search paths:", .{}); |
| 764 | | for (framework_dirs.items) |dir| { |
| 765 | | log.warn(" {s}", .{dir}); |
| 766 | | } else { |
| 767 | | log.warn(" <empty>. Consider specifying --sysroot", .{}); |
| 768 | | } |
| 769 | | return error.FrameworkNotFound; |
| 765 | framework_not_found = true; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | if (framework_not_found) { |
| 770 | log.warn("Framework search paths:", .{}); |
| 771 | for (framework_dirs.items) |dir| { |
| 772 | log.warn(" {s}", .{dir}); |
| 770 | 773 | } |
| 771 | 774 | } |
| 772 | 775 | |
| ... | ... | @@ -926,6 +929,12 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 926 | 929 | if (self.unresolved.count() > 0) { |
| 927 | 930 | return error.UndefinedSymbolReference; |
| 928 | 931 | } |
| 932 | if (lib_not_found) { |
| 933 | return error.LibraryNotFound; |
| 934 | } |
| 935 | if (framework_not_found) { |
| 936 | return error.FrameworkNotFound; |
| 937 | } |
| 929 | 938 | |
| 930 | 939 | try self.createTentativeDefAtoms(); |
| 931 | 940 | try self.parseObjectsIntoAtoms(); |