authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-23 12:35:38+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-23 15:51:46+02:00
logb86841244421da7001a070e9515e57223f695674
tree2827f9a0425b851d2f95315aa1c28c6b0065d0e6
parentd591145f5dcab5aba1ab6aa65e7a57663f3a0f19

std.Target: add Abi.call0 for xtensa

closes https://codeberg.org/ziglang/zig/issues/30950

5 files changed, 9 insertions(+), 0 deletions(-)

lib/std/Target.zig+1
......@@ -799,6 +799,7 @@ pub const Abi = enum {
799799 simulator,
800800 ohos,
801801 ohoseabi,
802 call0,
802803
803804 // LLVM tags deliberately omitted:
804805 // - amplification
lib/std/zig/LibCDirs.zig+1
......@@ -288,6 +288,7 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {
288288 .msvc,
289289 .itanium,
290290 .simulator,
291 .call0,
291292 => unreachable,
292293 }
293294}
lib/std/zig/system.zig+4
......@@ -460,6 +460,10 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target {
460460 if (result.cpu.arch.isArm() and result.abi.float() == .soft) {
461461 result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2));
462462 }
463
464 if (result.cpu.arch.isXtensa() and result.abi == .call0) {
465 result.cpu.features.removeFeature(@intFromEnum(Target.xtensa.Feature.windowed));
466 }
463467 }
464468
465469 // It's possible that we detect the native ABI, but fail to detect the OS version or were told
src/codegen/llvm.zig+1
......@@ -306,6 +306,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
306306 .itanium => "itanium",
307307 .simulator => "simulator",
308308 .ohos, .ohoseabi => "ohos",
309 .call0 => "unknown",
309310 };
310311 try llvm_triple.appendSlice(llvm_abi);
311312
test/llvm_targets.zig+2
......@@ -344,7 +344,9 @@ const targets = [_]std.Target.Query{
344344
345345 .{ .cpu_arch = .xcore, .os_tag = .freestanding, .abi = .none },
346346
347 .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .call0 },
347348 .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .none },
349 .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .call0 },
348350 .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .none },
349351};
350352