Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do static linking by default #10209

Closed
brson opened this issue Oct 31, 2013 · 7 comments
Closed

Do static linking by default #10209

brson opened this issue Oct 31, 2013 · 7 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries P-low Low priority

Comments

@brson
Copy link
Contributor

brson commented Oct 31, 2013

I currently believe there is little hope that Rust libraries can offer any meaningful binary forward compatibility or upgradability. Since this is one of the primary benefits of dynamic linking (the other being reduction in code size), and static linking having other advantages of convenience, perhaps we should prefer static linking by default.

cc #10208 #10188

@brson
Copy link
Contributor Author

brson commented Nov 1, 2013

Nominating, though I think we can live without this for 1.0

@pnkfelix
Copy link
Member

pnkfelix commented Nov 7, 2013

P-low, not necessary to do this (or decide about doing it) for 1.0.

@wycats
Copy link
Contributor

wycats commented Nov 14, 2013

As an embedded user of Rust, this would be really really nice and would make 1.0 significantly more appealing.

@liigo
Copy link
Contributor

liigo commented Nov 14, 2013

+1 for static linking by default

@alexcrichton
Copy link
Member

I believe that as it stands today #10740 blocks this bug.

@alexcrichton
Copy link
Member

Now that #10740 is closed, I'm still not entirely convinced that we should do this by default. This makes linking fn main() {} 4.5x slower from 20ms to 90ms, which is a pretty noticeable hit when dealing with small programs. We should investigate how to optimize compile times for small programs and then I believe that static linking would be an excellent default.

@alexcrichton
Copy link
Member

Closing, we prefer static linking by default, and #11253 is the tracker for whether we should output an rlib or a dylib by default for libraries.

Jarcho pushed a commit to Jarcho/rust that referenced this issue Feb 26, 2023
[arithmetic_side_effects] Fix rust-lang#10209

Fix rust-lang#10209

---

changelog: Enhancement: [`arithmetic_side_effects`]: No longer lints, if safe constant values are used.
[rust-lang#10310](rust-lang/rust-clippy#10310)
<!-- changelog_checked -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries P-low Low priority
Projects
None yet
Development

No branches or pull requests

5 participants