authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-25 14:24:46+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-26 19:12:24+02:00
log474e9082244b7d2e7e0d978b40b16bcbe21c5918
tree81785f68b531bc3b110b379e5c1092d9ac3efe50
parent1b7a78122ecf9d5f6d36b46c26bd5e3fb8211eea
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler-rt: remove some @export usage in favor of symbol()


3 files changed, 5 insertions(+), 21 deletions(-)

lib/compiler_rt/memcpy.zig+2-10
......@@ -1,20 +1,12 @@
11const std = @import("std");
22const assert = std.debug.assert;
33const compiler_rt = @import("../compiler_rt.zig");
4const symbol = compiler_rt.symbol;
45const builtin = @import("builtin");
56
67comptime {
78 if (builtin.object_format != .c) {
8 const export_options: std.builtin.ExportOptions = .{
9 .name = "memcpy",
10 .linkage = compiler_rt.linkage,
11 .visibility = compiler_rt.visibility,
12 };
13
14 if (builtin.mode == .small or builtin.zig_backend == .stage2_aarch64)
15 @export(&memcpySmall, export_options)
16 else
17 @export(&memcpyFast, export_options);
9 symbol(if (builtin.mode == .small or builtin.zig_backend == .stage2_aarch64) &memcpySmall else &memcpyFast, "memcpy");
1810 }
1911}
2012
lib/compiler_rt/memmove.zig+2-10
......@@ -1,5 +1,6 @@
11const std = @import("std");
22const compiler_rt = @import("../compiler_rt.zig");
3const symbol = compiler_rt.symbol;
34const builtin = @import("builtin");
45const assert = std.debug.assert;
56const memcpy = @import("memcpy.zig");
......@@ -8,16 +9,7 @@ const Element = compiler_rt.PreferredLoadStoreElement;
89
910comptime {
1011 if (builtin.object_format != .c) {
11 const export_options: std.builtin.ExportOptions = .{
12 .name = "memmove",
13 .linkage = compiler_rt.linkage,
14 .visibility = compiler_rt.visibility,
15 };
16
17 if (builtin.mode == .small or builtin.zig_backend == .stage2_aarch64)
18 @export(&memmoveSmall, export_options)
19 else
20 @export(&memmoveFast, export_options);
12 symbol(if (builtin.mode == .small or builtin.zig_backend == .stage2_aarch64) &memmoveSmall else &memmoveFast, "memmove");
2113 }
2214}
2315
lib/compiler_rt/ssp.zig+1-1
......@@ -22,7 +22,7 @@ extern fn memcpy(noalias dest: ?[*]u8, noalias src: ?[*]const u8, n: usize) call
2222extern fn memmove(dest: ?[*]u8, src: ?[*]const u8, n: usize) callconv(.c) ?[*]u8;
2323
2424comptime {
25 @export(&__stack_chk_fail, .{ .name = if (builtin.os.tag == .openbsd) "__stack_smash_handler" else "__stack_chk_fail", .linkage = compiler_rt.linkage, .visibility = compiler_rt.visibility });
25 symbol(&__stack_chk_fail, if (builtin.os.tag == .openbsd) "__stack_smash_handler" else "__stack_chk_fail");
2626 symbol(&__chk_fail, "__chk_fail");
2727 symbol(&__stack_chk_guard, if (builtin.os.tag == .openbsd) "__guard_local" else "__stack_chk_guard");
2828 symbol(&__strcpy_chk, "__strcpy_chk");