From a4b3e695af47a93788b265b0fc4a55d4dded1ef3 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 17:08:07 +0200 Subject: [PATCH] Shuffle around some stack-probing functions --- lib/std/special/compiler_rt.zig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index 902f2da2f..ec703afc9 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -234,14 +234,16 @@ comptime { @export("__aeabi_dcmpun", @import("compiler_rt/comparedf2.zig").__unorddf2, linkage); } if (builtin.os == .windows) { - if (!builtin.link_libc) { + // Default stack-probe functions emitted by LLVM + if (is_mingw) { + @export("_alloca", @import("compiler_rt/stack_probe.zig")._chkstk, strong_linkage); + @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); + } else { @export("_chkstk", @import("compiler_rt/stack_probe.zig")._chkstk, strong_linkage); @export("__chkstk", @import("compiler_rt/stack_probe.zig").__chkstk, strong_linkage); - @export("___chkstk", @import("compiler_rt/stack_probe.zig").___chkstk, strong_linkage); - @export("__chkstk_ms", @import("compiler_rt/stack_probe.zig").__chkstk_ms, strong_linkage); - @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); - } else if (is_mingw) { - @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); + } + + if (is_mingw) { @export("__stack_chk_fail", __stack_chk_fail, strong_linkage); @export("__stack_chk_guard", __stack_chk_guard, strong_linkage); }