From e324804cddf61c7e11eb5a64cfb60238af9b4f37 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 11 Aug 2024 16:21:03 +0200 Subject: [PATCH] Strip stack unwinding info from static binaries Saves another 70k on the x86_64 binary, more on x86. None of the included C or Zig code will unwind the stack at any point, so these sections seem pretty useless. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 9dce609..ad9d7f7 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,7 @@ static-%.tar.gz: cd static-$* && ${ZIG} build-exe -target $*\ -Iinst/include -Iinst/include/ncursesw -Izstd -lc inst/lib/libncursesw.a zstd/libzstd.a\ --cache-dir zig-cache -static -fstrip -O ReleaseFast ../src/main.zig + strip -R .eh_frame -R .eh_frame_hdr static-$*/main cd static-$* && mv main ncdu && tar -czf ../static-$*.tar.gz ncdu rm -rf static-$*