| ... | ... | @@ -1164,10 +1164,10 @@ pub fn flushModule(self: *Elf, arena: Allocator, prog_node: *std.Progress.Node) |
| 1164 | 1164 | |
| 1165 | 1165 | success: { |
| 1166 | 1166 | if (!self.base.isStatic()) { |
| 1167 | | if (try self.accessLibPath(&test_path, &checked_paths, lc.crt_dir.?, lib_name, .Dynamic)) |
| 1167 | if (try self.accessLibPath(arena, &test_path, &checked_paths, lc.crt_dir.?, lib_name, .Dynamic)) |
| 1168 | 1168 | break :success; |
| 1169 | 1169 | } |
| 1170 | | if (try self.accessLibPath(&test_path, &checked_paths, lc.crt_dir.?, lib_name, .Static)) |
| 1170 | if (try self.accessLibPath(arena, &test_path, &checked_paths, lc.crt_dir.?, lib_name, .Static)) |
| 1171 | 1171 | break :success; |
| 1172 | 1172 | |
| 1173 | 1173 | try self.reportMissingLibraryError( |
| ... | ... | @@ -1997,10 +1997,10 @@ fn parseLdScript(self: *Elf, lib: SystemLib) ParseError!void { |
| 1997 | 1997 | // Maybe we should hoist search-strategy all the way here? |
| 1998 | 1998 | for (self.lib_dirs) |lib_dir| { |
| 1999 | 1999 | if (!self.base.isStatic()) { |
| 2000 | | if (try self.accessLibPath(&test_path, &checked_paths, lib_dir, lib_name, .Dynamic)) |
| 2000 | if (try self.accessLibPath(arena, &test_path, &checked_paths, lib_dir, lib_name, .Dynamic)) |
| 2001 | 2001 | break :success; |
| 2002 | 2002 | } |
| 2003 | | if (try self.accessLibPath(&test_path, &checked_paths, lib_dir, lib_name, .Static)) |
| 2003 | if (try self.accessLibPath(arena, &test_path, &checked_paths, lib_dir, lib_name, .Static)) |
| 2004 | 2004 | break :success; |
| 2005 | 2005 | } |
| 2006 | 2006 | } else { |
| ... | ... | @@ -2011,9 +2011,9 @@ fn parseLdScript(self: *Elf, lib: SystemLib) ParseError!void { |
| 2011 | 2011 | break :success; |
| 2012 | 2012 | } else |_| {} |
| 2013 | 2013 | |
| 2014 | | try checked_paths.append(try gpa.dupe(u8, scr_obj.path)); |
| 2014 | try checked_paths.append(try arena.dupe(u8, scr_obj.path)); |
| 2015 | 2015 | for (self.lib_dirs) |lib_dir| { |
| 2016 | | if (try self.accessLibPath(&test_path, &checked_paths, lib_dir, scr_obj.path, null)) |
| 2016 | if (try self.accessLibPath(arena, &test_path, &checked_paths, lib_dir, scr_obj.path, null)) |
| 2017 | 2017 | break :success; |
| 2018 | 2018 | } |
| 2019 | 2019 | } |
| ... | ... | @@ -2046,13 +2046,13 @@ fn parseLdScript(self: *Elf, lib: SystemLib) ParseError!void { |
| 2046 | 2046 | |
| 2047 | 2047 | fn accessLibPath( |
| 2048 | 2048 | self: *Elf, |
| 2049 | arena: Allocator, |
| 2049 | 2050 | test_path: *std.ArrayList(u8), |
| 2050 | 2051 | checked_paths: ?*std.ArrayList([]const u8), |
| 2051 | 2052 | lib_dir_path: []const u8, |
| 2052 | 2053 | lib_name: []const u8, |
| 2053 | 2054 | link_mode: ?std.builtin.LinkMode, |
| 2054 | 2055 | ) !bool { |
| 2055 | | const gpa = self.base.comp.gpa; |
| 2056 | 2056 | const sep = fs.path.sep_str; |
| 2057 | 2057 | const target = self.base.comp.root_mod.resolved_target.result; |
| 2058 | 2058 | test_path.clearRetainingCapacity(); |
| ... | ... | @@ -2068,7 +2068,7 @@ fn accessLibPath( |
| 2068 | 2068 | suffix, |
| 2069 | 2069 | }); |
| 2070 | 2070 | if (checked_paths) |cpaths| { |
| 2071 | | try cpaths.append(try gpa.dupe(u8, test_path.items)); |
| 2071 | try cpaths.append(try arena.dupe(u8, test_path.items)); |
| 2072 | 2072 | } |
| 2073 | 2073 | fs.cwd().access(test_path.items, .{}) catch |err| switch (err) { |
| 2074 | 2074 | error.FileNotFound => return false, |