From 3a2647b7d3b68fe32bab488f1fa8eaa1ec57f31a Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Sat, 2 Nov 2024 11:58:23 +0100 Subject: glibc: Don't build CRT objects that won't be used. --- src/Compilation.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 6d7097e5fa..51877d7973 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1795,8 +1795,8 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil .{ .glibc_crt_file = .crtn_o }, }); } - if (!is_dyn_lib) { - try comp.queueJob(.{ .glibc_crt_file = .scrt1_o }); + if (glibc.needsCrt0(comp.config.output_mode)) |f| { + try comp.queueJobs(&.{.{ .glibc_crt_file = f }}); } try comp.queueJobs(&[_]Job{ .{ .glibc_shared_objects = {} }, -- cgit v1.2.3