From 480c3c4d0a61d13fea9b90f575a836d2ec1c1c29 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 3 Nov 2022 14:41:28 +0100 Subject: [PATCH 1/2] compiler_rt: fix duplicate symbol error when linking libc on arm64 Windows --- lib/compiler_rt/stack_probe.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/compiler_rt/stack_probe.zig b/lib/compiler_rt/stack_probe.zig index 5ebb851825..22f0f936ce 100644 --- a/lib/compiler_rt/stack_probe.zig +++ b/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) { From 34652038248ff209e4bee60bcd2d7299404b15fe Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 3 Nov 2022 15:07:31 +0100 Subject: [PATCH 2/2] libc: add support for arm64 msvc installation --- src/libc_installation.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libc_installation.zig b/src/libc_installation.zig index f9f6b37fba..58910ba12f 100644 --- a/src/libc_installation.zig +++ b/src/libc_installation.zig @@ -411,6 +411,7 @@ pub const LibCInstallation = struct { .i386 => "x86", .x86_64 => "x64", .arm, .armeb => "arm", + .aarch64 => "arm64", else => return error.UnsupportedArchitecture, }; @@ -474,6 +475,7 @@ pub const LibCInstallation = struct { .i386 => "x86", .x86_64 => "x64", .arm, .armeb => "arm", + .aarch64 => "arm64", else => return error.UnsupportedArchitecture, };