Skip to content

Only with all or split-debuginfo can -Zremap-path-scope remap SO symbols on macOS #117652

Open
@weihanglo

Description

@weihanglo

Problem

It's very clear in RFC that

  • Remaps for split-debuginfo only happen in split debuginfo files.
  • Remaps for unsplit-debuginfo only happen in compiled executables or libraries.
  • Remaps for split-debuginfo-path only remap paths pointing to split debuginfo files.

However, on macOS even you have split debuginfo, SO symbols is still there in the executable.

# Neither `SCOPE=unsplit-debuginfo` or `SCOPE=object` work.
rustc main.rs -g -C -Zunstable-options split-debuginfo=packed \
    -Zremap-path-scope="${SCOPE}" \
    --remap-path-prefix="${HOME}"=

rm -rf main.dSYM # we don't need this

dsymutil -s main | rg N_SO # You'll see absolute paths to `main.rs`

Although it seems like expected as scope object is a union of unsplit-debuginfo | split-debuginfo-path | macro. However, since absolute paths are still embedded in executables, the doc lies on "This ensures all paths in compiled executables or libraries are remapped.

rustc --version --verbose

rustc 1.75.0-nightly (189d6c71f 2023-11-06)
binary: rustc
commit-hash: 189d6c71f3bb6c52113b5639a80839791974fd22
commit-date: 2023-11-06
host: aarch64-apple-darwin
release: 1.75.0-nightly
LLVM version: 17.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.F-trim-pathsFeature: trim-pathsO-macosOperating system: macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions