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 {...@@ -799,6 +799,7 @@ pub const Abi = enum {
799 simulator,799 simulator,
800 ohos,800 ohos,
801 ohoseabi,801 ohoseabi,
802 call0,
802803
803 // LLVM tags deliberately omitted:804 // LLVM tags deliberately omitted:
804 // - amplification805 // - amplification
lib/std/zig/LibCDirs.zig+1
...@@ -288,6 +288,7 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {...@@ -288,6 +288,7 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {
288 .msvc,288 .msvc,
289 .itanium,289 .itanium,
290 .simulator,290 .simulator,
291 .call0,
291 => unreachable,292 => unreachable,
292 }293 }
293}294}
lib/std/zig/system.zig+4
...@@ -460,6 +460,10 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target {...@@ -460,6 +460,10 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target {
460 if (result.cpu.arch.isArm() and result.abi.float() == .soft) {460 if (result.cpu.arch.isArm() and result.abi.float() == .soft) {
461 result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2));461 result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2));
462 }462 }
463
464 if (result.cpu.arch.isXtensa() and result.abi == .call0) {
465 result.cpu.features.removeFeature(@intFromEnum(Target.xtensa.Feature.windowed));
466 }
463 }467 }
464468
465 // It's possible that we detect the native ABI, but fail to detect the OS version or were told469 // 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...@@ -306,6 +306,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
306 .itanium => "itanium",306 .itanium => "itanium",
307 .simulator => "simulator",307 .simulator => "simulator",
308 .ohos, .ohoseabi => "ohos",308 .ohos, .ohoseabi => "ohos",
309 .call0 => "unknown",
309 };310 };
310 try llvm_triple.appendSlice(llvm_abi);311 try llvm_triple.appendSlice(llvm_abi);
311312
test/llvm_targets.zig+2
...@@ -344,7 +344,9 @@ const targets = [_]std.Target.Query{...@@ -344,7 +344,9 @@ const targets = [_]std.Target.Query{
344344
345 .{ .cpu_arch = .xcore, .os_tag = .freestanding, .abi = .none },345 .{ .cpu_arch = .xcore, .os_tag = .freestanding, .abi = .none },
346346
347 .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .call0 },
347 .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .none },348 .{ .cpu_arch = .xtensa, .os_tag = .freestanding, .abi = .none },
349 .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .call0 },
348 .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .none },350 .{ .cpu_arch = .xtensa, .os_tag = .linux, .abi = .none },
349};351};
350352