-
Notifications
You must be signed in to change notification settings - Fork 14k
miri: use tikv-jemalloc-sys from sysroot
#149252
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
base: main
Are you sure you want to change the base?
Conversation
This allows LTO to work when compiling jemalloc, which should yield a small performance boost, and makes miri's behaviour here match clippy and rustdoc.
|
The Miri subtree was changed cc @rust-lang/miri These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
Does this need a perf run? I don't think Miri is tested in |
|
Miri has its own benchmark suite based on hyperfine that you can run with I'd be happy merging this without running any benchmarks. |
| add_features: |builder, target, features| { | ||
| if builder.config.jemalloc(target) { | ||
| features.push("jemalloc".to_string()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean the feature will be set for ./x build miri but not for ./x test miri?
| extern crate rustc_span; | ||
|
|
||
| /// See docs in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc/src/main.rs | ||
| /// and https://github.com/rust-lang/rust/pull/146627 for why we need this `use` statement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// and https://github.com/rust-lang/rust/pull/146627 for why we need this `use` statement. | |
| /// and https://github.com/rust-lang/rust/pull/146627 for why we need this. |
| /// | ||
| /// FIXME(madsmtm): This is loaded from the sysroot that was built with the other `rustc` crates | ||
| /// above, instead of via Cargo as you'd normally do. This is currently needed for LTO due to | ||
| /// https://github.com/rust-lang/cc-rs/issues/1613. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also saves the time for building jemalloc again so that seems nice 🤷
This allows LTO to work when compiling jemalloc (which is currently broken due to rust-lang/cc-rs#1613), which should yield a small performance boost, and makes Miri's behaviour here match Clippy
and Rustdoc.
Follow-up to #148925 / #146627 after discussion in #148925 (review).
r? RalfJung