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

such as on RISC-V
This commit is contained in:
Andrew Kelley 2020-09-29 01:28:48 -07:00
parent d3a99c7bd5
commit 3efdd7b2ad
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,3 @@
* building risc-v musl regression
* wasi behavior tests failing
* go ahead and use allocSentinel now that the stage1 bug is fixed
* audit the base cache hash

View File

@ -855,9 +855,14 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
try comp.addBuildingGLibCJobs();
}
if (comp.wantBuildMuslFromSource()) {
try comp.work_queue.write(&[_]Job{
.{ .musl_crt_file = .crti_o },
.{ .musl_crt_file = .crtn_o },
try comp.work_queue.ensureUnusedCapacity(5);
if (target_util.libc_needs_crti_crtn(comp.getTarget())) {
comp.work_queue.writeAssumeCapacity(&[_]Job{
.{ .musl_crt_file = .crti_o },
.{ .musl_crt_file = .crtn_o },
});
}
comp.work_queue.writeAssumeCapacity(&[_]Job{
.{ .musl_crt_file = .crt1_o },
.{ .musl_crt_file = .scrt1_o },
.{ .musl_crt_file = .libc_a },