authorgravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2026-04-07 22:20:04+02:00
committergravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2026-04-07 22:20:04+02:00
loge2a6c74c9afef9734a65549b0b55c63b437199b4
tree03ab15b87ef082411eb63222f47b4659190f5405
parenta38c6bbcc4542dbae607536cdd9fde139c19863f

Remove Emscripten stack protector exports

Emscripten already supports SSP and exports the relevant symbols since version 3.1.64 (2024-07-22).

1 files changed, 0 insertions(+), 16 deletions(-)

lib/std/os/emscripten.zig-16
...@@ -11,22 +11,6 @@ const c = std.c;...@@ -11,22 +11,6 @@ const c = std.c;
1111
12pub const FILE = c.FILE;12pub const FILE = c.FILE;
1313
14var __stack_chk_guard: usize = 0;
15fn __stack_chk_fail() callconv(.c) void {
16 std.debug.print("stack smashing detected: terminated\n", .{});
17 emscripten_force_exit(127);
18}
19
20comptime {
21 if (builtin.os.tag == .emscripten) {
22 if (builtin.mode == .Debug or builtin.mode == .ReleaseSafe) {
23 // Emscripten does not provide these symbols, so we must export our own
24 @export(&__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = .strong });
25 @export(&__stack_chk_fail, .{ .name = "__stack_chk_fail", .linkage = .strong });
26 }
27 }
28}
29
30pub const PF = linux.PF;14pub const PF = linux.PF;
31pub const AF = linux.AF;15pub const AF = linux.AF;
32pub const CLOCK = linux.CLOCK;16pub const CLOCK = linux.CLOCK;