authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-07 17:41:20-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-07 17:44:49-07:00
log663b67783e3e140fcaf06747f4aa28b57259023c
tree225da9aec9bbcd99ed33617d0f05a56907e261c0
parentaa05cd48097b42d0c52ff5e0f3dd1ece68d1cdcd

compiler-rt: avoid symbol collisions with Windows libc

closes #11600

1 files changed, 7 insertions(+), 7 deletions(-)

lib/compiler_rt.zig+7-7
......@@ -724,24 +724,24 @@ comptime {
724724 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });
725725 }
726726
727 mathExport("ceil", @import("./compiler_rt/ceil.zig"), true);
727 mathExport("ceil", @import("./compiler_rt/ceil.zig"), false);
728728 mathExport("cos", @import("./compiler_rt/cos.zig"), true);
729729 mathExport("exp", @import("./compiler_rt/exp.zig"), true);
730730 mathExport("exp2", @import("./compiler_rt/exp2.zig"), true);
731731 mathExport("fabs", @import("./compiler_rt/fabs.zig"), true);
732 mathExport("floor", @import("./compiler_rt/floor.zig"), true);
732 mathExport("floor", @import("./compiler_rt/floor.zig"), false);
733733 mathExport("fma", @import("./compiler_rt/fma.zig"), true);
734734 mathExport("fmax", @import("./compiler_rt/fmax.zig"), true);
735735 mathExport("fmin", @import("./compiler_rt/fmin.zig"), true);
736736 mathExport("fmod", @import("./compiler_rt/fmod.zig"), true);
737737 mathExport("log", @import("./compiler_rt/log.zig"), true);
738 mathExport("log10", @import("./compiler_rt/log10.zig"), true);
738 mathExport("log10", @import("./compiler_rt/log10.zig"), false);
739739 mathExport("log2", @import("./compiler_rt/log2.zig"), true);
740740 mathExport("round", @import("./compiler_rt/round.zig"), true);
741741 mathExport("sin", @import("./compiler_rt/sin.zig"), true);
742742 mathExport("sincos", @import("./compiler_rt/sincos.zig"), true);
743743 mathExport("sqrt", @import("./compiler_rt/sqrt.zig"), true);
744 mathExport("tan", @import("./compiler_rt/tan.zig"), false);
744 mathExport("tan", @import("./compiler_rt/tan.zig"), true);
745745 mathExport("trunc", @import("./compiler_rt/trunc.zig"), true);
746746
747747 if (arch.isSPARC()) {
......@@ -825,7 +825,7 @@ comptime {
825825 }
826826}
827827
828inline fn mathExport(double_name: []const u8, comptime import: type, is_standard: bool) void {
828inline fn mathExport(double_name: []const u8, comptime import: type, win_libc_has_it: bool) void {
829829 const half_name = "__" ++ double_name ++ "h";
830830 const half_fn = @field(import, half_name);
831831 const float_name = double_name ++ "f";
......@@ -855,7 +855,7 @@ inline fn mathExport(double_name: []const u8, comptime import: type, is_standard
855855
856856 // Weak aliases don't work on Windows, so we avoid exporting the `l` alias
857857 // on this platform for functions we know will collide.
858 if (builtin.os.tag != .windows or !builtin.link_libc or !is_standard) {
858 if (builtin.os.tag != .windows or !builtin.link_libc or !win_libc_has_it) {
859859 inline for (pairs) |pair| {
860860 const F = pair[0];
861861 const func = pair[1];
......@@ -865,7 +865,7 @@ inline fn mathExport(double_name: []const u8, comptime import: type, is_standard
865865 }
866866 }
867867
868 if (is_ppc and is_standard) {
868 if (is_ppc) {
869869 // LLVM PPC backend lowers f128 ops with the suffix `f128` instead of `l`.
870870 @export(quad_fn, .{ .name = double_name ++ "f128", .linkage = linkage });
871871 }