fix target_triple_zig to emit zig-compatible triples

This commit is contained in:
Andrew Kelley 2020-01-21 12:25:22 -05:00
parent 91ecce3bc0
commit 15d5cab569
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -831,14 +831,11 @@ void init_all_targets(void) {
void target_triple_zig(Buf *triple, const ZigTarget *target) { void target_triple_zig(Buf *triple, const ZigTarget *target) {
buf_resize(triple, 0); buf_resize(triple, 0);
const char *abi_name = target->abi == ZigLLVM_UnknownEnvironment ?
"none" : ZigLLVMGetEnvironmentTypeName(target->abi);
buf_appendf(triple, "%s%s-%s-%s", buf_appendf(triple, "%s%s-%s-%s",
ZigLLVMGetArchTypeName(target->arch), target_arch_name(target->arch),
ZigLLVMGetSubArchTypeName(target->sub_arch), target_subarch_name(target->sub_arch),
ZigLLVMGetOSTypeName(get_llvm_os_type(target->os)), target_os_name(target->os),
abi_name); target_abi_name(target->abi));
} }
void target_triple_llvm(Buf *triple, const ZigTarget *target) { void target_triple_llvm(Buf *triple, const ZigTarget *target) {