authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-07-07 13:18:53-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-07-07 22:59:52-04:00
log166402c16bddccc364b9108a9e69af3a0dd6f1ab
tree4557630cf8d32fbcf54e30c687819638615e122d
parentbdae01ab047accbbc6dcd014d008f2554aa78696

bootstrap: fix build


2 files changed, 7 insertions(+), 2 deletions(-)

lib/std/Thread.zig+6-1
...@@ -280,12 +280,13 @@ pub fn getCurrentId() Id {...@@ -280,12 +280,13 @@ pub fn getCurrentId() Id {
280pub const CpuCountError = error{280pub const CpuCountError = error{
281 PermissionDenied,281 PermissionDenied,
282 SystemResources,282 SystemResources,
283 Unsupported,
283 Unexpected,284 Unexpected,
284};285};
285286
286/// Returns the platforms view on the number of logical CPU cores available.287/// Returns the platforms view on the number of logical CPU cores available.
287pub fn getCpuCount() CpuCountError!usize {288pub fn getCpuCount() CpuCountError!usize {
288 return Impl.getCpuCount();289 return try Impl.getCpuCount();
289}290}
290291
291/// Configuration options for hints on how to spawn threads.292/// Configuration options for hints on how to spawn threads.
...@@ -782,6 +783,10 @@ const WasiThreadImpl = struct {...@@ -782,6 +783,10 @@ const WasiThreadImpl = struct {
782 return tls_thread_id;783 return tls_thread_id;
783 }784 }
784785
786 fn getCpuCount() error{Unsupported}!noreturn {
787 return error.Unsupported;
788 }
789
785 fn getHandle(self: Impl) ThreadHandle {790 fn getHandle(self: Impl) ThreadHandle {
786 return self.thread.tid.load(.seq_cst);791 return self.thread.tid.load(.seq_cst);
787 }792 }
src/link.zig+1-1
...@@ -538,7 +538,7 @@ pub const File = struct {...@@ -538,7 +538,7 @@ pub const File = struct {
538 pub fn flush(base: *File, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Progress.Node) FlushError!void {538 pub fn flush(base: *File, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Progress.Node) FlushError!void {
539 if (build_options.only_c) {539 if (build_options.only_c) {
540 assert(base.tag == .c);540 assert(base.tag == .c);
541 return @as(*C, @fieldParentPtr("base", base)).flush(arena, prog_node);541 return @as(*C, @fieldParentPtr("base", base)).flush(arena, tid, prog_node);
542 }542 }
543 const comp = base.comp;543 const comp = base.comp;
544 if (comp.clang_preprocessor_mode == .yes or comp.clang_preprocessor_mode == .pch) {544 if (comp.clang_preprocessor_mode == .yes or comp.clang_preprocessor_mode == .pch) {