Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

glibcRuntimeTriple

Public Function
std.zig.target.glibcRuntimeTriple
pub fn glibcRuntimeTriple(
    allocator: Allocator,
    arch: std.Target.Cpu.Arch,
    os: std.Target.Os.Tag,
    abi: std.Target.Abi,
) Allocator.Error![]const u8

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().

Params

File

zig/target.zig:175
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
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 => hurdTupleSimple(allocator, arch, abi),
        .linux => linuxTripleSimple(allocator, arch, os, abi),
        else => unreachable,
    };
}