authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-01-18 23:50:00+01:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-01-19 00:12:27+01:00
log3247fd7862bc5277a2c931f56b41f4f7c085611c
tree2d4b9649c653bc34d8d44d35a63c82b5744b386c
parentae31da9334851dfca226ece1a66457d8df3e4abe

Export MSVC builtins inconditionally


1 files changed, 10 insertions(+), 12 deletions(-)

lib/std/special/compiler_rt.zig+10-12
......@@ -240,6 +240,15 @@ comptime {
240240 @export(@import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });
241241 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });
242242 }
243
244 if (builtin.arch == .i386 and builtin.abi == .msvc) {
245 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
246 @export(@import("compiler_rt/aulldiv.zig")._alldiv, .{ .name = "\x01__alldiv", .linkage = strong_linkage });
247 @export(@import("compiler_rt/aulldiv.zig")._aulldiv, .{ .name = "\x01__aulldiv", .linkage = strong_linkage });
248 @export(@import("compiler_rt/aullrem.zig")._allrem, .{ .name = "\x01__allrem", .linkage = strong_linkage });
249 @export(@import("compiler_rt/aullrem.zig")._aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });
250 }
251
243252 if (builtin.os == .windows) {
244253 // Default stack-probe functions emitted by LLVM
245254 if (is_mingw) {
......@@ -258,13 +267,6 @@ comptime {
258267
259268 switch (builtin.arch) {
260269 .i386 => {
261 // Don't let LLVM apply the stdcall name mangling on those MSVC
262 // builtin functions
263 @export(@import("compiler_rt/aulldiv.zig")._alldiv, .{ .name = "\x01__alldiv", .linkage = strong_linkage });
264 @export(@import("compiler_rt/aulldiv.zig")._aulldiv, .{ .name = "\x01__aulldiv", .linkage = strong_linkage });
265 @export(@import("compiler_rt/aullrem.zig")._allrem, .{ .name = "\x01__allrem", .linkage = strong_linkage });
266 @export(@import("compiler_rt/aullrem.zig")._aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });
267
268270 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });
269271 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });
270272 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });
......@@ -299,16 +301,12 @@ comptime {
299301 @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
300302}
301303
302const std = @import("std");
303const assert = std.debug.assert;
304const testing = std.testing;
305
306304// Avoid dragging in the runtime safety mechanisms into this .o file,
307305// unless we're trying to test this file.
308306pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
309307 @setCold(true);
310308 if (is_test) {
311 std.debug.panic("{}", .{msg});
309 @import("std").debug.panic("{}", .{msg});
312310 } else {
313311 unreachable;
314312 }