From d3ba5f397d3270047bcf05c7ed21c5bd6b97e75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 22 Sep 2024 15:28:57 +0200 Subject: [PATCH] compiler-rt: Export extra soft float libcall names for thumb-windows-gnu. --- lib/compiler_rt/common.zig | 2 ++ lib/compiler_rt/fixdfdi.zig | 5 +++++ lib/compiler_rt/fixsfdi.zig | 5 +++++ lib/compiler_rt/fixunsdfdi.zig | 5 +++++ lib/compiler_rt/fixunssfdi.zig | 5 +++++ lib/compiler_rt/floatdidf.zig | 5 +++++ lib/compiler_rt/floatdisf.zig | 5 +++++ lib/compiler_rt/floatundidf.zig | 5 +++++ lib/compiler_rt/floatundisf.zig | 5 +++++ 9 files changed, 42 insertions(+) diff --git a/lib/compiler_rt/common.zig b/lib/compiler_rt/common.zig index 63fc48cbed95b7086f042830de8c672b5ef0301b..a6fd9533790a1fa420fa0c7902d8728b05da5d66 100644 --- a/lib/compiler_rt/common.zig +++ b/lib/compiler_rt/common.zig @@ -28,6 +28,8 @@ pub const want_aeabi = switch (builtin.abi) { }, else => false, }; +pub const want_mingw_arm_abi = builtin.cpu.arch.isArmOrThumb() and builtin.target.isMinGW(); + pub const want_ppc_abi = builtin.cpu.arch.isPowerPC(); pub const want_float_exceptions = !builtin.cpu.arch.isWasm(); diff --git a/lib/compiler_rt/fixdfdi.zig b/lib/compiler_rt/fixdfdi.zig index 78744b145d68017f878fd0cac94f8d8d2c73f01e..b9bc5797b9cb799cfd3619a1c178f2ba0b53dfdb 100644 --- a/lib/compiler_rt/fixdfdi.zig +++ b/lib/compiler_rt/fixdfdi.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const intFromFloat = @import("./int_from_float.zig").intFromFloat; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_d2lz, .{ .name = "__aeabi_d2lz", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__fixdfdi, .{ .name = "__fixdfdi", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__fixdfdi, .{ .name = "__dtoi64", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/fixsfdi.zig b/lib/compiler_rt/fixsfdi.zig index c75e4014754e8dc4873f779384959e5929dc90ba..192614bd7975f148d8d97ddcea2cee0a9728e915 100644 --- a/lib/compiler_rt/fixsfdi.zig +++ b/lib/compiler_rt/fixsfdi.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const intFromFloat = @import("./int_from_float.zig").intFromFloat; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_f2lz, .{ .name = "__aeabi_f2lz", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__fixsfdi, .{ .name = "__fixsfdi", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__fixsfdi, .{ .name = "__stoi64", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/fixunsdfdi.zig b/lib/compiler_rt/fixunsdfdi.zig index 68a0c44ff9a83fbd2cfd2439367ea3bf5ac4265f..86a4fa9de117877406c44844453dff9414e49efe 100644 --- a/lib/compiler_rt/fixunsdfdi.zig +++ b/lib/compiler_rt/fixunsdfdi.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const intFromFloat = @import("./int_from_float.zig").intFromFloat; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_d2ulz, .{ .name = "__aeabi_d2ulz", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__fixunsdfdi, .{ .name = "__fixunsdfdi", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__fixunsdfdi, .{ .name = "__dtou64", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/fixunssfdi.zig b/lib/compiler_rt/fixunssfdi.zig index 9157a71e2fdcfca8e35ca07127f34f488913bab2..81d1c77f06d1d935c3bb93c8f34124c73577d909 100644 --- a/lib/compiler_rt/fixunssfdi.zig +++ b/lib/compiler_rt/fixunssfdi.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const intFromFloat = @import("./int_from_float.zig").intFromFloat; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_f2ulz, .{ .name = "__aeabi_f2ulz", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__fixunssfdi, .{ .name = "__fixunssfdi", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__fixunssfdi, .{ .name = "__stou64", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/floatdidf.zig b/lib/compiler_rt/floatdidf.zig index 393fa95c1901f82586bd16a7a35f9a9deb6f7f8c..fc145e836de7c9974e69891b0d872dce7b7cf7da 100644 --- a/lib/compiler_rt/floatdidf.zig +++ b/lib/compiler_rt/floatdidf.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const floatFromInt = @import("./float_from_int.zig").floatFromInt; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_l2d, .{ .name = "__aeabi_l2d", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__floatdidf, .{ .name = "__floatdidf", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__floatdidf, .{ .name = "__i64tod", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/floatdisf.zig b/lib/compiler_rt/floatdisf.zig index 4f3b42ef7904199a2735823ab06bc55b584055c6..d1c9515f9a3e3a389121f0c89ede50922bbc37a4 100644 --- a/lib/compiler_rt/floatdisf.zig +++ b/lib/compiler_rt/floatdisf.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const floatFromInt = @import("./float_from_int.zig").floatFromInt; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_l2f, .{ .name = "__aeabi_l2f", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__floatdisf, .{ .name = "__floatdisf", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__floatdisf, .{ .name = "__i64tos", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/floatundidf.zig b/lib/compiler_rt/floatundidf.zig index 5cb1de0d355eb1961bc4d1c8c95c599884d90a1b..3448f0cf2047141946a3db61c26f26e9f5f1f2af 100644 --- a/lib/compiler_rt/floatundidf.zig +++ b/lib/compiler_rt/floatundidf.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const floatFromInt = @import("./float_from_int.zig").floatFromInt; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_ul2d, .{ .name = "__aeabi_ul2d", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__floatundidf, .{ .name = "__floatundidf", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__floatundidf, .{ .name = "__u64tod", .linkage = common.linkage, .visibility = common.visibility }); + } } } diff --git a/lib/compiler_rt/floatundisf.zig b/lib/compiler_rt/floatundisf.zig index 17f91485756c625f78146c5ed09257a5b28355b3..9054982b5409be8f212a99549799fa338204104a 100644 --- a/lib/compiler_rt/floatundisf.zig +++ b/lib/compiler_rt/floatundisf.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const common = @import("./common.zig"); const floatFromInt = @import("./float_from_int.zig").floatFromInt; @@ -8,6 +9,10 @@ comptime { @export(&__aeabi_ul2f, .{ .name = "__aeabi_ul2f", .linkage = common.linkage, .visibility = common.visibility }); } else { @export(&__floatundisf, .{ .name = "__floatundisf", .linkage = common.linkage, .visibility = common.visibility }); + + if (common.want_mingw_arm_abi) { + @export(&__floatundisf, .{ .name = "__u64tos", .linkage = common.linkage, .visibility = common.visibility }); + } } } -- 2.54.0