I gather that prefer-dynamic isn't the preferred mode of compiling, but I use it in Evcxr to try and keep memory usage down when compiling and loading lots of .so files with similar dependencies.
Cargo.toml:
[package]
name = "foo"
version = "1.0.0"
edition = "2018"
[dependencies]
reqwest = "0.11"
tokio = {version = "1.2.0", features = ["full"]}
I gather that prefer-dynamic isn't the preferred mode of compiling, but I use it in Evcxr to try and keep memory usage down when compiling and loading lots of .so files with similar dependencies.
Cargo.toml:
main.rs:
cargo build
succeeds, howevercargo rustc -- -C prefer-dynamic
fails to link with lots of missing symbols. e.g.:Meta
Got this behavior on nightly 2021-03-09 as well as stable versions back as far as 1.44. Prior that the code doesn't compile due to missing features.
rustc +nightly --version --verbose
:rustc 1.52.0-nightly (3a5d45f68 2021-03-09) binary: rustc commit-hash: 3a5d45f68cadc8fff4fbb557780f92b403b19c19 commit-date: 2021-03-09 host: x86_64-unknown-linux-gnu release: 1.52.0-nightly LLVM version: 12.0.0
Original report: https://github.com/google/evcxr/issues/156