mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 08:33:15 +00:00
macho: check if fallback libSystem.{d}.tbd exists in Zig's installation
This commit is contained in:
parent
f4c9e19bc3
commit
43adfd9689
@ -657,17 +657,17 @@ pub fn resolveLibSystem(
|
||||
if (try resolveLibSystemInDirs(arena, search_dirs, out_libs)) return;
|
||||
|
||||
// As a fallback, try linking against Zig shipped stub.
|
||||
const libsystem_name = try std.fmt.allocPrint(arena, "libSystem.{d}.tbd", .{
|
||||
const libsystem_name = try std.fmt.allocPrint(arena, "libSystem.{d}", .{
|
||||
target.os.version_range.semver.min.major,
|
||||
});
|
||||
const full_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
|
||||
"libc", "darwin", libsystem_name,
|
||||
});
|
||||
try out_libs.put(full_path, .{
|
||||
.needed = true,
|
||||
.weak = false,
|
||||
.path = full_path,
|
||||
});
|
||||
const full_dir_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", "darwin" });
|
||||
if (try resolveLib(arena, full_dir_path, libsystem_name, ".tbd")) |full_path| {
|
||||
try out_libs.put(full_path, .{
|
||||
.needed = true,
|
||||
.weak = false,
|
||||
.path = full_path,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
fn resolveLibSystemInDirs(arena: Allocator, dirs: []const []const u8, out_libs: anytype) !bool {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user