aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index d87ad78a71..236a344027 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1586,7 +1586,17 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
// If we need to build glibc for the target, add work items for it.
// We go through the work queue so that building can be done in parallel.
if (comp.wantBuildGLibCFromSource()) {
- try comp.addBuildingGLibCJobs();
+ if (glibc.needsCrtiCrtn(comp.getTarget())) {
+ try comp.work_queue.write(&[_]Job{
+ .{ .glibc_crt_file = .crti_o },
+ .{ .glibc_crt_file = .crtn_o },
+ });
+ }
+ try comp.work_queue.write(&[_]Job{
+ .{ .glibc_crt_file = .scrt1_o },
+ .{ .glibc_crt_file = .libc_nonshared_a },
+ .{ .glibc_shared_objects = {} },
+ });
}
if (comp.wantBuildMuslFromSource()) {
try comp.work_queue.ensureUnusedCapacity(6);
@@ -4046,16 +4056,6 @@ pub fn get_libc_crt_file(comp: *Compilation, arena: Allocator, basename: []const
return full_path;
}
-fn addBuildingGLibCJobs(comp: *Compilation) !void {
- try comp.work_queue.write(&[_]Job{
- .{ .glibc_crt_file = .crti_o },
- .{ .glibc_crt_file = .crtn_o },
- .{ .glibc_crt_file = .scrt1_o },
- .{ .glibc_crt_file = .libc_nonshared_a },
- .{ .glibc_shared_objects = {} },
- });
-}
-
fn wantBuildLibCFromSource(comp: Compilation) bool {
const is_exe_or_dyn_lib = switch (comp.bin_file.options.output_mode) {
.Obj => false,