mips: implement Target.getStandardDynamicLinkerPath

This commit is contained in:
Andrew Kelley 2020-02-26 18:56:43 -05:00
parent 34d2700af4
commit 7927764cc2
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -1151,7 +1151,16 @@ pub const Target = struct {
.mipsel,
.mips64,
.mips64el,
=> return error.UnknownDynamicLinkerPath,
=> {
const lib_suffix = switch (self.abi) {
.gnuabin32, .gnux32 => "32",
.gnuabi64 => "64",
else => "",
};
const is_nan_2008 = mips.featureSetHas(self.cpu.features, .nan2008);
const loader = if (is_nan_2008) "ld-linux-mipsn8.so.1" else "ld.so.1";
return std.fmt.allocPrint0(a, "/lib{}/{}", .{ lib_suffix, loader });
},
.powerpc => return mem.dupeZ(a, u8, "/lib/ld.so.1"),
.powerpc64, .powerpc64le => return mem.dupeZ(a, u8, "/lib64/ld64.so.2"),