authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-13 19:21:38+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-06-17 16:38:59-07:00
log57c530155f0c7754386c50fb9bc128198cab705c
tree7c2dbe6453ce2b911171944f281719aae6ca381e
parent2259d629d3d4e361f78e4d1b79425dfae912f05c

compiler_rt: correctly export allrem and aullrem for i386-windows-msvc


4 files changed, 15 insertions(+), 2 deletions(-)

lib/compiler_rt.zig+1
......@@ -62,6 +62,7 @@ comptime {
6262 _ = @import("compiler_rt/emutls.zig");
6363 _ = @import("compiler_rt/arm.zig");
6464 _ = @import("compiler_rt/aulldiv.zig");
65 _ = @import("compiler_rt/aullrem.zig");
6566 _ = @import("compiler_rt/sparc.zig");
6667 _ = @import("compiler_rt/clear_cache.zig");
6768
lib/compiler_rt/aulldiv.zig-2
......@@ -10,8 +10,6 @@ comptime {
1010 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
1111 @export(_alldiv, .{ .name = "\x01__alldiv", .linkage = linkage });
1212 @export(_aulldiv, .{ .name = "\x01__aulldiv", .linkage = linkage });
13 @export(_allrem, .{ .name = "\x01__allrem", .linkage = linkage });
14 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = linkage });
1513 }
1614}
1715
lib/compiler_rt/aullrem.zig+13
......@@ -1,4 +1,17 @@
1const std = @import("std");
12const builtin = @import("builtin");
3const arch = builtin.cpu.arch;
4const abi = builtin.abi;
5const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) .Internal else .Strong;
6pub const panic = @import("common.zig").panic;
7
8comptime {
9 if (arch == .i386 and abi == .msvc) {
10 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
11 @export(_allrem, .{ .name = "\x01__allrem", .linkage = linkage });
12 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = linkage });
13 }
14}
215
316pub fn _allrem(a: i64, b: i64) callconv(.Stdcall) i64 {
417 @setRuntimeSafety(builtin.is_test);
src/compiler_rt.zig+1
......@@ -227,6 +227,7 @@ const sources = &[_][]const u8{
227227 "compiler_rt/emutls.zig",
228228 "compiler_rt/arm.zig",
229229 "compiler_rt/aulldiv.zig",
230 "compiler_rt/aullrem.zig",
230231 "compiler_rt/sparc.zig",
231232 "compiler_rt/clear_cache.zig",
232233};