fix zig libc FTBFS

This commit is contained in:
Andrew Kelley 2025-06-25 05:17:46 -07:00
parent 75d6d4c3f2
commit 8eca338c27

View File

@ -69,7 +69,7 @@ pub fn main() !void {
const libc_installation: ?*LibCInstallation = libc: { const libc_installation: ?*LibCInstallation = libc: {
if (input_file) |libc_file| { if (input_file) |libc_file| {
const libc = try arena.create(LibCInstallation); const libc = try arena.create(LibCInstallation);
libc.* = LibCInstallation.parse(arena, libc_file, target) catch |err| { libc.* = LibCInstallation.parse(arena, libc_file, &target) catch |err| {
fatal("unable to parse libc file at path {s}: {s}", .{ libc_file, @errorName(err) }); fatal("unable to parse libc file at path {s}: {s}", .{ libc_file, @errorName(err) });
}; };
break :libc libc; break :libc libc;
@ -83,7 +83,7 @@ pub fn main() !void {
const libc_dirs = std.zig.LibCDirs.detect( const libc_dirs = std.zig.LibCDirs.detect(
arena, arena,
zig_lib_directory, zig_lib_directory,
target, &target,
is_native_abi, is_native_abi,
true, true,
libc_installation, libc_installation,
@ -108,7 +108,7 @@ pub fn main() !void {
} }
if (input_file) |libc_file| { if (input_file) |libc_file| {
var libc = LibCInstallation.parse(gpa, libc_file, target) catch |err| { var libc = LibCInstallation.parse(gpa, libc_file, &target) catch |err| {
fatal("unable to parse libc file at path {s}: {s}", .{ libc_file, @errorName(err) }); fatal("unable to parse libc file at path {s}: {s}", .{ libc_file, @errorName(err) });
}; };
defer libc.deinit(gpa); defer libc.deinit(gpa);
@ -119,7 +119,7 @@ pub fn main() !void {
var libc = LibCInstallation.findNative(.{ var libc = LibCInstallation.findNative(.{
.allocator = gpa, .allocator = gpa,
.verbose = true, .verbose = true,
.target = target, .target = &target,
}) catch |err| { }) catch |err| {
fatal("unable to detect native libc: {s}", .{@errorName(err)}); fatal("unable to detect native libc: {s}", .{@errorName(err)});
}; };