Cdylib and rlib together in crate-type


#1

I have a rust project that is intended for android and ios app.
currently, im on nightly, and i chose the create-types = [“rlib”, “cdylib”].
the output .so files is 1.8 MB, however, if i remove rlib from the crates-type, it comes down to 376 KB.

is this expected??? feels a bit weird that different targets actually interfere with each other?

im on:
rustc 1.11.0-nightly (bb4a79b08 2016-06-15)
cargo 0.12.0-nightly (5a26b65 2016-06-14)

compiling for arm-linux-androideabi
ndk version: android-ndk-r10e/ndk-standalone-19-x86


#2

Looks like LTO is disabled when building an rlib. There’s a Cargo issue filed for this: https://github.com/rust-lang/cargo/issues/2301