Hi, is it possible to recompile the stdlib to only emit static rlibs? I'm doing some experimental stuff in libstd which borks when linking libstd.so so i'd like to turn it off for the time being. Thanks
@Jake Hughes You can remove the
dylib type from
crate-type = ["rlib", "dylib"] in
libstd/Cargo.toml. You can also completely remove that line, as
rlib is the default for libraries.
Oh perfect. Thanks @bjorn3 ! What's the reason for
dylib in here? Is this incase one may want to dynamically link libstd if they use the same rustc version with a compatible abi?I was under the impression that libstd was always statically linked to a rust target.
are there some parts of the rust ecosystem that rely on having libstd in
If any linked crate is a
dylib, rustc will use the
dylib variant of a crate whenever it is available. You can also use
-Cprefer-dynamic to force using the
dylib variant of all crates.
Jake Hughes: are there some parts of the rust ecosystem that rely on having libstd in dylib form?
Testsuite for an example.
Linux distributions ship std as a .so dynamic library.
related issue: https://github.com/rust-lang/rust/issues/56443