diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-10-23 16:26:17 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-10-23 16:27:39 -0700 |
| commit | 4bdc2d38717b5655acd862a5762e069419b158c7 (patch) | |
| tree | 99dd968efc3daea52a1d3628b7d8cedba53e84b7 /src/Compilation.zig | |
| parent | 5e11790c7bb05aa929abb8c080c7c7ee9ab09868 (diff) | |
| download | zig-4bdc2d38717b5655acd862a5762e069419b158c7.tar.gz zig-4bdc2d38717b5655acd862a5762e069419b158c7.zip | |
avoid unnecessarily building Scrt1.o when cross-compiling glibc
which, in this branch causes a miscompilation because it would get sent
to the linker.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 3b236f80f0..fac1ad4baa 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1795,10 +1795,12 @@ 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 }); + } try comp.queueJobs(&[_]Job{ - .{ .glibc_crt_file = .scrt1_o }, - .{ .glibc_crt_file = .libc_nonshared_a }, .{ .glibc_shared_objects = {} }, + .{ .glibc_crt_file = .libc_nonshared_a }, }); } else if (target.isWasm() and target.os.tag == .wasi) { if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable; |
