From e0cb46124f8605b9ef4f9bf49973d75d3493223e Mon Sep 17 00:00:00 2001 From: Rawan10101 Date: Mon, 8 Jun 2026 09:55:29 +0300 Subject: [PATCH] build: add -flto for wasm32 to fix setjmp/longjmp with Emscripten --- build/lua.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build/lua.zig b/build/lua.zig index f89f771..5588d0f 100644 --- a/build/lua.zig +++ b/build/lua.zig @@ -75,6 +75,7 @@ pub fn configure( if (target.result.os.tag == .windows and shared) "-DLUA_BUILD_AS_DLL" else "", if (lua_user_h) |_| b.fmt("-DLUA_USER_H=\"{s}\"", .{user_header}) else "", + if (target.result.cpu.arch == .wasm32) "-flto" else "", }; const lua_source_files = switch (lang) {