From e2a6c74c9afef9734a65549b0b55c63b437199b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20=C3=85stholm?= Date: Tue, 7 Apr 2026 22:20:04 +0200 Subject: [PATCH] Remove Emscripten stack protector exports Emscripten already supports SSP and exports the relevant symbols since version 3.1.64 (2024-07-22). --- lib/std/os/emscripten.zig | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/std/os/emscripten.zig b/lib/std/os/emscripten.zig index ba4d9082a00093a73160242aad84fcf4feabdd58..aa75916f21d1a439e3c608b8536c4cf76bccf022 100644 --- a/lib/std/os/emscripten.zig +++ b/lib/std/os/emscripten.zig @@ -11,22 +11,6 @@ const c = std.c; pub const FILE = c.FILE; -var __stack_chk_guard: usize = 0; -fn __stack_chk_fail() callconv(.c) void { - std.debug.print("stack smashing detected: terminated\n", .{}); - emscripten_force_exit(127); -} - -comptime { - if (builtin.os.tag == .emscripten) { - if (builtin.mode == .Debug or builtin.mode == .ReleaseSafe) { - // Emscripten does not provide these symbols, so we must export our own - @export(&__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = .strong }); - @export(&__stack_chk_fail, .{ .name = "__stack_chk_fail", .linkage = .strong }); - } - } -} - pub const PF = linux.PF; pub const AF = linux.AF; pub const CLOCK = linux.CLOCK; -- 2.54.0