Skip to content

Instantly share code, notes, and snippets.

@dgellow
Created July 9, 2015 21:13
Show Gist options
  • Save dgellow/94dc3876cb5f811dc4ae to your computer and use it in GitHub Desktop.
Save dgellow/94dc3876cb5f811dc4ae to your computer and use it in GitHub Desktop.
MASSIVELY reduce nim binary size
FILE=life.nim
BINARY=life
function compile {
nim c -d:release --passC:-ffast-math --opt:size $FILE
}
function crunch {
strip --strip-all \
-R .note \
-R .comment \
-R .eh_frame \
-R .eh_frame_hdr \
$BINARY
sstrip -z $BINARY
}
function pack {
upx --ultra-brute $BINARY
}
compile
crunch
pack
ls -l $BINARY
@develooper1994
Copy link

--ultra-brute option breaks the binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment