| ... | @@ -1586,6 +1586,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1586,6 +1586,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1586 | // If we need to build glibc for the target, add work items for it. | 1586 | // If we need to build glibc for the target, add work items for it. |
| 1587 | // We go through the work queue so that building can be done in parallel. | 1587 | // We go through the work queue so that building can be done in parallel. |
| 1588 | if (comp.wantBuildGLibCFromSource()) { | 1588 | if (comp.wantBuildGLibCFromSource()) { |
| | 1589 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; |
| | 1590 | |
| 1589 | if (glibc.needsCrtiCrtn(comp.getTarget())) { | 1591 | if (glibc.needsCrtiCrtn(comp.getTarget())) { |
| 1590 | try comp.work_queue.write(&[_]Job{ | 1592 | try comp.work_queue.write(&[_]Job{ |
| 1591 | .{ .glibc_crt_file = .crti_o }, | 1593 | .{ .glibc_crt_file = .crti_o }, |
| ... | @@ -1599,6 +1601,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1599,6 +1601,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1599 | }); | 1601 | }); |
| 1600 | } | 1602 | } |
| 1601 | if (comp.wantBuildMuslFromSource()) { | 1603 | if (comp.wantBuildMuslFromSource()) { |
| | 1604 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; |
| | 1605 | |
| 1602 | try comp.work_queue.ensureUnusedCapacity(6); | 1606 | try comp.work_queue.ensureUnusedCapacity(6); |
| 1603 | if (musl.needsCrtiCrtn(comp.getTarget())) { | 1607 | if (musl.needsCrtiCrtn(comp.getTarget())) { |
| 1604 | comp.work_queue.writeAssumeCapacity(&[_]Job{ | 1608 | comp.work_queue.writeAssumeCapacity(&[_]Job{ |
| ... | @@ -1617,6 +1621,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1617,6 +1621,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1617 | }); | 1621 | }); |
| 1618 | } | 1622 | } |
| 1619 | if (comp.wantBuildWasiLibcFromSource()) { | 1623 | if (comp.wantBuildWasiLibcFromSource()) { |
| | 1624 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; |
| | 1625 | |
| 1620 | const wasi_emulated_libs = comp.bin_file.options.wasi_emulated_libs; | 1626 | const wasi_emulated_libs = comp.bin_file.options.wasi_emulated_libs; |
| 1621 | try comp.work_queue.ensureUnusedCapacity(wasi_emulated_libs.len + 2); // worst-case we need all components | 1627 | try comp.work_queue.ensureUnusedCapacity(wasi_emulated_libs.len + 2); // worst-case we need all components |
| 1622 | for (wasi_emulated_libs) |crt_file| { | 1628 | for (wasi_emulated_libs) |crt_file| { |
| ... | @@ -1630,6 +1636,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1630,6 +1636,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1630 | }); | 1636 | }); |
| 1631 | } | 1637 | } |
| 1632 | if (comp.wantBuildMinGWFromSource()) { | 1638 | if (comp.wantBuildMinGWFromSource()) { |
| | 1639 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; |
| | 1640 | |
| 1633 | const static_lib_jobs = [_]Job{ | 1641 | const static_lib_jobs = [_]Job{ |
| 1634 | .{ .mingw_crt_file = .mingw32_lib }, | 1642 | .{ .mingw_crt_file = .mingw32_lib }, |
| 1635 | .{ .mingw_crt_file = .msvcrt_os_lib }, | 1643 | .{ .mingw_crt_file = .msvcrt_os_lib }, |