From 792eb2845705bf7f6ea0f66b3ec02fd4b2d227aa Mon Sep 17 00:00:00 2001 From: Michael Mikovsky <77305074+Astatin3@users.noreply.github.com> Date: Sat, 25 Apr 2026 11:36:10 -0600 Subject: [PATCH] Add back minimize profile --- Cargo.toml | 12 ++++++++++++ build.sh | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 63cccc6..5365f40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["trim-paths", "panic-immediate-abort"] + [workspace] members = [ "ush-obfuscate", @@ -45,6 +47,16 @@ chrono = { workspace = true, optional = true } # ush-obfuscate = { 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] elided_lifetimes_in_paths = "warn" future_incompatible = { level = "warn", priority = -1 } diff --git a/build.sh b/build.sh index 64d2b1a..86ccad0 100755 --- a/build.sh +++ b/build.sh @@ -8,9 +8,9 @@ set -e 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=( ".gnu_debuglink" # - Debug information link @@ -28,9 +28,9 @@ declare -a headers=( for section in "${headers[@]}" do strip --remove-section="$section" $BINARY - echo "Removed section header $section" + # echo "Removed section header $section" done -echo "## STARTING " +echo "Binary size: $(wc -c $BINARY)" -$BINARY +# $BINARY