Skip to content

Commit 5438b01

Browse files
committed
Compile with -opt s which produces a smaller binary
1 parent dd335d9 commit 5438b01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ jobs:
5454
id: rust-src
5555
run: |
5656
tar xzf rustc-${VERSION}-src.tar.xz
57+
# We don't need to compile dylibs here, only rlibs
58+
sed -i -e 's/crate-type = \["dylib", "rlib"\]/create-type = \["rlib"\]/' rustc-${VERSION}-src/library/std/Cargo.toml
5759
echo "path=$(realpath rustc-${VERSION}-src)" >> $GITHUB_OUTPUT
5860
5961
- name: Build rust std (iOS)
@@ -62,7 +64,7 @@ jobs:
6264
RUSTC_BOOTSTRAP: 1
6365
# This is required by compiler-builtins
6466
RUSTC_SRC: ${{ steps.rust-src.outputs.path }}
65-
RUSTFLAGS: "-C panic=abort -C opt-level=z -C llvm-args=--inline-threshold=225 -C codegen-units=1"
67+
RUSTFLAGS: "-C panic=abort -C opt-level=s -C llvm-args=--inline-threshold=225 -C codegen-units=1"
6668
IPHONEOS_DEPLOYMENT_TARGET: "14.0"
6769
run: |
6870
cd ${RUSTC_SRC}/library/std
@@ -77,7 +79,7 @@ jobs:
7779
env:
7880
RUSTC_BOOTSTRAP: 1
7981
RUSTC_SRC: ${{ steps.rust-src.outputs.path }}
80-
RUSTFLAGS: "-C panic=abort -C opt-level=z -C llvm-args=--inline-threshold=225 -C codegen-units=1"
82+
RUSTFLAGS: "-C panic=abort -C opt-level=s -C llvm-args=--inline-threshold=225 -C codegen-units=1"
8183
run: |
8284
cd ${RUSTC_SRC}/library/std
8385
# Set the path pointing to the NDK where all the cross-compiling clang binaries exist

0 commit comments

Comments
 (0)