authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-01-13 17:57:56+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-01-13 20:02:11+01:00
log5cde5f947fa12440463f684d9417ac00c8b9790a
tree4cc1ba8e54327060e7009a923e2c79faddf5d29e
parenta8564df9ed510f572732b8179844299fc3d3c11b

Introduce LinkObject with must_link field


7 files changed, 74 insertions(+), 43 deletions(-)

src/Compilation.zig+13-6
...@@ -654,6 +654,11 @@ pub const ClangPreprocessorMode = enum {...@@ -654,6 +654,11 @@ pub const ClangPreprocessorMode = enum {
654pub const SystemLib = link.SystemLib;654pub const SystemLib = link.SystemLib;
655pub const CacheMode = link.CacheMode;655pub const CacheMode = link.CacheMode;
656656
657pub const LinkObject = struct {
658 path: []const u8,
659 must_link: bool = false,
660};
661
657pub const InitOptions = struct {662pub const InitOptions = struct {
658 zig_lib_directory: Directory,663 zig_lib_directory: Directory,
659 local_cache_directory: Directory,664 local_cache_directory: Directory,
...@@ -698,8 +703,7 @@ pub const InitOptions = struct {...@@ -698,8 +703,7 @@ pub const InitOptions = struct {
698 lib_dirs: []const []const u8 = &[0][]const u8{},703 lib_dirs: []const []const u8 = &[0][]const u8{},
699 rpath_list: []const []const u8 = &[0][]const u8{},704 rpath_list: []const []const u8 = &[0][]const u8{},
700 c_source_files: []const CSourceFile = &[0]CSourceFile{},705 c_source_files: []const CSourceFile = &[0]CSourceFile{},
701 link_objects: []const []const u8 = &[0][]const u8{},706 link_objects: []LinkObject = &[0]LinkObject{},
702 must_link_objects: []const []const u8 = &[0][]const u8{},
703 framework_dirs: []const []const u8 = &[0][]const u8{},707 framework_dirs: []const []const u8 = &[0][]const u8{},
704 frameworks: []const []const u8 = &[0][]const u8{},708 frameworks: []const []const u8 = &[0][]const u8{},
705 system_lib_names: []const []const u8 = &.{},709 system_lib_names: []const []const u8 = &.{},
...@@ -1057,7 +1061,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {...@@ -1057,7 +1061,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
1057 if (options.system_lib_names.len != 0)1061 if (options.system_lib_names.len != 0)
1058 break :x true;1062 break :x true;
1059 for (options.link_objects) |obj| {1063 for (options.link_objects) |obj| {
1060 switch (classifyFileExt(obj)) {1064 switch (classifyFileExt(obj.path)) {
1061 .shared_library => break :x true,1065 .shared_library => break :x true,
1062 else => continue,1066 else => continue,
1063 }1067 }
...@@ -1460,7 +1464,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {...@@ -1460,7 +1464,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
1460 if (options.c_source_files.len >= 1) {1464 if (options.c_source_files.len >= 1) {
1461 hash.addBytes(options.c_source_files[0].src_path);1465 hash.addBytes(options.c_source_files[0].src_path);
1462 } else if (options.link_objects.len >= 1) {1466 } else if (options.link_objects.len >= 1) {
1463 hash.addBytes(options.link_objects[0]);1467 hash.addBytes(options.link_objects[0].path);
1464 }1468 }
14651469
1466 const digest = hash.final();1470 const digest = hash.final();
...@@ -1536,7 +1540,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {...@@ -1536,7 +1540,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
1536 .link_libcpp = link_libcpp,1540 .link_libcpp = link_libcpp,
1537 .link_libunwind = link_libunwind,1541 .link_libunwind = link_libunwind,
1538 .objects = options.link_objects,1542 .objects = options.link_objects,
1539 .must_link_objects = options.must_link_objects,
1540 .frameworks = options.frameworks,1543 .frameworks = options.frameworks,
1541 .framework_dirs = options.framework_dirs,1544 .framework_dirs = options.framework_dirs,
1542 .system_libs = system_libs,1545 .system_libs = system_libs,
...@@ -2267,7 +2270,11 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes...@@ -2267,7 +2270,11 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes
22672270
2268 try man.addOptionalFile(comp.bin_file.options.linker_script);2271 try man.addOptionalFile(comp.bin_file.options.linker_script);
2269 try man.addOptionalFile(comp.bin_file.options.version_script);2272 try man.addOptionalFile(comp.bin_file.options.version_script);
2270 try man.addListOfFiles(comp.bin_file.options.objects);2273
2274 for (comp.bin_file.options.objects) |obj| {
2275 _ = try man.addFile(obj.path, null);
2276 man.hash.add(obj.must_link);
2277 }
22712278
2272 for (comp.c_object_table.keys()) |key| {2279 for (comp.c_object_table.keys()) |key| {
2273 _ = try man.addFile(key.src.src_path, null);2280 _ = try man.addFile(key.src.src_path, null);
src/link.zig+7-5
...@@ -155,8 +155,7 @@ pub const Options = struct {...@@ -155,8 +155,7 @@ pub const Options = struct {
155 soname: ?[]const u8,155 soname: ?[]const u8,
156 llvm_cpu_features: ?[*:0]const u8,156 llvm_cpu_features: ?[*:0]const u8,
157157
158 objects: []const []const u8,158 objects: []Compilation.LinkObject,
159 must_link_objects: []const []const u8,
160 framework_dirs: []const []const u8,159 framework_dirs: []const []const u8,
161 frameworks: []const []const u8,160 frameworks: []const []const u8,
162 system_libs: std.StringArrayHashMapUnmanaged(SystemLib),161 system_libs: std.StringArrayHashMapUnmanaged(SystemLib),
...@@ -756,7 +755,10 @@ pub const File = struct {...@@ -756,7 +755,10 @@ pub const File = struct {
756 // We are about to obtain this lock, so here we give other processes a chance first.755 // We are about to obtain this lock, so here we give other processes a chance first.
757 base.releaseLock();756 base.releaseLock();
758757
759 try man.addListOfFiles(base.options.objects);758 for (base.options.objects) |obj| {
759 _ = try man.addFile(obj.path, null);
760 man.hash.add(obj.must_link);
761 }
760 for (comp.c_object_table.keys()) |key| {762 for (comp.c_object_table.keys()) |key| {
761 _ = try man.addFile(key.status.success.object_path, null);763 _ = try man.addFile(key.status.success.object_path, null);
762 }764 }
...@@ -793,8 +795,8 @@ pub const File = struct {...@@ -793,8 +795,8 @@ pub const File = struct {
793 var object_files = try std.ArrayList([*:0]const u8).initCapacity(base.allocator, num_object_files);795 var object_files = try std.ArrayList([*:0]const u8).initCapacity(base.allocator, num_object_files);
794 defer object_files.deinit();796 defer object_files.deinit();
795797
796 for (base.options.objects) |obj_path| {798 for (base.options.objects) |obj| {
797 object_files.appendAssumeCapacity(try arena.dupeZ(u8, obj_path));799 object_files.appendAssumeCapacity(try arena.dupeZ(u8, obj.path));
798 }800 }
799 for (comp.c_object_table.keys()) |key| {801 for (comp.c_object_table.keys()) |key| {
800 object_files.appendAssumeCapacity(try arena.dupeZ(u8, key.status.success.object_path));802 object_files.appendAssumeCapacity(try arena.dupeZ(u8, key.status.success.object_path));
src/link/Coff.zig+9-3
...@@ -943,7 +943,10 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {...@@ -943,7 +943,10 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {
943943
944 comptime assert(Compilation.link_hash_implementation_version == 1);944 comptime assert(Compilation.link_hash_implementation_version == 1);
945945
946 try man.addListOfFiles(self.base.options.objects);946 for (self.base.options.objects) |obj| {
947 _ = try man.addFile(obj.path, null);
948 man.hash.add(obj.must_link);
949 }
947 for (comp.c_object_table.keys()) |key| {950 for (comp.c_object_table.keys()) |key| {
948 _ = try man.addFile(key.status.success.object_path, null);951 _ = try man.addFile(key.status.success.object_path, null);
949 }952 }
...@@ -1005,7 +1008,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {...@@ -1005,7 +1008,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {
1005 // build-obj. See also the corresponding TODO in linkAsArchive.1008 // build-obj. See also the corresponding TODO in linkAsArchive.
1006 const the_object_path = blk: {1009 const the_object_path = blk: {
1007 if (self.base.options.objects.len != 0)1010 if (self.base.options.objects.len != 0)
1008 break :blk self.base.options.objects[0];1011 break :blk self.base.options.objects[0].path;
10091012
1010 if (comp.c_object_table.count() != 0)1013 if (comp.c_object_table.count() != 0)
1011 break :blk comp.c_object_table.keys()[0].status.success.object_path;1014 break :blk comp.c_object_table.keys()[0].status.success.object_path;
...@@ -1110,7 +1113,10 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {...@@ -1110,7 +1113,10 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {
1110 try argv.append(try allocPrint(arena, "-LIBPATH:{s}", .{lib_dir}));1113 try argv.append(try allocPrint(arena, "-LIBPATH:{s}", .{lib_dir}));
1111 }1114 }
11121115
1113 try argv.appendSlice(self.base.options.objects);1116 try argv.ensureUnusedCapacity(self.base.options.objects.len);
1117 for (self.base.options.objects) |obj| {
1118 argv.appendAssumeCapacity(obj.path);
1119 }
11141120
1115 for (comp.c_object_table.keys()) |key| {1121 for (comp.c_object_table.keys()) |key| {
1116 try argv.append(key.status.success.object_path);1122 try argv.append(key.status.success.object_path);
src/link/Elf.zig+9-3
...@@ -1384,7 +1384,10 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {...@@ -1384,7 +1384,10 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
13841384
1385 try man.addOptionalFile(self.base.options.linker_script);1385 try man.addOptionalFile(self.base.options.linker_script);
1386 try man.addOptionalFile(self.base.options.version_script);1386 try man.addOptionalFile(self.base.options.version_script);
1387 try man.addListOfFiles(self.base.options.objects);1387 for (self.base.options.objects) |obj| {
1388 _ = try man.addFile(obj.path, null);
1389 man.hash.add(obj.must_link);
1390 }
1388 for (comp.c_object_table.keys()) |key| {1391 for (comp.c_object_table.keys()) |key| {
1389 _ = try man.addFile(key.status.success.object_path, null);1392 _ = try man.addFile(key.status.success.object_path, null);
1390 }1393 }
...@@ -1469,7 +1472,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {...@@ -1469,7 +1472,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
1469 // build-obj. See also the corresponding TODO in linkAsArchive.1472 // build-obj. See also the corresponding TODO in linkAsArchive.
1470 const the_object_path = blk: {1473 const the_object_path = blk: {
1471 if (self.base.options.objects.len != 0)1474 if (self.base.options.objects.len != 0)
1472 break :blk self.base.options.objects[0];1475 break :blk self.base.options.objects[0].path;
14731476
1474 if (comp.c_object_table.count() != 0)1477 if (comp.c_object_table.count() != 0)
1475 break :blk comp.c_object_table.keys()[0].status.success.object_path;1478 break :blk comp.c_object_table.keys()[0].status.success.object_path;
...@@ -1678,7 +1681,10 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {...@@ -1678,7 +1681,10 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
1678 }1681 }
16791682
1680 // Positional arguments to the linker such as object files.1683 // Positional arguments to the linker such as object files.
1681 try argv.appendSlice(self.base.options.objects);1684 try argv.ensureUnusedCapacity(self.base.options.objects.len);
1685 for (self.base.options.objects) |obj| {
1686 argv.appendAssumeCapacity(obj.path);
1687 }
16821688
1683 for (comp.c_object_table.keys()) |key| {1689 for (comp.c_object_table.keys()) |key| {
1684 try argv.append(key.status.success.object_path);1690 try argv.append(key.status.success.object_path);
src/link/MachO.zig+18-13
...@@ -499,7 +499,10 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {...@@ -499,7 +499,10 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {
499499
500 comptime assert(Compilation.link_hash_implementation_version == 1);500 comptime assert(Compilation.link_hash_implementation_version == 1);
501501
502 try man.addListOfFiles(self.base.options.objects);502 for (self.base.options.objects) |obj| {
503 _ = try man.addFile(obj.path, null);
504 man.hash.add(obj.must_link);
505 }
503 for (comp.c_object_table.keys()) |key| {506 for (comp.c_object_table.keys()) |key| {
504 _ = try man.addFile(key.status.success.object_path, null);507 _ = try man.addFile(key.status.success.object_path, null);
505 }508 }
...@@ -571,8 +574,9 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {...@@ -571,8 +574,9 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {
571 // here. TODO: think carefully about how we can avoid this redundant operation when doing574 // here. TODO: think carefully about how we can avoid this redundant operation when doing
572 // build-obj. See also the corresponding TODO in linkAsArchive.575 // build-obj. See also the corresponding TODO in linkAsArchive.
573 const the_object_path = blk: {576 const the_object_path = blk: {
574 if (self.base.options.objects.len != 0)577 if (self.base.options.objects.len != 0) {
575 break :blk self.base.options.objects[0];578 break :blk self.base.options.objects[0].path;
579 }
576580
577 if (comp.c_object_table.count() != 0)581 if (comp.c_object_table.count() != 0)
578 break :blk comp.c_object_table.keys()[0].status.success.object_path;582 break :blk comp.c_object_table.keys()[0].status.success.object_path;
...@@ -679,19 +683,20 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {...@@ -679,19 +683,20 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {
679 // the relocatable object files.683 // the relocatable object files.
680 self.invalidate_relocs = true;684 self.invalidate_relocs = true;
681685
682 // Unpack must-link archives
683 var must_link_archives = std.StringArrayHashMap(void).init(arena);
684 try must_link_archives.ensureTotalCapacity(@intCast(u32, self.base.options.must_link_objects.len));
685 for (self.base.options.must_link_objects) |lib| {
686 _ = must_link_archives.getOrPutAssumeCapacity(lib);
687 }
688
689 // Positional arguments to the linker such as object files and static archives.686 // Positional arguments to the linker such as object files and static archives.
690 var positionals = std.ArrayList([]const u8).init(arena);687 var positionals = std.ArrayList([]const u8).init(arena);
691 try positionals.ensureUnusedCapacity(self.base.options.objects.len);688 try positionals.ensureUnusedCapacity(self.base.options.objects.len);
689
690 var must_link_archives = std.StringArrayHashMap(void).init(arena);
691 try must_link_archives.ensureUnusedCapacity(self.base.options.objects.len);
692
692 for (self.base.options.objects) |obj| {693 for (self.base.options.objects) |obj| {
693 if (must_link_archives.contains(obj)) continue;694 if (must_link_archives.contains(obj.path)) continue;
694 _ = positionals.appendAssumeCapacity(obj);695 if (obj.must_link) {
696 _ = must_link_archives.getOrPutAssumeCapacity(obj.path);
697 } else {
698 _ = positionals.appendAssumeCapacity(obj.path);
699 }
695 }700 }
696701
697 for (comp.c_object_table.keys()) |key| {702 for (comp.c_object_table.keys()) |key| {
...@@ -899,7 +904,7 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {...@@ -899,7 +904,7 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {
899 try argv.append("dynamic_lookup");904 try argv.append("dynamic_lookup");
900 }905 }
901906
902 for (self.base.options.must_link_objects) |lib| {907 for (must_link_archives.keys()) |lib| {
903 try argv.append(try std.fmt.allocPrint(arena, "-force_load {s}", .{lib}));908 try argv.append(try std.fmt.allocPrint(arena, "-force_load {s}", .{lib}));
904 }909 }
905910
src/link/Wasm.zig+9-3
...@@ -1128,7 +1128,10 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {...@@ -1128,7 +1128,10 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
11281128
1129 comptime assert(Compilation.link_hash_implementation_version == 1);1129 comptime assert(Compilation.link_hash_implementation_version == 1);
11301130
1131 try man.addListOfFiles(self.base.options.objects);1131 for (self.base.options.objects) |obj| {
1132 _ = try man.addFile(obj.path, null);
1133 man.hash.add(obj.must_link);
1134 }
1132 for (comp.c_object_table.keys()) |key| {1135 for (comp.c_object_table.keys()) |key| {
1133 _ = try man.addFile(key.status.success.object_path, null);1136 _ = try man.addFile(key.status.success.object_path, null);
1134 }1137 }
...@@ -1181,7 +1184,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {...@@ -1181,7 +1184,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
1181 // build-obj. See also the corresponding TODO in linkAsArchive.1184 // build-obj. See also the corresponding TODO in linkAsArchive.
1182 const the_object_path = blk: {1185 const the_object_path = blk: {
1183 if (self.base.options.objects.len != 0)1186 if (self.base.options.objects.len != 0)
1184 break :blk self.base.options.objects[0];1187 break :blk self.base.options.objects[0].path;
11851188
1186 if (comp.c_object_table.count() != 0)1189 if (comp.c_object_table.count() != 0)
1187 break :blk comp.c_object_table.keys()[0].status.success.object_path;1190 break :blk comp.c_object_table.keys()[0].status.success.object_path;
...@@ -1346,7 +1349,10 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {...@@ -1346,7 +1349,10 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
1346 }1349 }
13471350
1348 // Positional arguments to the linker such as object files.1351 // Positional arguments to the linker such as object files.
1349 try argv.appendSlice(self.base.options.objects);1352 try argv.ensureUnusedCapacity(self.base.options.objects.len);
1353 for (self.base.options.objects) |obj| {
1354 argv.appendAssumeCapacity(obj.path);
1355 }
13501356
1351 for (comp.c_object_table.keys()) |key| {1357 for (comp.c_object_table.keys()) |key| {
1352 try argv.append(key.status.success.object_path);1358 try argv.append(key.status.success.object_path);
src/main.zig+9-10
...@@ -705,12 +705,9 @@ fn buildOutputType(...@@ -705,12 +705,9 @@ fn buildOutputType(
705 var c_source_files = std.ArrayList(Compilation.CSourceFile).init(gpa);705 var c_source_files = std.ArrayList(Compilation.CSourceFile).init(gpa);
706 defer c_source_files.deinit();706 defer c_source_files.deinit();
707707
708 var link_objects = std.ArrayList([]const u8).init(gpa);708 var link_objects = std.ArrayList(Compilation.LinkObject).init(gpa);
709 defer link_objects.deinit();709 defer link_objects.deinit();
710710
711 var must_link_objects = std.ArrayList([]const u8).init(gpa);
712 defer must_link_objects.deinit();
713
714 var framework_dirs = std.ArrayList([]const u8).init(gpa);711 var framework_dirs = std.ArrayList([]const u8).init(gpa);
715 defer framework_dirs.deinit();712 defer framework_dirs.deinit();
716713
...@@ -1241,7 +1238,7 @@ fn buildOutputType(...@@ -1241,7 +1238,7 @@ fn buildOutputType(
1241 }1238 }
1242 } else switch (Compilation.classifyFileExt(arg)) {1239 } else switch (Compilation.classifyFileExt(arg)) {
1243 .object, .static_library, .shared_library => {1240 .object, .static_library, .shared_library => {
1244 try link_objects.append(arg);1241 try link_objects.append(.{ .path = arg });
1245 },1242 },
1246 .assembly, .c, .cpp, .h, .ll, .bc, .m, .mm => {1243 .assembly, .c, .cpp, .h, .ll, .bc, .m, .mm => {
1247 try c_source_files.append(.{1244 try c_source_files.append(.{
...@@ -1312,7 +1309,7 @@ fn buildOutputType(...@@ -1312,7 +1309,7 @@ fn buildOutputType(
1312 switch (file_ext) {1309 switch (file_ext) {
1313 .assembly, .c, .cpp, .ll, .bc, .h, .m, .mm => try c_source_files.append(.{ .src_path = it.only_arg }),1310 .assembly, .c, .cpp, .ll, .bc, .h, .m, .mm => try c_source_files.append(.{ .src_path = it.only_arg }),
1314 .unknown, .shared_library, .object, .static_library => {1311 .unknown, .shared_library, .object, .static_library => {
1315 try link_objects.append(it.only_arg);1312 try link_objects.append(.{ .path = it.only_arg });
1316 },1313 },
1317 .zig => {1314 .zig => {
1318 if (root_src_file) |other| {1315 if (root_src_file) |other| {
...@@ -1756,7 +1753,10 @@ fn buildOutputType(...@@ -1756,7 +1753,10 @@ fn buildOutputType(
1756 if (i >= linker_args.items.len) {1753 if (i >= linker_args.items.len) {
1757 fatal("expected linker arg after '{s}'", .{arg});1754 fatal("expected linker arg after '{s}'", .{arg});
1758 }1755 }
1759 try must_link_objects.append(linker_args.items[i]);1756 try link_objects.append(.{
1757 .path = linker_args.items[i],
1758 .must_link = true,
1759 });
1760 } else {1760 } else {
1761 warn("unsupported linker arg: {s}", .{arg});1761 warn("unsupported linker arg: {s}", .{arg});
1762 }1762 }
...@@ -1851,7 +1851,7 @@ fn buildOutputType(...@@ -1851,7 +1851,7 @@ fn buildOutputType(
1851 const basename = fs.path.basename(c_source_files.items[0].src_path);1851 const basename = fs.path.basename(c_source_files.items[0].src_path);
1852 break :blk basename[0 .. basename.len - fs.path.extension(basename).len];1852 break :blk basename[0 .. basename.len - fs.path.extension(basename).len];
1853 } else if (link_objects.items.len >= 1) {1853 } else if (link_objects.items.len >= 1) {
1854 const basename = fs.path.basename(link_objects.items[0]);1854 const basename = fs.path.basename(link_objects.items[0].path);
1855 break :blk basename[0 .. basename.len - fs.path.extension(basename).len];1855 break :blk basename[0 .. basename.len - fs.path.extension(basename).len];
1856 } else if (emit_bin == .yes) {1856 } else if (emit_bin == .yes) {
1857 const basename = fs.path.basename(emit_bin.yes);1857 const basename = fs.path.basename(emit_bin.yes);
...@@ -2054,7 +2054,7 @@ fn buildOutputType(...@@ -2054,7 +2054,7 @@ fn buildOutputType(
2054 test_path.items, @errorName(e),2054 test_path.items, @errorName(e),
2055 }),2055 }),
2056 };2056 };
2057 try link_objects.append(try arena.dupe(u8, test_path.items));2057 try link_objects.append(.{ .path = try arena.dupe(u8, test_path.items) });
2058 break;2058 break;
2059 } else {2059 } else {
2060 var search_paths = std.ArrayList(u8).init(arena);2060 var search_paths = std.ArrayList(u8).init(arena);
...@@ -2447,7 +2447,6 @@ fn buildOutputType(...@@ -2447,7 +2447,6 @@ fn buildOutputType(
2447 .rpath_list = rpath_list.items,2447 .rpath_list = rpath_list.items,
2448 .c_source_files = c_source_files.items,2448 .c_source_files = c_source_files.items,
2449 .link_objects = link_objects.items,2449 .link_objects = link_objects.items,
2450 .must_link_objects = must_link_objects.items,
2451 .framework_dirs = framework_dirs.items,2450 .framework_dirs = framework_dirs.items,
2452 .frameworks = frameworks.items,2451 .frameworks = frameworks.items,
2453 .system_lib_names = system_libs.keys(),2452 .system_lib_names = system_libs.keys(),