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 {...@@ -240,6 +240,15 @@ comptime {
240 @export(@import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });240 @export(@import("compiler_rt/arm/aeabi_dcmp.zig").__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });
241 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });241 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });
242 }242 }
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
243 if (builtin.os == .windows) {252 if (builtin.os == .windows) {
244 // Default stack-probe functions emitted by LLVM253 // Default stack-probe functions emitted by LLVM
245 if (is_mingw) {254 if (is_mingw) {
...@@ -258,13 +267,6 @@ comptime {...@@ -258,13 +267,6 @@ comptime {
258267
259 switch (builtin.arch) {268 switch (builtin.arch) {
260 .i386 => {269 .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
268 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });270 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });
269 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });271 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });
270 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });272 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });
...@@ -299,16 +301,12 @@ comptime {...@@ -299,16 +301,12 @@ comptime {
299 @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });301 @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
300}302}
301303
302const std = @import("std");
303const assert = std.debug.assert;
304const testing = std.testing;
305
306// Avoid dragging in the runtime safety mechanisms into this .o file,304// Avoid dragging in the runtime safety mechanisms into this .o file,
307// unless we're trying to test this file.305// unless we're trying to test this file.
308pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {306pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
309 @setCold(true);307 @setCold(true);
310 if (is_test) {308 if (is_test) {
311 std.debug.panic("{}", .{msg});309 @import("std").debug.panic("{}", .{msg});
312 } else {310 } else {
313 unreachable;311 unreachable;
314 }312 }