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.
This commit is contained in:
Daniel Samson
2026-07-23 02:17:50 +01:00
parent 3af0110483
commit bf0c3fd3e0
+1
View File
@@ -191,6 +191,7 @@ fn addKernel(
.sanitize_c = .off, // the UBSan runtime needs f128/SSE support we don't provide .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_check = false, // stack-probe calls have no runtime to land in
.stack_protector = false, .stack_protector = false,
.strip = optimize != .Debug, // DWARF info doubles the flashable image; keep it only for debug builds
.imports = &.{ .imports = &.{
.{ .name = "boot-handoff", .module = modules.boot_handoff }, .{ .name = "boot-handoff", .module = modules.boot_handoff },
.{ .name = "abi", .module = modules.abi }, .{ .name = "abi", .module = modules.abi },