From bf0c3fd3e08a4f334271157ce2cfbaf6d833552b Mon Sep 17 00:00:00 2001 From: Daniel Samson <12231216+daniel-samson@users.noreply.github.com> Date: Thu, 23 Jul 2026 02:17:50 +0100 Subject: [PATCH] kernel: strip debug info in non-Debug builds ReleaseSafe kept full DWARF/symtab because nothing set strip on the kernel module, bloating the flashable image to 2.4MB (~1.4MB of which was debug info). Strip for every optimize mode except Debug, so release builds shrink to ~900KB while debug builds keep symbols. --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 2631186..a6671ef 100644 --- a/build.zig +++ b/build.zig @@ -191,6 +191,7 @@ fn addKernel( .sanitize_c = .off, // the UBSan runtime needs f128/SSE support we don't provide .stack_check = false, // stack-probe calls have no runtime to land in .stack_protector = false, + .strip = optimize != .Debug, // DWARF info doubles the flashable image; keep it only for debug builds .imports = &.{ .{ .name = "boot-handoff", .module = modules.boot_handoff }, .{ .name = "abi", .module = modules.abi },