stage2: loading glibc metadata
This commit is contained in:
@@ -1256,6 +1256,14 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Module {
|
||||
mod.c_object_table.putAssumeCapacityNoClobber(c_object, {});
|
||||
}
|
||||
|
||||
// If we need to build glibc for the target, add work items for it.
|
||||
if (mod.bin_file.options.link_libc and
|
||||
mod.bin_file.options.libc_installation == null and
|
||||
mod.bin_file.options.target.isGnuLibC())
|
||||
{
|
||||
try mod.addBuildingGLibCWorkItems();
|
||||
}
|
||||
|
||||
return mod;
|
||||
}
|
||||
|
||||
@@ -4495,3 +4503,8 @@ pub fn get_libc_crt_file(mod: *Module, arena: *Allocator, basename: []const u8)
|
||||
const full_path = try std.fs.path.join(arena, &[_][]const u8{ crt_dir_path, basename });
|
||||
return full_path;
|
||||
}
|
||||
|
||||
fn addBuildingGLibCWorkItems(mod: *Module) !void {
|
||||
// crti.o, crtn.o, start.os, abi-note.o, Scrt1.o, libc_nonshared.a
|
||||
try mod.work_queue.ensureUnusedCapacity(6);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user