zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit bde68fdebc468a9977f18a3f2ba8b2e69b58bac2 (tree)
parent 1f11eed3d132b5bdad544bf21afa222a8117f257
Author: mlugg <mlugg@mlugg.co.uk>
Date:   Tue, 15 Oct 2024 20:48:30 +0100

std.Target: correct C callconv on hardfloat ARM

Diffstat:
Mlib/std/Target.zig | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/std/Target.zig b/lib/std/Target.zig @@ -3048,7 +3048,13 @@ pub fn cCallingConvention(target: Target) ?std.builtin.CallingConvention { .windows => .{ .aarch64_aapcs_win = .{} }, else => .{ .aarch64_aapcs = .{} }, }, - .arm, .armeb, .thumb, .thumbeb => .{ .arm_aapcs = .{} }, + .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { + .netbsd => .{ .arm_apcs = .{} }, + else => switch (target.abi.floatAbi()) { + .soft => .{ .arm_aapcs = .{} }, + .hard => .{ .arm_aapcs_vfp = .{} }, + }, + }, .mips64, .mips64el => switch (target.abi) { .gnuabin32 => .{ .mips64_n32 = .{} }, else => .{ .mips64_n64 = .{} },