elf: include C compilation artifacts on the linker line

This commit is contained in:
Jakub Konka
2023-09-12 19:26:51 +02:00
parent ae74a36af0
commit 9719fa7412

View File

@@ -998,7 +998,16 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node
_ = compiler_rt_path;
// Parse input files
for (self.base.options.objects) |obj| {
var positionals = std.ArrayList(Compilation.LinkObject).init(gpa);
defer positionals.deinit();
try positionals.ensureUnusedCapacity(self.base.options.objects.len);
positionals.appendSliceAssumeCapacity(self.base.options.objects);
for (comp.c_object_table.keys()) |key| {
try positionals.append(.{ .path = key.status.success.object_path });
}
for (positionals.items) |obj| {
const in_file = try std.fs.cwd().openFile(obj.path, .{});
defer in_file.close();