| ... | @@ -572,6 +572,9 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { | ... | @@ -572,6 +572,9 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 572 | try self.populateMissingMetadata(); | 572 | try self.populateMissingMetadata(); |
| 573 | } | 573 | } |
| 574 | | 574 | |
| | 575 | var lib_not_found = false; |
| | 576 | var framework_not_found = false; |
| | 577 | |
| 575 | if (needs_full_relink) { | 578 | if (needs_full_relink) { |
| 576 | for (self.objects.items) |*object| { | 579 | for (self.objects.items) |*object| { |
| 577 | object.free(self.base.allocator, self); | 580 | object.free(self.base.allocator, self); |
| ... | @@ -688,7 +691,6 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { | ... | @@ -688,7 +691,6 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 688 | } | 691 | } |
| 689 | | 692 | |
| 690 | var libs = std.ArrayList([]const u8).init(arena); | 693 | var libs = std.ArrayList([]const u8).init(arena); |
| 691 | var lib_not_found = false; | | |
| 692 | for (search_lib_names.items) |lib_name| { | 694 | for (search_lib_names.items) |lib_name| { |
| 693 | // Assume ld64 default: -search_paths_first | 695 | // Assume ld64 default: -search_paths_first |
| 694 | // Look in each directory for a dylib (stub first), and then for archive | 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,7 +754,6 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 752 | } | 754 | } |
| 753 | } | 755 | } |
| 754 | | 756 | |
| 755 | var framework_not_found = false; | | |
| 756 | for (self.base.options.frameworks) |framework| { | 757 | for (self.base.options.frameworks) |framework| { |
| 757 | for (&[_][]const u8{ ".tbd", ".dylib", "" }) |ext| { | 758 | for (&[_][]const u8{ ".tbd", ".dylib", "" }) |ext| { |
| 758 | if (try resolveFramework(arena, framework_dirs.items, framework, ext)) |full_path| { | 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,6 +929,12 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 928 | if (self.unresolved.count() > 0) { | 929 | if (self.unresolved.count() > 0) { |
| 929 | return error.UndefinedSymbolReference; | 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 | try self.createTentativeDefAtoms(); | 939 | try self.createTentativeDefAtoms(); |
| 933 | try self.parseObjectsIntoAtoms(); | 940 | try self.parseObjectsIntoAtoms(); |