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

fix(trim-paths): trim SO and DW_AT_comp_dir symbols for root DI node #118518

Closed
wants to merge 3 commits into from

Commits on Jan 24, 2024

  1. test: verify current remap rules on darwin

    When `--remap-path-scope=object` is specified, user expect that there is
    no local path embedded in final executables. Under `object` scope, the
    current implementation only remap debug symbols if debug info is
    splitted into its own file. In other words, when
    `split-debuginfo=packed|unpacked` is set, rustc assumes there is no
    embedded path in the final executable needing to be remapped.
    
    However, this doesn't work on macOS. On macOS, `SO` symbols are embedded
    in binary executables and libraries regardless a split-debuginfo file is
    built. Each `SO` symbol contains a path to the root source file of a
    debug info compile unit.
    
    This commit demonstrates the case, and hope there is a fix soon.
    weihanglo committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    33d65e6 View commit details
    Browse the repository at this point in the history
  2. test: verify current remap rules on Linux

    When `--remap-path-scope=object` is specified, user expect that there is
    no local path embedded in final executables. Under `object` scope, the
    current implementation only remap debug symbols if debug info is
    splitted into its own file. In other words, when
    `split-debuginfo=packed|unpacked` is set, rustc assumes there is no
    embedded path in the final executable needing to be remapped.
    
    However, this doesn't work on Linux. On Linux, the root `DW_AT_comp_dir`
    of a compile unit seems to go into the binary binary executables.
    
    This commit demonstrates the case, and hope there is a fix soon.
    weihanglo committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    a55de2b View commit details
    Browse the repository at this point in the history
  3. fix(trim-paths): trim working diretory from root DI node

    Path of working directory in the root DI node seems to be embedded in
    executables. Hence, we trim them when the scope of `unsplit-debuginfo`
    is present, as if it is kinda a "unsplit" debuginfo.
    weihanglo committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    c2b1547 View commit details
    Browse the repository at this point in the history