Skip to content

Commit 20fff4a

Browse files
authored
macOS: Remove unused functions at link time, ~1% smaller binaries (lovell#194)
1 parent 7e3e1d3 commit 20fff4a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build/lin.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ if [ "$LINUX" = true ]; then
5353
fi
5454

5555
if [ "$DARWIN" = true ]; then
56+
# Let macOS linker remove unused code
57+
export LDFLAGS+=" -Wl,-dead_strip"
5658
# Local rust installation
5759
export CARGO_HOME="${DEPS}/cargo"
5860
export RUSTUP_HOME="${DEPS}/rustup"

0 commit comments

Comments
 (0)