File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,19 @@ Enable LTO in `Cargo.toml`:
8989lto = true
9090```
9191
92+ # Dynamic Linking: Why It Doesn't Work
93+
94+ ![ Minimum Rust: 1.0] ( https://img.shields.io/badge/Minimum%20Rust%20Version-1.0-brightgreen.svg )
95+
96+ Some might suggest using ` prefer-dynamic ` for smaller binaries, but this approach has critical limitations:
97+
98+ - ** No stable ABI** - binaries break between Rust versions
99+ - ** Deployment complexity** - requires exact library matches
100+ - ** Community consensus** - static linking preferred for reliability
101+
102+ Rust's design prioritizes static linking for good reasons. Use the proven techniques in this guide instead.
103+ More about it you can read in this [ blog post] ( https://kivooeo.github.io/dynamic-linking-in-rustc/ )
104+
92105# Reduce Parallel Code Generation Units to Increase Optimization
93106
94107[ By default] [ cargo-profile ] , Cargo specifies 16 parallel codegen units for release builds.
@@ -438,4 +451,4 @@ use std::alloc::System;
438451
439452#[global_allocator]
440453static A : System = System ;
441- ```
454+ ```
You can’t perform that action at this time.
0 commit comments