Commit bd1d2b0ae2

Andrew Kelley <andrew@ziglang.org>
2024-02-01 23:44:01
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.
1 parent b3596d7
Changed files (1)
lib
std
Target
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);