rust-teeny(opt): optimize size further

This commit is contained in:
2026-06-16 21:38:40 +02:00
parent 74b82edd18
commit 5bc6a32c6a
3 changed files with 15 additions and 3 deletions
+12 -1
View File
@@ -11,7 +11,7 @@ build:
-Zlocation-detail=none -Zfmt-debug=none \
\
-Clinker=clang -Clink-arg=-fuse-ld=lld \
-Clink-arg=-Wl,--gc-sections -Clink-arg=-Wl,--strip-all \
-Clink-arg=-Wl,--gc-sections -Clink-arg=-Wl,--as-needed -Clink-arg=-Wl,--strip-all -Clink-arg=-Wl,--build-id=none \
\
-Cpanic=immediate-abort --remap-path-prefix=$PWD=[src] \
" cargo \
@@ -21,6 +21,17 @@ build:
\
b -r --target {{ target }}
# Base, does like nothing
strip --strip-all --strip-unneeded target/{{ target }}/release/rust-teeny
# BS, I don't want these
strip -R .comment -R .note.\* target/{{ target }}/release/rust-teeny
# Only OK because we don't do unwinding
strip -R .eh_frame\* target/{{ target }}/release/rust-teeny
# Not sure why .gnu.version and .gnu.hash don't break if I remove them in my machine, but that's very relative and its related to dynamic loading, but they could reduce size by `0.2 KiB`
stat:
stat target/{{ target }}/release/rust-teeny