authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-21 17:17:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-23 16:27:39-07:00
log1c459032743caff33fad7d8d24471baafc0306a0
tree671217a23228df7790f28d81522ffd9c691e50b9
parent22948616ff8da42f9ae9d7b292d80a01537f2a7e

handle _fltused in compiler_rt

so we don't have to do an entire compilation unit for just this silly symbol

2 files changed, 8 insertions(+), 5 deletions(-)

lib/c.zig-4
......@@ -38,8 +38,6 @@ comptime {
3838 @export(&strncpy, .{ .name = "strncpy", .linkage = .strong });
3939 @export(&strcat, .{ .name = "strcat", .linkage = .strong });
4040 @export(&strncat, .{ .name = "strncat", .linkage = .strong });
41 } else if (is_msvc) {
42 @export(&_fltused, .{ .name = "_fltused", .linkage = .strong });
4341 }
4442}
4543
......@@ -62,8 +60,6 @@ fn wasm_start() callconv(.C) void {
6260 _ = main(0, undefined);
6361}
6462
65var _fltused: c_int = 1;
66
6763fn strcpy(dest: [*:0]u8, src: [*:0]const u8) callconv(.C) [*:0]u8 {
6864 var i: usize = 0;
6965 while (src[i] != 0) : (i += 1) {
lib/compiler_rt.zig+8-1
......@@ -1,6 +1,7 @@
11const builtin = @import("builtin");
2const common = @import("compiler_rt/common.zig");
23
3pub const panic = @import("compiler_rt/common.zig").panic;
4pub const panic = common.panic;
45
56comptime {
67 // Integer routines
......@@ -236,4 +237,10 @@ comptime {
236237 _ = @import("compiler_rt/bcmp.zig");
237238 _ = @import("compiler_rt/ssp.zig");
238239 }
240
241 if (!builtin.link_libc and builtin.abi == .msvc) {
242 @export(&_fltused, .{ .name = "_fltused", .linkage = common.linkage, .visibility = common.visibility });
243 }
239244}
245
246var _fltused: c_int = 1;