authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-23 16:26:17-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-23 16:27:39-07:00
log4bdc2d38717b5655acd862a5762e069419b158c7
tree99dd968efc3daea52a1d3628b7d8cedba53e84b7
parent5e11790c7bb05aa929abb8c080c7c7ee9ab09868

avoid unnecessarily building Scrt1.o when cross-compiling glibc

which, in this branch causes a miscompilation because it would get sent to the linker.

1 files changed, 4 insertions(+), 2 deletions(-)

src/Compilation.zig+4-2
...@@ -1795,10 +1795,12 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil...@@ -1795,10 +1795,12 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
1795 .{ .glibc_crt_file = .crtn_o },1795 .{ .glibc_crt_file = .crtn_o },
1796 });1796 });
1797 }1797 }
1798 if (!is_dyn_lib) {
1799 try comp.queueJob(.{ .glibc_crt_file = .scrt1_o });
1800 }
1798 try comp.queueJobs(&[_]Job{1801 try comp.queueJobs(&[_]Job{
1799 .{ .glibc_crt_file = .scrt1_o },
1800 .{ .glibc_crt_file = .libc_nonshared_a },
1801 .{ .glibc_shared_objects = {} },1802 .{ .glibc_shared_objects = {} },
1803 .{ .glibc_crt_file = .libc_nonshared_a },
1802 });1804 });
1803 } else if (target.isWasm() and target.os.tag == .wasi) {1805 } else if (target.isWasm() and target.os.tag == .wasi) {
1804 if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable;1806 if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable;