mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
zig targets prints the available libcs
This commit is contained in:
parent
af9ac0d548
commit
3c36929603
@ -8649,7 +8649,50 @@ C ABIs:
|
||||
itanium
|
||||
cygnus
|
||||
coreclr
|
||||
simulator</code></pre>
|
||||
simulator
|
||||
|
||||
Available libcs:
|
||||
aarch64_be-linux-gnu
|
||||
aarch64_be-linux-musl
|
||||
aarch64-linux-gnu
|
||||
aarch64-linux-musleabi
|
||||
armeb-linux-gnueabi
|
||||
armeb-linux-gnueabihf
|
||||
armeb-linux-musleabi
|
||||
armeb-linux-musleabihf
|
||||
arm-linux-gnueabi
|
||||
arm-linux-gnueabihf
|
||||
arm-linux-musleabi
|
||||
arm-linux-musleabihf
|
||||
i386-linux-gnu
|
||||
i386-linux-musl
|
||||
mips64el-linux-gnuabi64
|
||||
mips64el-linux-gnuabin32
|
||||
mips64el-linux-musl
|
||||
mips64-linux-gnuabi64
|
||||
mips64-linux-gnuabin32
|
||||
mips64-linux-musl
|
||||
mipsel-linux-gnu
|
||||
mipsel-linux-musl
|
||||
mips-linux-gnu
|
||||
mips-linux-musl
|
||||
nios2-linux-gnu
|
||||
powerpc64le-linux-gnu
|
||||
powerpc64le-linux-musl
|
||||
powerpc64-linux-gnu
|
||||
powerpc64-linux-musl
|
||||
powerpc-linux-gnu
|
||||
powerpc-linux-musl
|
||||
riscv32-linux-musl
|
||||
riscv64-linux-gnu
|
||||
riscv64-linux-musl
|
||||
s390x-linux-gnu
|
||||
s390x-linux-musl
|
||||
sparc-linux-gnu
|
||||
sparcv9-linux-gnu
|
||||
x86_64-linux-gnu
|
||||
x86_64-linux-gnux32
|
||||
x86_64-linux-musl</code></pre>
|
||||
<p>
|
||||
The Zig Standard Library ({#syntax#}@import("std"){#endsyntax#}) has architecture, environment, and operating system
|
||||
abstractions, and thus takes additional work to support more platforms.
|
||||
|
@ -191,6 +191,15 @@ static int print_target_list(FILE *f) {
|
||||
fprintf(f, " %s%s\n", target_abi_name(abi), native_str);
|
||||
}
|
||||
|
||||
fprintf(f, "\nAvailable libcs:\n");
|
||||
size_t libc_count = target_libc_count();
|
||||
for (size_t i = 0; i < libc_count; i += 1) {
|
||||
ZigTarget libc_target;
|
||||
target_libc_enum(i, &libc_target);
|
||||
fprintf(f, " %s-%s-%s\n", target_arch_name(libc_target.arch),
|
||||
target_os_name(libc_target.os), target_abi_name(libc_target.abi));
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1498,3 +1498,17 @@ bool target_is_libc_lib_name(const ZigTarget *target, const char *name) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t target_libc_count(void) {
|
||||
return array_length(libcs_available);
|
||||
}
|
||||
|
||||
void target_libc_enum(size_t index, ZigTarget *out_target) {
|
||||
assert(index < array_length(libcs_available));
|
||||
out_target->arch = libcs_available[index].arch;
|
||||
out_target->os = libcs_available[index].os;
|
||||
out_target->abi = libcs_available[index].abi;
|
||||
out_target->sub_arch = ZigLLVM_NoSubArch;
|
||||
out_target->vendor = ZigLLVM_UnknownVendor;
|
||||
out_target->is_native = false;
|
||||
}
|
||||
|
@ -169,4 +169,7 @@ bool target_is_musl(const ZigTarget *target);
|
||||
|
||||
uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);
|
||||
|
||||
size_t target_libc_count(void);
|
||||
void target_libc_enum(size_t index, ZigTarget *out_target);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user