Skip to content

Commit 2ff4845

Browse files
bjorn3folkertdev
authored andcommitted
Use LTO to optimize personality function references away in the cdylib
1 parent 94ff81f commit 2ff4845

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libbz2-rs-sys-cdylib/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ name = "libbz2_rs"
3939
filename = "libbz2_rs"
4040

4141
# no_std requires panic=abort
42+
# Also use lto to optimize away references to rust_eh_personality on targets
43+
# that are not no_std. On no_std targets rust_eh_personality is not referenced
44+
# in the first place.
4245
[profile.dev]
4346
panic = "abort"
47+
lto = "thin"
48+
opt-level = 1
4449

4550
[profile.release]
4651
panic = "abort"
52+
lto = "thin"

0 commit comments

Comments
 (0)