authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-29 01:28:48-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-29 01:30:35-07:00
log3efdd7b2ad6cce5985d761240636b3d5eb3b4c84
tree130330bddb26b0d4f4f7d39a250552220294f955
parentd3a99c7bd5396f2e458d844368ce2743934e43e2

don't try to build musl crti.o crtn.o when it's not needed

such as on RISC-V

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

BRANCH_TODO+1-1
...@@ -1,3 +1,3 @@...@@ -1,3 +1,3 @@
1 * building risc-v musl regression1 * wasi behavior tests failing
2 * go ahead and use allocSentinel now that the stage1 bug is fixed2 * go ahead and use allocSentinel now that the stage1 bug is fixed
3 * audit the base cache hash3 * audit the base cache hash
src/Compilation.zig+8-3
...@@ -855,9 +855,14 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {...@@ -855,9 +855,14 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
855 try comp.addBuildingGLibCJobs();855 try comp.addBuildingGLibCJobs();
856 }856 }
857 if (comp.wantBuildMuslFromSource()) {857 if (comp.wantBuildMuslFromSource()) {
858 try comp.work_queue.write(&[_]Job{858 try comp.work_queue.ensureUnusedCapacity(5);
859 .{ .musl_crt_file = .crti_o },859 if (target_util.libc_needs_crti_crtn(comp.getTarget())) {
860 .{ .musl_crt_file = .crtn_o },860 comp.work_queue.writeAssumeCapacity(&[_]Job{
861 .{ .musl_crt_file = .crti_o },
862 .{ .musl_crt_file = .crtn_o },
863 });
864 }
865 comp.work_queue.writeAssumeCapacity(&[_]Job{
861 .{ .musl_crt_file = .crt1_o },866 .{ .musl_crt_file = .crt1_o },
862 .{ .musl_crt_file = .scrt1_o },867 .{ .musl_crt_file = .scrt1_o },
863 .{ .musl_crt_file = .libc_a },868 .{ .musl_crt_file = .libc_a },