authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-18 18:39:40-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-20 20:59:52-08:00
log28da5302714734ba48c44f2a0e88cf4229bcd9f7
treea66b2d40315617ad5670b3c5a219b52f85fa537a
parent966169fa6829eb3e3c8324e06740e257deedc436

Compilation pipeline: linker input producing Job representation

Move all the remaining Jobs that produce linker inputs to be spawned earlier in the pipeline and registered with link_task_wait_group.

2 files changed, 128 insertions(+), 150 deletions(-)

src/Compilation.zig+126-148
...@@ -291,8 +291,18 @@ const QueuedJobs = struct {...@@ -291,8 +291,18 @@ const QueuedJobs = struct {
291 update_builtin_zig: bool,291 update_builtin_zig: bool,
292 musl_crt_file: [@typeInfo(musl.CrtFile).@"enum".fields.len]bool = [1]bool{false} ** @typeInfo(musl.CrtFile).@"enum".fields.len,292 musl_crt_file: [@typeInfo(musl.CrtFile).@"enum".fields.len]bool = [1]bool{false} ** @typeInfo(musl.CrtFile).@"enum".fields.len,
293 glibc_crt_file: [@typeInfo(glibc.CrtFile).@"enum".fields.len]bool = [1]bool{false} ** @typeInfo(glibc.CrtFile).@"enum".fields.len,293 glibc_crt_file: [@typeInfo(glibc.CrtFile).@"enum".fields.len]bool = [1]bool{false} ** @typeInfo(glibc.CrtFile).@"enum".fields.len,
294 /// one of WASI libc static objects
295 wasi_libc_crt_file: [@typeInfo(wasi_libc.CrtFile).@"enum".fields.len]bool = [1]bool{false} ** @typeInfo(wasi_libc.CrtFile).@"enum".fields.len,
296 /// one of the mingw-w64 static objects
297 mingw_crt_file: [@typeInfo(mingw.CrtFile).@"enum".fields.len]bool = [1]bool{false} ** @typeInfo(mingw.CrtFile).@"enum".fields.len,
294 /// all of the glibc shared objects298 /// all of the glibc shared objects
295 glibc_shared_objects: bool = false,299 glibc_shared_objects: bool = false,
300 /// libunwind.a, usually needed when linking libc
301 libunwind: bool = false,
302 libcxx: bool = false,
303 libcxxabi: bool = false,
304 libtsan: bool = false,
305 zig_libc: bool = false,
296};306};
297307
298pub const default_stack_protector_buffer_size = target_util.default_stack_protector_buffer_size;308pub const default_stack_protector_buffer_size = target_util.default_stack_protector_buffer_size;
...@@ -388,20 +398,6 @@ const Job = union(enum) {...@@ -388,20 +398,6 @@ const Job = union(enum) {
388 /// Fully resolve the given `struct` or `union` type.398 /// Fully resolve the given `struct` or `union` type.
389 resolve_type_fully: InternPool.Index,399 resolve_type_fully: InternPool.Index,
390400
391 /// one of the mingw-w64 static objects
392 mingw_crt_file: mingw.CrtFile,
393
394 /// libunwind.a, usually needed when linking libc
395 libunwind: void,
396 libcxx: void,
397 libcxxabi: void,
398 libtsan: void,
399 /// needed when not linking libc and using LLVM for code generation because it generates
400 /// calls to, for example, memcpy and memset.
401 zig_libc: void,
402 /// one of WASI libc static objects
403 wasi_libc_crt_file: wasi_libc.CrtFile,
404
405 /// The value is the index into `windows_libs`.401 /// The value is the index into `windows_libs`.
406 windows_import_lib: usize,402 windows_import_lib: usize,
407403
...@@ -1846,24 +1842,19 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil...@@ -1846,24 +1842,19 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
1846 if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable;1842 if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable;
18471843
1848 for (comp.wasi_emulated_libs) |crt_file| {1844 for (comp.wasi_emulated_libs) |crt_file| {
1849 try comp.queueJob(.{1845 comp.queued_jobs.wasi_libc_crt_file[@intFromEnum(crt_file)] = true;
1850 .wasi_libc_crt_file = crt_file,
1851 });
1852 comp.remaining_prelink_tasks += 1;
1853 }1846 }
1854 try comp.queueJobs(&[_]Job{1847 comp.remaining_prelink_tasks += @intCast(comp.wasi_emulated_libs.len);
1855 .{ .wasi_libc_crt_file = wasi_libc.execModelCrtFile(comp.config.wasi_exec_model) },1848
1856 .{ .wasi_libc_crt_file = .libc_a },1849 comp.queued_jobs.wasi_libc_crt_file[@intFromEnum(wasi_libc.execModelCrtFile(comp.config.wasi_exec_model))] = true;
1857 });1850 comp.queued_jobs.wasi_libc_crt_file[@intFromEnum(wasi_libc.CrtFile.libc_a)] = true;
1858 comp.remaining_prelink_tasks += 2;1851 comp.remaining_prelink_tasks += 2;
1859 } else if (target.isMinGW()) {1852 } else if (target.isMinGW()) {
1860 if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable;1853 if (!std.zig.target.canBuildLibC(target)) return error.LibCUnavailable;
18611854
1862 const crt_job: Job = .{ .mingw_crt_file = if (is_dyn_lib) .dllcrt2_o else .crt2_o };1855 const main_crt_file: mingw.CrtFile = if (is_dyn_lib) .dllcrt2_o else .crt2_o;
1863 try comp.queueJobs(&.{1856 comp.queued_jobs.mingw_crt_file[@intFromEnum(main_crt_file)] = true;
1864 .{ .mingw_crt_file = .mingw32_lib },1857 comp.queued_jobs.mingw_crt_file[@intFromEnum(mingw.CrtFile.mingw32_lib)] = true;
1865 crt_job,
1866 });
1867 comp.remaining_prelink_tasks += 2;1858 comp.remaining_prelink_tasks += 2;
18681859
1869 // When linking mingw-w64 there are some import libs we always need.1860 // When linking mingw-w64 there are some import libs we always need.
...@@ -1875,7 +1866,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil...@@ -1875,7 +1866,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
1875 else => return error.LibCUnavailable,1866 else => return error.LibCUnavailable,
1876 }1867 }
1877 } else if (target.os.tag == .freestanding and capable_of_building_zig_libc) {1868 } else if (target.os.tag == .freestanding and capable_of_building_zig_libc) {
1878 try comp.queueJob(.{ .zig_libc = {} });1869 comp.queued_jobs.zig_libc = true;
1879 comp.remaining_prelink_tasks += 1;1870 comp.remaining_prelink_tasks += 1;
1880 } else {1871 } else {
1881 return error.LibCUnavailable;1872 return error.LibCUnavailable;
...@@ -1888,18 +1879,22 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil...@@ -1888,18 +1879,22 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
1888 for (0..count) |i| {1879 for (0..count) |i| {
1889 try comp.queueJob(.{ .windows_import_lib = i });1880 try comp.queueJob(.{ .windows_import_lib = i });
1890 }1881 }
1882 // when integrating coff linker with prelink, the above
1883 // queueJob will need to change into something else since those
1884 // jobs are dispatched *after* the link_task_wait_group.wait()
1885 // that happens when separateCodegenThreadOk() is false.
1891 }1886 }
1892 if (comp.wantBuildLibUnwindFromSource()) {1887 if (comp.wantBuildLibUnwindFromSource()) {
1893 try comp.queueJob(.{ .libunwind = {} });1888 comp.queued_jobs.libunwind = true;
1894 comp.remaining_prelink_tasks += 1;1889 comp.remaining_prelink_tasks += 1;
1895 }1890 }
1896 if (build_options.have_llvm and is_exe_or_dyn_lib and comp.config.link_libcpp) {1891 if (build_options.have_llvm and is_exe_or_dyn_lib and comp.config.link_libcpp) {
1897 try comp.queueJob(.libcxx);1892 comp.queued_jobs.libcxx = true;
1898 try comp.queueJob(.libcxxabi);1893 comp.queued_jobs.libcxxabi = true;
1899 comp.remaining_prelink_tasks += 2;1894 comp.remaining_prelink_tasks += 2;
1900 }1895 }
1901 if (build_options.have_llvm and is_exe_or_dyn_lib and comp.config.any_sanitize_thread) {1896 if (build_options.have_llvm and is_exe_or_dyn_lib and comp.config.any_sanitize_thread) {
1902 try comp.queueJob(.libtsan);1897 comp.queued_jobs.libtsan = true;
1903 comp.remaining_prelink_tasks += 1;1898 comp.remaining_prelink_tasks += 1;
1904 }1899 }
19051900
...@@ -3726,6 +3721,30 @@ fn performAllTheWorkInner(...@@ -3726,6 +3721,30 @@ fn performAllTheWorkInner(
3726 comp.link_task_wait_group.spawnManager(buildRt, .{ comp, "fuzzer.zig", .libfuzzer, .Lib, &comp.fuzzer_lib, main_progress_node });3721 comp.link_task_wait_group.spawnManager(buildRt, .{ comp, "fuzzer.zig", .libfuzzer, .Lib, &comp.fuzzer_lib, main_progress_node });
3727 }3722 }
37283723
3724 if (testAndClear(&comp.queued_jobs.glibc_shared_objects)) {
3725 comp.link_task_wait_group.spawnManager(buildGlibcSharedObjects, .{ comp, main_progress_node });
3726 }
3727
3728 if (testAndClear(&comp.queued_jobs.libunwind)) {
3729 comp.link_task_wait_group.spawnManager(buildLibUnwind, .{ comp, main_progress_node });
3730 }
3731
3732 if (testAndClear(&comp.queued_jobs.libcxx)) {
3733 comp.link_task_wait_group.spawnManager(buildLibCxx, .{ comp, main_progress_node });
3734 }
3735
3736 if (testAndClear(&comp.queued_jobs.libcxxabi)) {
3737 comp.link_task_wait_group.spawnManager(buildLibCxxAbi, .{ comp, main_progress_node });
3738 }
3739
3740 if (testAndClear(&comp.queued_jobs.libtsan)) {
3741 comp.link_task_wait_group.spawnManager(buildLibTsan, .{ comp, main_progress_node });
3742 }
3743
3744 if (testAndClear(&comp.queued_jobs.zig_libc)) {
3745 comp.link_task_wait_group.spawnManager(buildZigLibc, .{ comp, main_progress_node });
3746 }
3747
3729 for (0..@typeInfo(musl.CrtFile).@"enum".fields.len) |i| {3748 for (0..@typeInfo(musl.CrtFile).@"enum".fields.len) |i| {
3730 if (testAndClear(&comp.queued_jobs.musl_crt_file[i])) {3749 if (testAndClear(&comp.queued_jobs.musl_crt_file[i])) {
3731 const tag: musl.CrtFile = @enumFromInt(i);3750 const tag: musl.CrtFile = @enumFromInt(i);
...@@ -3740,8 +3759,18 @@ fn performAllTheWorkInner(...@@ -3740,8 +3759,18 @@ fn performAllTheWorkInner(
3740 }3759 }
3741 }3760 }
37423761
3743 if (testAndClear(&comp.queued_jobs.glibc_shared_objects)) {3762 for (0..@typeInfo(wasi_libc.CrtFile).@"enum".fields.len) |i| {
3744 comp.link_task_wait_group.spawnManager(buildGlibcSharedObjects, .{ comp, main_progress_node });3763 if (testAndClear(&comp.queued_jobs.wasi_libc_crt_file[i])) {
3764 const tag: wasi_libc.CrtFile = @enumFromInt(i);
3765 comp.link_task_wait_group.spawnManager(buildWasiLibcCrtFile, .{ comp, tag, main_progress_node });
3766 }
3767 }
3768
3769 for (0..@typeInfo(mingw.CrtFile).@"enum".fields.len) |i| {
3770 if (testAndClear(&comp.queued_jobs.mingw_crt_file[i])) {
3771 const tag: mingw.CrtFile = @enumFromInt(i);
3772 comp.link_task_wait_group.spawnManager(buildMingwCrtFile, .{ comp, tag, main_progress_node });
3773 }
3745 }3774 }
37463775
3747 {3776 {
...@@ -3843,7 +3872,7 @@ fn performAllTheWorkInner(...@@ -3843,7 +3872,7 @@ fn performAllTheWorkInner(
38433872
3844 work: while (true) {3873 work: while (true) {
3845 for (&comp.work_queues) |*work_queue| if (work_queue.readItem()) |job| {3874 for (&comp.work_queues) |*work_queue| if (work_queue.readItem()) |job| {
3846 try processOneJob(@intFromEnum(Zcu.PerThread.Id.main), comp, job, main_progress_node);3875 try processOneJob(@intFromEnum(Zcu.PerThread.Id.main), comp, job);
3847 continue :work;3876 continue :work;
3848 };3877 };
3849 if (comp.zcu) |zcu| {3878 if (comp.zcu) |zcu| {
...@@ -3878,7 +3907,7 @@ pub fn queueJobs(comp: *Compilation, jobs: []const Job) !void {...@@ -3878,7 +3907,7 @@ pub fn queueJobs(comp: *Compilation, jobs: []const Job) !void {
3878 for (jobs) |job| try comp.queueJob(job);3907 for (jobs) |job| try comp.queueJob(job);
3879}3908}
38803909
3881fn processOneJob(tid: usize, comp: *Compilation, job: Job, prog_node: std.Progress.Node) JobError!void {3910fn processOneJob(tid: usize, comp: *Compilation, job: Job) JobError!void {
3882 switch (job) {3911 switch (job) {
3883 .codegen_nav => |nav_index| {3912 .codegen_nav => |nav_index| {
3884 const zcu = comp.zcu.?;3913 const zcu = comp.zcu.?;
...@@ -3974,19 +4003,6 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job, prog_node: std.Progre...@@ -3974,19 +4003,6 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job, prog_node: std.Progre
3974 error.AnalysisFail => return,4003 error.AnalysisFail => return,
3975 };4004 };
3976 },4005 },
3977 .mingw_crt_file => |crt_file| {
3978 const named_frame = tracy.namedFrame("mingw_crt_file");
3979 defer named_frame.end();
3980
3981 mingw.buildCrtFile(comp, crt_file, prog_node) catch |err| {
3982 // TODO Surface more error details.
3983 comp.lockAndSetMiscFailure(
3984 .mingw_crt_file,
3985 "unable to build mingw-w64 CRT file {s}: {s}",
3986 .{ @tagName(crt_file), @errorName(err) },
3987 );
3988 };
3989 },
3990 .windows_import_lib => |index| {4006 .windows_import_lib => |index| {
3991 const named_frame = tracy.namedFrame("windows_import_lib");4007 const named_frame = tracy.namedFrame("windows_import_lib");
3992 defer named_frame.end();4008 defer named_frame.end();
...@@ -4001,95 +4017,6 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job, prog_node: std.Progre...@@ -4001,95 +4017,6 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job, prog_node: std.Progre
4001 );4017 );
4002 };4018 };
4003 },4019 },
4004 .libunwind => {
4005 const named_frame = tracy.namedFrame("libunwind");
4006 defer named_frame.end();
4007
4008 libunwind.buildStaticLib(comp, prog_node) catch |err| switch (err) {
4009 error.OutOfMemory => return error.OutOfMemory,
4010 error.SubCompilationFailed => return, // error reported already
4011 else => comp.lockAndSetMiscFailure(
4012 .libunwind,
4013 "unable to build libunwind: {s}",
4014 .{@errorName(err)},
4015 ),
4016 };
4017 },
4018 .libcxx => {
4019 const named_frame = tracy.namedFrame("libcxx");
4020 defer named_frame.end();
4021
4022 libcxx.buildLibCXX(comp, prog_node) catch |err| switch (err) {
4023 error.OutOfMemory => return error.OutOfMemory,
4024 error.SubCompilationFailed => return, // error reported already
4025 else => comp.lockAndSetMiscFailure(
4026 .libcxx,
4027 "unable to build libcxx: {s}",
4028 .{@errorName(err)},
4029 ),
4030 };
4031 },
4032 .libcxxabi => {
4033 const named_frame = tracy.namedFrame("libcxxabi");
4034 defer named_frame.end();
4035
4036 libcxx.buildLibCXXABI(comp, prog_node) catch |err| switch (err) {
4037 error.OutOfMemory => return error.OutOfMemory,
4038 error.SubCompilationFailed => return, // error reported already
4039 else => comp.lockAndSetMiscFailure(
4040 .libcxxabi,
4041 "unable to build libcxxabi: {s}",
4042 .{@errorName(err)},
4043 ),
4044 };
4045 },
4046 .libtsan => {
4047 const named_frame = tracy.namedFrame("libtsan");
4048 defer named_frame.end();
4049
4050 libtsan.buildTsan(comp, prog_node) catch |err| switch (err) {
4051 error.OutOfMemory => return error.OutOfMemory,
4052 error.SubCompilationFailed => return, // error reported already
4053 else => comp.lockAndSetMiscFailure(
4054 .libtsan,
4055 "unable to build TSAN library: {s}",
4056 .{@errorName(err)},
4057 ),
4058 };
4059 },
4060 .wasi_libc_crt_file => |crt_file| {
4061 const named_frame = tracy.namedFrame("wasi_libc_crt_file");
4062 defer named_frame.end();
4063
4064 wasi_libc.buildCrtFile(comp, crt_file, prog_node) catch |err| {
4065 // TODO Surface more error details.
4066 comp.lockAndSetMiscFailure(
4067 .wasi_libc_crt_file,
4068 "unable to build WASI libc CRT file: {s}",
4069 .{@errorName(err)},
4070 );
4071 };
4072 },
4073 .zig_libc => {
4074 const named_frame = tracy.namedFrame("zig_libc");
4075 defer named_frame.end();
4076
4077 comp.buildOutputFromZig(
4078 "c.zig",
4079 .Lib,
4080 &comp.libc_static_lib,
4081 .zig_libc,
4082 prog_node,
4083 ) catch |err| switch (err) {
4084 error.OutOfMemory => return error.OutOfMemory,
4085 error.SubCompilationFailed => return, // error reported already
4086 else => comp.lockAndSetMiscFailure(
4087 .zig_libc,
4088 "unable to build zig's multitarget libc: {s}",
4089 .{@errorName(err)},
4090 ),
4091 };
4092 },
4093 }4020 }
4094}4021}
40954022
...@@ -4742,11 +4669,7 @@ fn buildRt(...@@ -4742,11 +4669,7 @@ fn buildRt(
4742 };4669 };
4743}4670}
47444671
4745fn buildMuslCrtFile(4672fn buildMuslCrtFile(comp: *Compilation, crt_file: musl.CrtFile, prog_node: std.Progress.Node) void {
4746 comp: *Compilation,
4747 crt_file: musl.CrtFile,
4748 prog_node: std.Progress.Node,
4749) void {
4750 musl.buildCrtFile(comp, crt_file, prog_node) catch |err| switch (err) {4673 musl.buildCrtFile(comp, crt_file, prog_node) catch |err| switch (err) {
4751 error.SubCompilationFailed => return, // error reported already4674 error.SubCompilationFailed => return, // error reported already
4752 else => comp.lockAndSetMiscFailure(.musl_crt_file, "unable to build musl {s}: {s}", .{4675 else => comp.lockAndSetMiscFailure(.musl_crt_file, "unable to build musl {s}: {s}", .{
...@@ -4755,11 +4678,7 @@ fn buildMuslCrtFile(...@@ -4755,11 +4678,7 @@ fn buildMuslCrtFile(
4755 };4678 };
4756}4679}
47574680
4758fn buildGlibcCrtFile(4681fn buildGlibcCrtFile(comp: *Compilation, crt_file: glibc.CrtFile, prog_node: std.Progress.Node) void {
4759 comp: *Compilation,
4760 crt_file: glibc.CrtFile,
4761 prog_node: std.Progress.Node,
4762) void {
4763 glibc.buildCrtFile(comp, crt_file, prog_node) catch |err| switch (err) {4682 glibc.buildCrtFile(comp, crt_file, prog_node) catch |err| switch (err) {
4764 error.SubCompilationFailed => return, // error reported already4683 error.SubCompilationFailed => return, // error reported already
4765 else => comp.lockAndSetMiscFailure(.glibc_crt_file, "unable to build glibc {s}: {s}", .{4684 else => comp.lockAndSetMiscFailure(.glibc_crt_file, "unable to build glibc {s}: {s}", .{
...@@ -4777,6 +4696,65 @@ fn buildGlibcSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) voi...@@ -4777,6 +4696,65 @@ fn buildGlibcSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) voi
4777 };4696 };
4778}4697}
47794698
4699fn buildMingwCrtFile(comp: *Compilation, crt_file: mingw.CrtFile, prog_node: std.Progress.Node) void {
4700 mingw.buildCrtFile(comp, crt_file, prog_node) catch |err| switch (err) {
4701 error.SubCompilationFailed => return, // error reported already
4702 else => comp.lockAndSetMiscFailure(.mingw_crt_file, "unable to build mingw-w64 {s}: {s}", .{
4703 @tagName(crt_file), @errorName(err),
4704 }),
4705 };
4706}
4707
4708fn buildWasiLibcCrtFile(comp: *Compilation, crt_file: wasi_libc.CrtFile, prog_node: std.Progress.Node) void {
4709 wasi_libc.buildCrtFile(comp, crt_file, prog_node) catch |err| switch (err) {
4710 error.SubCompilationFailed => return, // error reported already
4711 else => comp.lockAndSetMiscFailure(.wasi_libc_crt_file, "unable to build WASI libc {s}: {s}", .{
4712 @tagName(crt_file), @errorName(err),
4713 }),
4714 };
4715}
4716
4717fn buildLibUnwind(comp: *Compilation, prog_node: std.Progress.Node) void {
4718 libunwind.buildStaticLib(comp, prog_node) catch |err| switch (err) {
4719 error.SubCompilationFailed => return, // error reported already
4720 else => comp.lockAndSetMiscFailure(.libunwind, "unable to build libunwind: {s}", .{@errorName(err)}),
4721 };
4722}
4723
4724fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) void {
4725 libcxx.buildLibCxx(comp, prog_node) catch |err| switch (err) {
4726 error.SubCompilationFailed => return, // error reported already
4727 else => comp.lockAndSetMiscFailure(.libcxx, "unable to build libcxx: {s}", .{@errorName(err)}),
4728 };
4729}
4730
4731fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) void {
4732 libcxx.buildLibCxxAbi(comp, prog_node) catch |err| switch (err) {
4733 error.SubCompilationFailed => return, // error reported already
4734 else => comp.lockAndSetMiscFailure(.libcxxabi, "unable to build libcxxabi: {s}", .{@errorName(err)}),
4735 };
4736}
4737
4738fn buildLibTsan(comp: *Compilation, prog_node: std.Progress.Node) void {
4739 libtsan.buildTsan(comp, prog_node) catch |err| switch (err) {
4740 error.SubCompilationFailed => return, // error reported already
4741 else => comp.lockAndSetMiscFailure(.libtsan, "unable to build TSAN library: {s}", .{@errorName(err)}),
4742 };
4743}
4744
4745fn buildZigLibc(comp: *Compilation, prog_node: std.Progress.Node) void {
4746 comp.buildOutputFromZig(
4747 "c.zig",
4748 .Lib,
4749 &comp.libc_static_lib,
4750 .zig_libc,
4751 prog_node,
4752 ) catch |err| switch (err) {
4753 error.SubCompilationFailed => return, // error reported already
4754 else => comp.lockAndSetMiscFailure(.zig_libc, "unable to build zig's multitarget libc: {s}", .{@errorName(err)}),
4755 };
4756}
4757
4780fn reportRetryableCObjectError(4758fn reportRetryableCObjectError(
4781 comp: *Compilation,4759 comp: *Compilation,
4782 c_object: *CObject,4760 c_object: *CObject,
src/libcxx.zig+2-2
...@@ -114,7 +114,7 @@ pub const BuildError = error{...@@ -114,7 +114,7 @@ pub const BuildError = error{
114 ZigCompilerNotBuiltWithLLVMExtensions,114 ZigCompilerNotBuiltWithLLVMExtensions,
115};115};
116116
117pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!void {117pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!void {
118 if (!build_options.have_llvm) {118 if (!build_options.have_llvm) {
119 return error.ZigCompilerNotBuiltWithLLVMExtensions;119 return error.ZigCompilerNotBuiltWithLLVMExtensions;
120 }120 }
...@@ -357,7 +357,7 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!...@@ -357,7 +357,7 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
357 comp.queueLinkTaskMode(crt_file.full_object_path, output_mode);357 comp.queueLinkTaskMode(crt_file.full_object_path, output_mode);
358}358}
359359
360pub fn buildLibCXXABI(comp: *Compilation, prog_node: std.Progress.Node) BuildError!void {360pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildError!void {
361 if (!build_options.have_llvm) {361 if (!build_options.have_llvm) {
362 return error.ZigCompilerNotBuiltWithLLVMExtensions;362 return error.ZigCompilerNotBuiltWithLLVMExtensions;
363 }363 }