Description
Consider this basic example:
fn main() {
std::thread::sleep(std::time::Duration::from_secs_f64(1.0));
}
When compiled with cargo build
and the following Cargo.toml
:
[profile.dev]
debug = false
strip = "symbols"
we see the following profile with samply record
:
That is, all symbols are still there. However, when we instead build with
[profile.dev]
debug = false
strip = "debuginfo"
we see the following profile:

I believe this is a bug, as the documentation for strip
specifies that symbols
is supposed to be a more aggressive stripping than debuginfo
, which is supposed to leave backtrace information mostly intact. We see the opposite behavior.
The following lines of code are suspect:
rust/compiler/rustc_codegen_ssa/src/back/link.rs
Lines 1103 to 1118 in bf6f8a4
-S
on rust-objcopy
is documented as such:
-S Alias for --strip-all
It does not seem appropriate to be used in the Debuginfo
branch, but omitted in the Symbols
branch.