compiler-rt: Fix some exports for *-windows-none.

This commit is contained in:
Alex Rønne Petersen 2025-05-29 15:32:32 +02:00
parent 7cae6b8fa7
commit 358ee859ba
No known key found for this signature in database
4 changed files with 8 additions and 3 deletions

View file

@ -260,7 +260,7 @@ comptime {
_ = @import("compiler_rt/ssp.zig"); _ = @import("compiler_rt/ssp.zig");
} }
if (!builtin.link_libc and builtin.abi == .msvc) { if (!builtin.link_libc and builtin.os.tag == .windows and (builtin.abi == .none or builtin.abi == .msvc)) {
@export(&_fltused, .{ .name = "_fltused", .linkage = common.linkage, .visibility = common.visibility }); @export(&_fltused, .{ .name = "_fltused", .linkage = common.linkage, .visibility = common.visibility });
} }
} }

View file

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

View file

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

View file

@ -52,6 +52,11 @@ pub const want_aeabi = switch (builtin.abi) {
// Temporarily used for thumb-uefi until https://github.com/ziglang/zig/issues/21630 is addressed. // Temporarily used for thumb-uefi until https://github.com/ziglang/zig/issues/21630 is addressed.
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); 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);
pub const want_windows_msvc_or_itanium_abi = switch (builtin.abi) {
.none, .msvc, .itanium => builtin.os.tag == .windows,
else => false,
};
pub const want_ppc_abi = builtin.cpu.arch.isPowerPC(); pub const want_ppc_abi = builtin.cpu.arch.isPowerPC();
pub const want_float_exceptions = !builtin.cpu.arch.isWasm(); pub const want_float_exceptions = !builtin.cpu.arch.isWasm();