Add back minimize profile

This commit is contained in:
Michael Mikovsky
2026-04-25 11:36:10 -06:00
parent 6bdf59c5c9
commit 792eb28457
2 changed files with 17 additions and 5 deletions
+12
View File
@@ -1,3 +1,5 @@
cargo-features = ["trim-paths", "panic-immediate-abort"]
[workspace] [workspace]
members = [ members = [
"ush-obfuscate", "ush-obfuscate",
@@ -45,6 +47,16 @@ chrono = { workspace = true, optional = true }
# ush-obfuscate = { workspace = true } # ush-obfuscate = { workspace = true }
static_init = { workspace = true } static_init = { workspace = true }
[profile.minimize]
inherits = "release"
strip = true # Strip symbols from the binary
opt-level = "z" # Optimize for size
lto = true # Link tree optimization
codegen-units = 1
panic = "immediate-abort"
debug = false # Remove debug
trim-paths="all"
[lints.rust] [lints.rust]
elided_lifetimes_in_paths = "warn" elided_lifetimes_in_paths = "warn"
future_incompatible = { level = "warn", priority = -1 } future_incompatible = { level = "warn", priority = -1 }
+5 -5
View File
@@ -8,9 +8,9 @@
set -e set -e
OBFUSCATION_KEY=kjwerkwerkjbwejehrwhje \ OBFUSCATION_KEY=kjwerkwerkjbwejehrwhje \
cargo build --profile minimize -p ush-payload $@ cargo build --profile minimize -p treetest $@
export BINARY=./target/minimize/ush-payload export BINARY=./target/minimize/treetest
declare -a headers=( declare -a headers=(
".gnu_debuglink" # - Debug information link ".gnu_debuglink" # - Debug information link
@@ -28,9 +28,9 @@ declare -a headers=(
for section in "${headers[@]}" for section in "${headers[@]}"
do do
strip --remove-section="$section" $BINARY strip --remove-section="$section" $BINARY
echo "Removed section header $section" # echo "Removed section header $section"
done done
echo "## STARTING " echo "Binary size: $(wc -c $BINARY)"
$BINARY # $BINARY