| ... | ... | @@ -1384,7 +1384,7 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1384 | 1384 | if (csu.crtn) |v| try positionals.append(.{ .path = v }); |
| 1385 | 1385 | |
| 1386 | 1386 | if (self.zigObjectPtr()) |zig_object| try zig_object.flushModule(self); |
| 1387 | | if (self.isStaticLib()) return self.flushStaticLib(comp); |
| 1387 | if (self.isStaticLib()) return self.flushStaticLib(comp, positionals.items); |
| 1388 | 1388 | |
| 1389 | 1389 | for (positionals.items) |obj| { |
| 1390 | 1390 | var parse_ctx: ParseErrorCtx = .{ .detected_cpu_arch = undefined }; |
| ... | ... | @@ -1521,8 +1521,17 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1521 | 1521 | } |
| 1522 | 1522 | } |
| 1523 | 1523 | |
| 1524 | | pub fn flushStaticLib(self: *Elf, comp: *Compilation) link.File.FlushError!void { |
| 1524 | pub fn flushStaticLib( |
| 1525 | self: *Elf, |
| 1526 | comp: *Compilation, |
| 1527 | positionals: []const Compilation.LinkObject, |
| 1528 | ) link.File.FlushError!void { |
| 1525 | 1529 | _ = comp; |
| 1530 | if (positionals.len > 0) { |
| 1531 | var err = try self.addErrorWithNotes(1); |
| 1532 | try err.addMsg(self, "fatal linker error: too many input positionals", .{}); |
| 1533 | try err.addNote(self, "TODO implement linking objects into an static library", .{}); |
| 1534 | } |
| 1526 | 1535 | const gpa = self.base.allocator; |
| 1527 | 1536 | |
| 1528 | 1537 | // First, we flush relocatable object file generated with our backends. |
| ... | ... | @@ -1622,6 +1631,13 @@ pub fn flushStaticLib(self: *Elf, comp: *Compilation) link.File.FlushError!void |
| 1622 | 1631 | |
| 1623 | 1632 | pub fn flushObject(self: *Elf, comp: *Compilation) link.File.FlushError!void { |
| 1624 | 1633 | _ = comp; |
| 1634 | |
| 1635 | if (self.objects.items.len > 0) { |
| 1636 | var err = try self.addErrorWithNotes(1); |
| 1637 | try err.addMsg(self, "fatal linker error: too many input positionals", .{}); |
| 1638 | try err.addNote(self, "TODO implement '-r' option", .{}); |
| 1639 | } |
| 1640 | |
| 1625 | 1641 | self.claimUnresolvedObject(); |
| 1626 | 1642 | |
| 1627 | 1643 | try self.initSections(); |