From 45be80364659332807b527670514332a4b835f84 Mon Sep 17 00:00:00 2001 From: Ryan Sepassi Date: Thu, 11 Jul 2024 13:20:06 -0700 Subject: [PATCH] Update `__chkstk_ms` to have weak linkage (#20138) * Update `__chkstk_ms` to have weak linkage `__chkstk_ms` was causing conflicts during linking in some circumstances (specifically with linking object files from Rust sources). This PR switches `__chkstk_ms` to have weak linkage. #15107 * Update stack_probe.zig to weak linkage for all symbols --- lib/compiler_rt/stack_probe.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/compiler_rt/stack_probe.zig b/lib/compiler_rt/stack_probe.zig index 5533464dcd36e62eeb53077e274fcbfa339e97e6..21e41574cc3d8b57b9e4922d1c1ab9df9f50c8ba 100644 --- a/lib/compiler_rt/stack_probe.zig +++ b/lib/compiler_rt/stack_probe.zig @@ -16,16 +16,16 @@ comptime { if (builtin.os.tag == .windows) { // Default stack-probe functions emitted by LLVM if (is_mingw) { - @export(_chkstk, .{ .name = "_alloca", .linkage = strong_linkage }); - @export(___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = strong_linkage }); + @export(_chkstk, .{ .name = "_alloca", .linkage = linkage }); + @export(___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = linkage }); if (arch.isAARCH64()) { - @export(__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage }); + @export(__chkstk, .{ .name = "__chkstk", .linkage = linkage }); } } else if (!builtin.link_libc) { // This symbols are otherwise exported by MSVCRT.lib - @export(_chkstk, .{ .name = "_chkstk", .linkage = strong_linkage }); - @export(__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage }); + @export(_chkstk, .{ .name = "_chkstk", .linkage = linkage }); + @export(__chkstk, .{ .name = "__chkstk", .linkage = linkage }); } } -- 2.54.0