Repository navigation
Rustc strips all symbols on MacOS when strip = "debuginfo" is specified, but not when strip = "symbols" is specified #135028
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-macosOperating system: macOSOperating system: macOSP-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Activity
- addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Jan 2, 2025 - addedO-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.and removedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Jan 2, 2025 What made it extra annoying to debug this issue is that the
cargodocs lie about the default forstrip. It saysstrip = "none"is the default, but this is not true. The default depends on whether or notdebug = falseis specified.This is a regression from stable to nightly, tracked down to #131405.
- addedregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
on Jan 2, 2025 - addedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Jan 2, 2025 @rustbot label +T-bootstrap
cc @davidtwco @jieyouxu since #131405
- addedT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Jan 2, 2025 - removedT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Jan 2, 2025 The regression is actually a T-compiler concern, because we used the wrong flags for rust-objcopy in cg_ssa.
Reacted by apiraino- added a commit that references this issue
on Jan 2, 2025 - addedP-criticalCritical priorityCritical priorityand removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Jan 2, 2025 - added 5 commits that reference this issue
on Jan 2, 2025 Re-opening for the backport.
Backport occurred in #135163 so I'm closing.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-macosOperating system: macOSOperating system: macOSP-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Consider this basic example:
When compiled with
cargo buildand the followingCargo.toml:we see the following profile with
samply record:That is, all symbols are still there. However, when we instead build with
we see the following profile:
I believe this is a bug, as the documentation for
stripspecifies thatsymbolsis supposed to be a more aggressive stripping thandebuginfo, 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
-Sonrust-objcopyis documented as such:It does not seem appropriate to be used in the
Debuginfobranch, but omitted in theSymbolsbranch.