Commit 480c3c4d0a

Jakub Konka <kubkon@jakubkonka.com>
2022-11-03 14:41:28
compiler_rt: fix duplicate symbol error when linking libc on arm64 Windows
1 parent 57dbeb9
Changed files (1)
lib
compiler_rt
lib/compiler_rt/stack_probe.zig
@@ -18,15 +18,15 @@ comptime {
         if (is_mingw) {
             @export(_chkstk, .{ .name = "_alloca", .linkage = strong_linkage });
             @export(___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = strong_linkage });
+
+            if (arch.isAARCH64()) {
+                @export(__chkstk, .{ .name = "__chkstk", .linkage = strong_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 });
         }
-
-        if (arch.isAARCH64()) {
-            @export(__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage });
-        }
     }
 
     switch (arch) {