From bd1d2b0ae25ead6cd27c0bfeb65490ee92f06bad Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 1 Feb 2024 15:44:01 -0700 Subject: [PATCH] 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. --- lib/std/Target/Query.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Target/Query.zig b/lib/std/Target/Query.zig index 10130e03bb..e54ac0c3c6 100644 --- a/lib/std/Target/Query.zig +++ b/lib/std/Target/Query.zig @@ -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);