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

Update windows-gnu targets to set DebuginfoKind::DWARF #135790

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

wesleywiser
Copy link
Member

These targets have always used DWARF debuginfo and not CodeView/PDB debuginfo like the MSVC Windows targets. However, their target definitions claim to use DebuginfoKind::PDB probably to ensure that we do not try to allow the use of split-DWARF debuginfo.

This does not appear to be necessary since the targets set their supported split debug info to Off. I've looked at all of the uses of these properties and this patch does not appear to cause any functional changes in compiler behavior. I also added UI tests to attempt to validate there is no change in the behavior of these options on stable compilers.

cc @mati865 since you mentioned this in #135739
cc @davidtwco for split-dwarf

@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2025

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@rust-log-analyzer

This comment has been minimized.

@wesleywiser wesleywiser force-pushed the update_windows_gnu_debuginfokind branch from ccc71fd to 54b5250 Compare January 20, 2025 21:08
@rust-log-analyzer

This comment has been minimized.

These targets have always generated DWARF debuginfo and not CodeView/PDB debuginfo
like the MSVC Windows targets. Correct their target definitions to reflect this.

The newly added tests for the various combinations of `*-windows-gnu*` targets and
`-Csplit-debuginfo` show that this does not change any stable behavior.
@wesleywiser wesleywiser force-pushed the update_windows_gnu_debuginfokind branch from 54b5250 to 0b24fc9 Compare January 20, 2025 21:39
@jieyouxu
Copy link
Member

jieyouxu commented Jan 21, 2025

FWIW, I also added -Zunstable-options gating check for -Csplit-debuginfo=... next doors over at #135572 for msvc but did not for windows-gnu, also cc #135531.

+1 for this change, I expected windows-gnu to be using DWARF, but I didn't add any checks for windows-gnu in the other PR because I didn't really feel like testing it. This certainly aligns better with what I expected.

@jieyouxu jieyouxu added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) O-windows-gnu Toolchain: GNU, Operating system: Windows labels Jan 21, 2025
@lqd
Copy link
Member

lqd commented Jan 22, 2025

r? lqd @bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 22, 2025

📌 Commit 0b24fc9 has been approved by lqd

It is now in the queue for this repository.

@rustbot rustbot assigned lqd and unassigned fmease Jan 22, 2025
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 22, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2025
…uginfokind, r=lqd

Update windows-gnu targets to set `DebuginfoKind::DWARF`

These targets have always used DWARF debuginfo and not CodeView/PDB debuginfo like the MSVC Windows targets. However, their target definitions claim to use `DebuginfoKind::PDB` probably to ensure that we do not try to allow the use of split-DWARF debuginfo.

This does not appear to be necessary since the targets set their supported split debug info to `Off`. I've looked at all of the uses of these properties and this patch does not appear to cause any functional changes in compiler behavior. I also added UI tests to attempt to validate there is no change in the behavior of these options on stable compilers.

cc `@mati865` since you mentioned this in rust-lang#135739
cc `@davidtwco` for split-dwarf
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 23, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#131282 (std: detect stack overflows in TLS destructors on UNIX)
 - rust-lang#134746 (Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver)
 - rust-lang#135790 (Update windows-gnu targets to set `DebuginfoKind::DWARF`)
 - rust-lang#135878 (ci: use 8 core arm runner for dist-aarch64-linux)
 - rust-lang#135879 (fix outdated file path ref in llvm)
 - rust-lang#135883 (Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`)
 - rust-lang#135884 (remove implied end of slice)
 - rust-lang#135898 (rustdoc-json-types: Finalize dyn compatibility renaming)

r? `@ghost`
`@rustbot` modify labels: rollup
jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 23, 2025
…uginfokind, r=lqd

Update windows-gnu targets to set `DebuginfoKind::DWARF`

These targets have always used DWARF debuginfo and not CodeView/PDB debuginfo like the MSVC Windows targets. However, their target definitions claim to use `DebuginfoKind::PDB` probably to ensure that we do not try to allow the use of split-DWARF debuginfo.

This does not appear to be necessary since the targets set their supported split debug info to `Off`. I've looked at all of the uses of these properties and this patch does not appear to cause any functional changes in compiler behavior. I also added UI tests to attempt to validate there is no change in the behavior of these options on stable compilers.

cc ``@mati865`` since you mentioned this in rust-lang#135739
cc ``@davidtwco`` for split-dwarf
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jan 23, 2025
…uginfokind, r=lqd

Update windows-gnu targets to set `DebuginfoKind::DWARF`

These targets have always used DWARF debuginfo and not CodeView/PDB debuginfo like the MSVC Windows targets. However, their target definitions claim to use `DebuginfoKind::PDB` probably to ensure that we do not try to allow the use of split-DWARF debuginfo.

This does not appear to be necessary since the targets set their supported split debug info to `Off`. I've looked at all of the uses of these properties and this patch does not appear to cause any functional changes in compiler behavior. I also added UI tests to attempt to validate there is no change in the behavior of these options on stable compilers.

cc ```@mati865``` since you mentioned this in rust-lang#135739
cc ```@davidtwco``` for split-dwarf
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 23, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang#134746 (Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver)
 - rust-lang#135552 ([AIX] Lint on structs that have a different alignment in AIX's C ABI)
 - rust-lang#135764 (Fix tests on LLVM 20)
 - rust-lang#135779 (CI: free disk on linux arm runner)
 - rust-lang#135790 (Update windows-gnu targets to set `DebuginfoKind::DWARF`)
 - rust-lang#135879 (fix outdated file path ref in llvm)
 - rust-lang#135883 (Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`)
 - rust-lang#135884 (remove implied end of slice)
 - rust-lang#135887 (improvements on `build_steps::test` implementation)
 - rust-lang#135898 (rustdoc-json-types: Finalize dyn compatibility renaming)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 23, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#134746 (Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver)
 - rust-lang#135552 ([AIX] Lint on structs that have a different alignment in AIX's C ABI)
 - rust-lang#135779 (CI: free disk on linux arm runner)
 - rust-lang#135790 (Update windows-gnu targets to set `DebuginfoKind::DWARF`)
 - rust-lang#135879 (fix outdated file path ref in llvm)
 - rust-lang#135883 (Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`)
 - rust-lang#135884 (remove implied end of slice)
 - rust-lang#135887 (improvements on `build_steps::test` implementation)
 - rust-lang#135898 (rustdoc-json-types: Finalize dyn compatibility renaming)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 27155e5 into rust-lang:master Jan 23, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 23, 2025
@mati865 mati865 mentioned this pull request Feb 4, 2025
@Andarwinux
Copy link

Why does this affect gnullvm? clang/lld fully supports codeview and pdb. Is that the style of rust? No options for the user at all, just random PRs to make decisions for users at random.

@mati865
Copy link
Contributor

mati865 commented Feb 12, 2025

Gnullvm uses Dwarf debuginfo by default. This is in line with Clang. If you want to generate .pdb files, you can add --pdb argument to the linker invocation.

Note that this PR doesn't change the outcome.
It only paved the way to removing an old hack that chose debuginfo format based on the is_like_msvc field. Before this (and subsequent) PRs, there was no way to change debuginfo format in the spec. Therefore, it is an improvement after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) O-windows-gnu Toolchain: GNU, Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants