std.Target.Query: avoid using builtin.target.abi

This value is very likely incorrect. When glibc_version is provided but
no explicit ABI is provided, use the string "gnu" instead.
This commit is contained in:
Andrew Kelley 2024-02-01 15:44:01 -07:00
parent b3596d72b0
commit bd1d2b0ae2

View File

@ -468,7 +468,7 @@ pub fn zigTriple(self: Query, allocator: Allocator) Allocator.Error![]u8 {
}
if (self.glibc_version) |v| {
const name = @tagName(self.abi orelse builtin.target.abi);
const name = if (self.abi) |abi| @tagName(abi) else "gnu";
try result.ensureUnusedCapacity(name.len + 2);
result.appendAssumeCapacity('-');
result.appendSliceAssumeCapacity(name);