From 09b46198ff8d64c9884a0cf13788855b4d4bbe2d Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sun, 20 Jun 2021 10:14:18 +0200 Subject: zld: move logic unpacking path to libc stub to Compilation --- src/link/MachO.zig | 4 +--- src/link/MachO/Zld.zig | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/link') diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 76b59e896b..89e0c9a84a 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -848,9 +848,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { try zld.link(positionals.items, full_out_path, .{ .libs = libs.items, .rpaths = rpaths.items, - .lib_system_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{ - "libc", "darwin", "libSystem.B.tbd", - }), + .libc_stub_path = self.base.options.libc_stub_path.?, }); break :outer; diff --git a/src/link/MachO/Zld.zig b/src/link/MachO/Zld.zig index 6945b00179..564da387c3 100644 --- a/src/link/MachO/Zld.zig +++ b/src/link/MachO/Zld.zig @@ -181,7 +181,7 @@ pub fn closeFiles(self: Zld) void { const LinkArgs = struct { libs: []const []const u8, rpaths: []const []const u8, - lib_system_path: []const u8, + libc_stub_path: []const u8, }; pub fn link(self: *Zld, files: []const []const u8, out_path: []const u8, args: LinkArgs) !void { @@ -223,7 +223,7 @@ pub fn link(self: *Zld, files: []const []const u8, out_path: []const u8, args: L try self.addRpaths(args.rpaths); try self.parseInputFiles(files); try self.parseLibs(args.libs); - try self.parseLibSystem(args.lib_system_path); + try self.parseLibSystem(args.libc_stub_path); try self.resolveSymbols(); try self.resolveStubsAndGotEntries(); try self.updateMetadata(); -- cgit v1.2.3