From b3f3db46bec83bd467f4e0759ab58965aa3a8459 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 2 Oct 2017 00:22:24 -0400 Subject: [PATCH] compiler-rt: strong linkage for __chkstk otherwise we get undefined symbol errors --- std/special/compiler_rt/index.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/std/special/compiler_rt/index.zig b/std/special/compiler_rt/index.zig index 4512c80c11..36ad997120 100644 --- a/std/special/compiler_rt/index.zig +++ b/std/special/compiler_rt/index.zig @@ -27,6 +27,7 @@ const win64 = builtin.os == builtin.Os.windows and builtin.arch == builtin.Arch. const win32_nocrt = win32 and !builtin.link_libc; const win64_nocrt = win64 and !builtin.link_libc; const linkage = if (builtin.is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.LinkOnce; +const strong_linkage = if (builtin.is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Strong; const __udivmoddi4 = @import("udivmoddi4.zig").__udivmoddi4; @@ -125,7 +126,7 @@ export nakedcc fn _chkstk() align(4) { @setDebugSafety(this, false); if (win32_nocrt) { - @setGlobalLinkage(_chkstk, linkage); + @setGlobalLinkage(_chkstk, strong_linkage); asm volatile ( \\ push %%ecx \\ cmp $0x1000,%%eax @@ -158,7 +159,7 @@ export nakedcc fn __chkstk() align(4) { @setDebugSafety(this, false); if (win64_nocrt) { - @setGlobalLinkage(__chkstk, linkage); + @setGlobalLinkage(__chkstk, strong_linkage); asm volatile ( \\ push %%rcx \\ cmp $0x1000,%%rax