Repository navigation
Tracking issue for -Zdwarf-version #103057
Copy link
Copy link
Closed
Labels
-Zdwarf-versionUnstable option: set dwarf versionUnstable option: set dwarf versionA-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compilerC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-design-proposalStatus: This needs a clear design proposal and then a meeting with the team.Status: This needs a clear design proposal and then a meeting with the team.T-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.
Description
This is a tracking issue for the -Zdwarf-version unstable flag (no RFC/MCP) added in #98350 which allows selecting the specific version of DWARF to use when creating debuginfo.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Initial implementation (Implement support for DWARF version 5. #98350)
- Wider Testing (tested on RfL)
- Adjust documentation (see instructions on rustc-dev-guide) (Stabilize
-Zdwarf-versionas-Cdwarf-version#136926) - Stabilization PR (see instructions on rustc-dev-guide) (Stabilize
-Zdwarf-versionas-Cdwarf-version#136926)
Unresolved Questions
- Is the pre-compiled standard library (potentially) using a different version of DWARF an issue?
- What should the behavior of the flag do when the active target does not use DWARF?
Implementation history
- Initial implementation: Implement support for DWARF version 5. #98350
- Stop emitting
.debug_pubnamesand.debug_pubtypeswhen using DWARF 5 fix: stop emitting.debug_pubnamesand.debug_pubtypes#117962 - Refactoring & cleanups Clean up uses of the unstable
dwarf_versionoption #135739 - Fix LLVM warning on LTO with different DWARF versions Pick the max DWARF version when LTO'ing modules with different versions #136659
- Improve argument validation Emit an error if
-Zdwarf-version=1is requested #136746
Metadata
Metadata
Assignees
Labels
-Zdwarf-versionUnstable option: set dwarf versionUnstable option: set dwarf versionA-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compilerC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-design-proposalStatus: This needs a clear design proposal and then a meeting with the team.Status: This needs a clear design proposal and then a meeting with the team.T-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.
Activity
thomcc commentedon Nov 10, 2022
Ideally this design proposal would include some method of exposing it to cargo build scripts, so crates like
ccwould be able to use the right version of DWARF (see rust-lang/cc-rs#694, for example, where we hardcode decisions compatible with rustc)Wyvern commentedon Feb 3, 2023
Is there a unstable way to opt-in DWARF5 for Rust now?
Tried
-Zdwarf-version=5in macOS, but seems failed.kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
kbuild: rust: use `-Zdwarf-version` to support DWARFv5
fhanau commentedon Dec 24, 2024
As of Xcode 16 DWARFv5 is used by default when targeting macOS 15 or higher, LLVM also defaults to 5 on Linux for most architectures. Hopefully the defaults can be updated to what LLVM is doing soon. This is especially helpful when using linker plugin LTO to link Rust and C++ code together, which produces lots of LLD warnings when there are mismatching Rust versions.
[-]provide way to users to opt into DWARF5 on stable Rust[/-][+]Tracking issue for `-Zdwarf-version`[/+]Rollup merge of rust-lang#135739 - wesleywiser:dwarf_version_handling…
Rollup merge of rust-lang#135739 - wesleywiser:dwarf_version_handling…
Unrolled build for rust-lang#135739
Rollup merge of rust-lang#136659 - wesleywiser:dwarf_version_lto_merg…
Rollup merge of rust-lang#136746 - wesleywiser:err_dwarf1, r=Urgau
Rollup merge of rust-lang#136659 - wesleywiser:dwarf_version_lto_merg…
Rollup merge of rust-lang#136659 - wesleywiser:dwarf_version_lto_merg…
Unrolled build for rust-lang#136659
Rollup merge of rust-lang#136746 - wesleywiser:err_dwarf1, r=Urgau
Unrolled build for rust-lang#136746
Rollup merge of rust-lang#136926 - wesleywiser:stabilize_dwarf-versio…
Auto merge of rust-lang#136926 - wesleywiser:stabilize_dwarf-version,…