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.
This commit is contained in:
Yorhel 2024-08-11 16:21:03 +02:00
parent 26229d7a63
commit e324804cdd

View file

@ -85,6 +85,7 @@ static-%.tar.gz:
cd static-$* && ${ZIG} build-exe -target $*\ cd static-$* && ${ZIG} build-exe -target $*\
-Iinst/include -Iinst/include/ncursesw -Izstd -lc inst/lib/libncursesw.a zstd/libzstd.a\ -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 --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 cd static-$* && mv main ncdu && tar -czf ../static-$*.tar.gz ncdu
rm -rf static-$* rm -rf static-$*