| ... | @@ -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 |
| ... | @@ -760,13 +762,14 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { | ... | @@ -760,13 +762,14 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 760 | } | 762 | } |
| 761 | } else { | 763 | } else { |
| 762 | log.warn("framework not found for '-framework {s}'", .{framework}); | 764 | log.warn("framework not found for '-framework {s}'", .{framework}); |
| 763 | log.warn("Framework search paths:", .{}); | 765 | framework_not_found = true; |
| 764 | for (framework_dirs.items) |dir| { | 766 | } |
| 765 | log.warn(" {s}", .{dir}); | 767 | } |
| 766 | } else { | 768 | |
| 767 | log.warn(" <empty>. Consider specifying --sysroot", .{}); | 769 | if (framework_not_found) { |
| 768 | } | 770 | log.warn("Framework search paths:", .{}); |
| 769 | return error.FrameworkNotFound; | 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,6 +929,12 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 926 | if (self.unresolved.count() > 0) { | 929 | if (self.unresolved.count() > 0) { |
| 927 | return error.UndefinedSymbolReference; | 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 | try self.createTentativeDefAtoms(); | 939 | try self.createTentativeDefAtoms(); |
| 931 | try self.parseObjectsIntoAtoms(); | 940 | try self.parseObjectsIntoAtoms(); |