| ... | ... | @@ -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 |
| ... | ... | @@ -752,7 +754,6 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 752 | 754 | } |
| 753 | 755 | } |
| 754 | 756 | |
| 755 | | var framework_not_found = false; |
| 756 | 757 | for (self.base.options.frameworks) |framework| { |
| 757 | 758 | for (&[_][]const u8{ ".tbd", ".dylib", "" }) |ext| { |
| 758 | 759 | if (try resolveFramework(arena, framework_dirs.items, framework, ext)) |full_path| { |
| ... | ... | @@ -928,6 +929,12 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 928 | 929 | if (self.unresolved.count() > 0) { |
| 929 | 930 | return error.UndefinedSymbolReference; |
| 930 | 931 | } |
| 932 | if (lib_not_found) { |
| 933 | return error.LibraryNotFound; |
| 934 | } |
| 935 | if (framework_not_found) { |
| 936 | return error.FrameworkNotFound; |
| 937 | } |
| 931 | 938 | |
| 932 | 939 | try self.createTentativeDefAtoms(); |
| 933 | 940 | try self.parseObjectsIntoAtoms(); |