authorgravatar for k4@noreply.codeberg.orgK4 <k4@noreply.codeberg.org> 2026-08-20 15:26:03+03:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-23 14:16:37+02:00
logdcceb318e0c39d8b463f5fd53eb0d6085c011b79
tree6eaa3f1339210c012766acaf9b1e6b6abb9ecdc0
parent2eadc2177a673c5ca5130d677c0eebca8a8eb981

std.DynLib: find libraries located in `/lib64` and `/usr/lib64`

Resolves https://github.com/ziglang/zig/issues/25906

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/dynamic_library.zig+2-2
......@@ -198,7 +198,6 @@ pub const ElfDynLib = struct {
198198 // - DT_RUNPATH of the calling binary is not used as a search path
199199 // - /etc/ld.so.cache is not read
200200 fn resolveFromName(io: Io, path_or_name: []const u8, LD_LIBRARY_PATH: ?[]const u8) !Io.File {
201 // If filename contains a slash ("/"), then it is interpreted as a (relative or absolute) pathname
202201 if (std.mem.findScalarPos(u8, path_or_name, 0, '/')) |_| {
203202 return Io.Dir.cwd().openFile(io, path_or_name, .{});
204203 }
......@@ -214,9 +213,10 @@ pub const ElfDynLib = struct {
214213 }
215214 }
216215
217 // Lastly the directories /lib and /usr/lib are searched (in this exact order)
218216 if (resolveFromParent(io, "/lib", path_or_name)) |file| return file;
217 if (resolveFromParent(io, "/lib64", path_or_name)) |file| return file;
219218 if (resolveFromParent(io, "/usr/lib", path_or_name)) |file| return file;
219 if (resolveFromParent(io, "/usr/lib64", path_or_name)) |file| return file;
220220 return error.FileNotFound;
221221 }
222222