Function glibcRuntimeTriple [src]
Returns the subdirectory triple to be used to find the correct glibc for the given arch, os,
and abi in an installation directory created by glibc's build-many-glibcs.py script.
os must be .linux or .hurd. abi must be a GNU ABI, i.e. .isGnu().
Prototype
pub fn glibcRuntimeTriple( allocator: Allocator, arch: std.Target.Cpu.Arch, os: std.Target.Os.Tag, abi: std.Target.Abi, ) Allocator.Error![]const u8
Parameters
allocator: Allocator
arch: std.Target.Cpu.Arch
os: std.Target.Os.Tag
abi: std.Target.Abi
Source
pub fn glibcRuntimeTriple(
allocator: Allocator,
arch: std.Target.Cpu.Arch,
os: std.Target.Os.Tag,
abi: std.Target.Abi,
) Allocator.Error![]const u8 {
assert(abi.isGnu());
for (available_libcs) |libc| {
if (libc.arch == arch and libc.os == os and libc.abi == abi) {
if (libc.glibc_triple) |triple| return allocator.dupe(u8, triple);
}
}
return switch (os) {
.hurd => std.Target.hurdTupleSimple(allocator, arch, abi),
.linux => std.Target.linuxTripleSimple(allocator, arch, os, abi),
else => unreachable,
};
}