| ... | ... | @@ -1217,6 +1217,8 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1217 | 1217 | Compilation.dump_argv(argv.items); |
| 1218 | 1218 | } |
| 1219 | 1219 | |
| 1220 | if (self.zigObjectPtr()) |zig_object| try zig_object.flushModule(self); |
| 1221 | |
| 1220 | 1222 | // Here we will parse input positional and library files (if referenced). |
| 1221 | 1223 | // This will roughly match in any linker backend we support. |
| 1222 | 1224 | var positionals = std.ArrayList(Compilation.LinkObject).init(arena); |
| ... | ... | @@ -1284,6 +1286,8 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1284 | 1286 | try positionals.append(.{ .path = ssp.full_object_path }); |
| 1285 | 1287 | } |
| 1286 | 1288 | |
| 1289 | if (self.isStaticLib()) return self.flushStaticLib(comp, positionals.items); |
| 1290 | |
| 1287 | 1291 | for (positionals.items) |obj| { |
| 1288 | 1292 | var parse_ctx: ParseErrorCtx = .{ .detected_cpu_arch = undefined }; |
| 1289 | 1293 | self.parsePositional(obj.path, obj.must_link, &parse_ctx) catch |err| |
| ... | ... | @@ -1383,9 +1387,6 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1383 | 1387 | if (csu.crtend) |v| try positionals.append(.{ .path = v }); |
| 1384 | 1388 | if (csu.crtn) |v| try positionals.append(.{ .path = v }); |
| 1385 | 1389 | |
| 1386 | | if (self.zigObjectPtr()) |zig_object| try zig_object.flushModule(self); |
| 1387 | | if (self.isStaticLib()) return self.flushStaticLib(comp, positionals.items); |
| 1388 | | |
| 1389 | 1390 | for (positionals.items) |obj| { |
| 1390 | 1391 | var parse_ctx: ParseErrorCtx = .{ .detected_cpu_arch = undefined }; |
| 1391 | 1392 | self.parsePositional(obj.path, obj.must_link, &parse_ctx) catch |err| |
| ... | ... | @@ -1531,6 +1532,7 @@ pub fn flushStaticLib( |
| 1531 | 1532 | var err = try self.addErrorWithNotes(1); |
| 1532 | 1533 | try err.addMsg(self, "fatal linker error: too many input positionals", .{}); |
| 1533 | 1534 | try err.addNote(self, "TODO implement linking objects into an static library", .{}); |
| 1535 | return; |
| 1534 | 1536 | } |
| 1535 | 1537 | const gpa = self.base.allocator; |
| 1536 | 1538 | |
| ... | ... | @@ -1636,6 +1638,7 @@ pub fn flushObject(self: *Elf, comp: *Compilation) link.File.FlushError!void { |
| 1636 | 1638 | var err = try self.addErrorWithNotes(1); |
| 1637 | 1639 | try err.addMsg(self, "fatal linker error: too many input positionals", .{}); |
| 1638 | 1640 | try err.addNote(self, "TODO implement '-r' option", .{}); |
| 1641 | return; |
| 1639 | 1642 | } |
| 1640 | 1643 | |
| 1641 | 1644 | self.claimUnresolvedObject(); |