Disadvantages of preferring dynamic linking in debug mode?

rustc (and cargo) have options to prefer dynamic linking when possible (ref). It would largely eliminate linking time, speeding up compilation…I think. What disadvantages might there be of adding this to my global .cargo/config.toml for debug mode? Ideally I'd still statically link in release mode, but it doesn't look like this is currently possible with a global configuration.

1 Like

The main disadvantage of dynamic linking with rust is that if two dynamically linked crates depend on the same rlib and neither dynamic library depends on the other, the rlib will be linked into both dylibs. It then becomes impossible to link to both dylibs at the same time.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.