Skip to content

Commit 6b6931a

Browse files
committed
mips: implement Target.getStandardDynamicLinkerPath
1 parent 6c43279 commit 6b6931a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/std/target.zig

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,16 @@ pub const Target = struct {
11511151
.mipsel,
11521152
.mips64,
11531153
.mips64el,
1154-
=> return error.UnknownDynamicLinkerPath,
1154+
=> {
1155+
const lib_suffix = switch (self.abi) {
1156+
.gnuabin32, .gnux32 => "32",
1157+
.gnuabi64 => "64",
1158+
else => "",
1159+
};
1160+
const is_nan_2008 = mips.featureSetHas(self.cpu.features, .nan2008);
1161+
const loader = if (is_nan_2008) "ld-linux-mipsn8.so.1" else "ld.so.1";
1162+
return std.fmt.allocPrint0(a, "/lib{}/{}", .{ lib_suffix, loader });
1163+
},
11551164

11561165
.powerpc => return mem.dupeZ(a, u8, "/lib/ld.so.1"),
11571166
.powerpc64, .powerpc64le => return mem.dupeZ(a, u8, "/lib64/ld64.so.2"),

0 commit comments

Comments
 (0)