From 166402c16bddccc364b9108a9e69af3a0dd6f1ab Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sun, 7 Jul 2024 13:18:53 -0400 Subject: [PATCH] bootstrap: fix build --- lib/std/Thread.zig | 7 ++++++- src/link.zig | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index 5bfaef6127..25261053ee 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -280,12 +280,13 @@ pub fn getCurrentId() Id { pub const CpuCountError = error{ PermissionDenied, SystemResources, + Unsupported, Unexpected, }; /// Returns the platforms view on the number of logical CPU cores available. pub fn getCpuCount() CpuCountError!usize { - return Impl.getCpuCount(); + return try Impl.getCpuCount(); } /// Configuration options for hints on how to spawn threads. @@ -782,6 +783,10 @@ const WasiThreadImpl = struct { return tls_thread_id; } + fn getCpuCount() error{Unsupported}!noreturn { + return error.Unsupported; + } + fn getHandle(self: Impl) ThreadHandle { return self.thread.tid.load(.seq_cst); } diff --git a/src/link.zig b/src/link.zig index f407ad2f4c..03ee3185ab 100644 --- a/src/link.zig +++ b/src/link.zig @@ -538,7 +538,7 @@ pub const File = struct { pub fn flush(base: *File, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Progress.Node) FlushError!void { if (build_options.only_c) { assert(base.tag == .c); - return @as(*C, @fieldParentPtr("base", base)).flush(arena, prog_node); + return @as(*C, @fieldParentPtr("base", base)).flush(arena, tid, prog_node); } const comp = base.comp; if (comp.clang_preprocessor_mode == .yes or comp.clang_preprocessor_mode == .pch) {