Skip to content

Commit

Permalink
reduce the output executable size further, from ~41KB to ~11KB, passi…
Browse files Browse the repository at this point in the history
…ng `-gc none` to V, and `-O3 -flto` to C
  • Loading branch information
spytheman committed Oct 2, 2023
1 parent 3c5c5c8 commit 7ad7fc0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vroom
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,14 @@ C_FILE=$OUTPUT_FILE.c

# Generating C file
echo "Generating C file..."
v $1 -skip-unused -o $C_FILE
v $1 -skip-unused -gc none -o $C_FILE

# Build it with clang
echo "Building..."
clang -Oz -s -w -fno-stack-protector -fno-math-errno \
clang -O3 -flto -s -w -fno-stack-protector -fno-math-errno \
-Wl,-z,norelro -Wl,--hash-style=gnu -fdata-sections \
-ffunction-sections -Wl,--build-id=none -Wl,--gc-sections \
-fno-unwind-tables -fno-asynchronous-unwind-tables \
-lgc \
$C_FILE -o $OUTPUT_FILE

# Echo strip the executable
Expand Down

0 comments on commit 7ad7fc0

Please sign in to comment.