Skip to content

Commit 358ee85

Browse files
committed
compiler-rt: Fix some exports for *-windows-none.
1 parent 7cae6b8 commit 358ee85

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

lib/compiler_rt.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ comptime {
260260
_ = @import("compiler_rt/ssp.zig");
261261
}
262262

263-
if (!builtin.link_libc and builtin.abi == .msvc) {
263+
if (!builtin.link_libc and builtin.os.tag == .windows and (builtin.abi == .none or builtin.abi == .msvc)) {
264264
@export(&_fltused, .{ .name = "_fltused", .linkage = common.linkage, .visibility = common.visibility });
265265
}
266266
}

lib/compiler_rt/aulldiv.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const common = @import("common.zig");
88
pub const panic = common.panic;
99

1010
comptime {
11-
if (arch == .x86 and os == .windows and (abi == .msvc or abi == .itanium) and !builtin.link_libc) {
11+
if (arch == .x86 and common.want_windows_msvc_or_itanium_abi and !builtin.link_libc) {
1212
// Don't let LLVM apply the stdcall name mangling on those MSVC builtins
1313
@export(&_alldiv, .{ .name = "\x01__alldiv", .linkage = common.linkage, .visibility = common.visibility });
1414
@export(&_aulldiv, .{ .name = "\x01__aulldiv", .linkage = common.linkage, .visibility = common.visibility });

lib/compiler_rt/aullrem.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const common = @import("common.zig");
88
pub const panic = common.panic;
99

1010
comptime {
11-
if (arch == .x86 and os == .windows and (abi == .msvc or abi == .itanium) and !builtin.link_libc) {
11+
if (arch == .x86 and common.want_windows_msvc_or_itanium_abi and !builtin.link_libc) {
1212
// Don't let LLVM apply the stdcall name mangling on those MSVC builtins
1313
@export(&_allrem, .{ .name = "\x01__allrem", .linkage = common.linkage, .visibility = common.visibility });
1414
@export(&_aullrem, .{ .name = "\x01__aullrem", .linkage = common.linkage, .visibility = common.visibility });

lib/compiler_rt/common.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ pub const want_aeabi = switch (builtin.abi) {
5252
// Temporarily used for thumb-uefi until https://github.com/ziglang/zig/issues/21630 is addressed.
5353
pub const want_windows_arm_abi = builtin.cpu.arch.isArm() and (builtin.os.tag == .windows or builtin.os.tag == .uefi) and (builtin.abi.isGnu() or !builtin.link_libc);
5454

55+
pub const want_windows_msvc_or_itanium_abi = switch (builtin.abi) {
56+
.none, .msvc, .itanium => builtin.os.tag == .windows,
57+
else => false,
58+
};
59+
5560
pub const want_ppc_abi = builtin.cpu.arch.isPowerPC();
5661

5762
pub const want_float_exceptions = !builtin.cpu.arch.isWasm();

0 commit comments

Comments
 (0)