diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-05-20 07:59:16 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-05-20 13:22:11 +0200 |
| commit | a63f7875f451bda975ddabcc0c1feed10a216516 (patch) | |
| tree | f23fca9f5034e223c2b4be0911fe14258fa7ce06 /src/libs | |
| parent | 999777e73aa1bd06b05cbe53f8c2488877e18874 (diff) | |
| download | zig-a63f7875f451bda975ddabcc0c1feed10a216516.tar.gz zig-a63f7875f451bda975ddabcc0c1feed10a216516.zip | |
compiler: Fix build break due to #23836 being merged before #23913.
Diffstat (limited to 'src/libs')
| -rw-r--r-- | src/libs/netbsd.zig | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/libs/netbsd.zig b/src/libs/netbsd.zig index d225be64fb..1aba9da399 100644 --- a/src/libs/netbsd.zig +++ b/src/libs/netbsd.zig @@ -34,7 +34,7 @@ pub fn needsCrt0(output_mode: std.builtin.OutputMode) ?CrtFile { fn includePath(comp: *Compilation, arena: Allocator, sub_path: []const u8) ![]const u8 { return path.join(arena, &.{ - comp.zig_lib_directory.path.?, + comp.dirs.zig_lib.path.?, "libc" ++ path.sep_str ++ "include", sub_path, }); @@ -42,7 +42,7 @@ fn includePath(comp: *Compilation, arena: Allocator, sub_path: []const u8) ![]co fn csuPath(comp: *Compilation, arena: Allocator, sub_path: []const u8) ![]const u8 { return path.join(arena, &.{ - comp.zig_lib_directory.path.?, + comp.dirs.zig_lib.path.?, "libc" ++ path.sep_str ++ "netbsd" ++ path.sep_str ++ "lib" ++ path.sep_str ++ "csu", sub_path, }); @@ -383,11 +383,11 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye // Use the global cache directory. var cache: Cache = .{ .gpa = gpa, - .manifest_dir = try comp.global_cache_directory.handle.makeOpenPath("h", .{}), + .manifest_dir = try comp.dirs.global_cache.handle.makeOpenPath("h", .{}), }; cache.addPrefix(.{ .path = null, .handle = fs.cwd() }); - cache.addPrefix(comp.zig_lib_directory); - cache.addPrefix(comp.global_cache_directory); + cache.addPrefix(comp.dirs.zig_lib); + cache.addPrefix(comp.dirs.global_cache); defer cache.manifest_dir.close(); var man = cache.obtain(); @@ -397,7 +397,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye man.hash.add(target.abi); man.hash.add(target_version); - const full_abilists_path = try comp.zig_lib_directory.join(arena, &.{abilists_path}); + const full_abilists_path = try comp.dirs.zig_lib.join(arena, &.{abilists_path}); const abilists_index = try man.addFile(full_abilists_path, abilists_max_size); if (try man.hit()) { @@ -406,7 +406,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye return queueSharedObjects(comp, .{ .lock = man.toOwnedLock(), .dir_path = .{ - .root_dir = comp.global_cache_directory, + .root_dir = comp.dirs.global_cache, .sub_path = try gpa.dupe(u8, "o" ++ fs.path.sep_str ++ digest), }, }); @@ -415,9 +415,9 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye const digest = man.final(); const o_sub_path = try path.join(arena, &[_][]const u8{ "o", &digest }); - var o_directory: Compilation.Directory = .{ - .handle = try comp.global_cache_directory.handle.makeOpenPath(o_sub_path, .{}), - .path = try comp.global_cache_directory.join(arena, &.{o_sub_path}), + var o_directory: Cache.Directory = .{ + .handle = try comp.dirs.global_cache.handle.makeOpenPath(o_sub_path, .{}), + .path = try comp.dirs.global_cache.join(arena, &.{o_sub_path}), }; defer o_directory.handle.close(); @@ -626,7 +626,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye var lib_name_buf: [32]u8 = undefined; // Larger than each of the names "c", "pthread", etc. const asm_file_basename = std.fmt.bufPrint(&lib_name_buf, "{s}.s", .{lib.name}) catch unreachable; try o_directory.handle.writeFile(.{ .sub_path = asm_file_basename, .data = stubs_asm.items }); - try buildSharedLib(comp, arena, comp.global_cache_directory, o_directory, asm_file_basename, lib, prog_node); + try buildSharedLib(comp, arena, o_directory, asm_file_basename, lib, prog_node); } man.writeManifest() catch |err| { @@ -636,7 +636,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye return queueSharedObjects(comp, .{ .lock = man.toOwnedLock(), .dir_path = .{ - .root_dir = comp.global_cache_directory, + .root_dir = comp.dirs.global_cache, .sub_path = try gpa.dupe(u8, "o" ++ fs.path.sep_str ++ digest), }, }); @@ -675,8 +675,7 @@ fn queueSharedObjects(comp: *Compilation, so_files: BuiltSharedObjects) void { fn buildSharedLib( comp: *Compilation, arena: Allocator, - zig_cache_directory: Compilation.Directory, - bin_directory: Compilation.Directory, + bin_directory: Cache.Directory, asm_file_basename: []const u8, lib: Lib, prog_node: std.Progress.Node, @@ -708,9 +707,8 @@ fn buildSharedLib( }); const root_mod = try Module.create(arena, .{ - .global_cache_directory = comp.global_cache_directory, .paths = .{ - .root = .{ .root_dir = comp.zig_lib_directory }, + .root = .zig_lib_root, .root_src_path = "", }, .fully_qualified_name = "root", @@ -730,8 +728,6 @@ fn buildSharedLib( .global = config, .cc_argv = &.{}, .parent = null, - .builtin_mod = null, - .builtin_modules = null, // there is only one module in this compilation }); const c_source_files = [1]Compilation.CSourceFile{ @@ -742,9 +738,7 @@ fn buildSharedLib( }; const sub_compilation = try Compilation.create(comp.gpa, arena, .{ - .local_cache_directory = zig_cache_directory, - .global_cache_directory = comp.global_cache_directory, - .zig_lib_directory = comp.zig_lib_directory, + .dirs = comp.dirs.withoutLocalCache(), .thread_pool = comp.thread_pool, .self_exe_path = comp.self_exe_path, .cache_mode = .incremental, |
