update_cpu_features tool: work around stage1 bug

This works around a stage1 compiler bug resulting in a segfault when
trying to use the tool.
This commit is contained in:
Andrew Kelley 2021-08-12 11:30:55 -07:00
parent 55c6a784a5
commit 0961c1975a

View File

@ -818,15 +818,14 @@ pub fn main() anyerror!void {
} else { } else {
var threads = try arena.alloc(std.Thread, llvm_targets.len); var threads = try arena.alloc(std.Thread, llvm_targets.len);
for (llvm_targets) |llvm_target, i| { for (llvm_targets) |llvm_target, i| {
threads[i] = try std.Thread.spawn(.{}, processOneTarget, .{ const job = Job{
Job{ .llvm_tblgen_exe = llvm_tblgen_exe,
.llvm_tblgen_exe = llvm_tblgen_exe, .llvm_src_root = llvm_src_root,
.llvm_src_root = llvm_src_root, .zig_src_dir = zig_src_dir,
.zig_src_dir = zig_src_dir, .root_progress = root_progress,
.root_progress = root_progress, .llvm_target = llvm_target,
.llvm_target = llvm_target, };
}, threads[i] = try std.Thread.spawn(.{}, processOneTarget, .{job});
});
} }
for (threads) |thread| { for (threads) |thread| {
thread.join(); thread.join();