Skip to content

Disable DWARF in linker options for i686-unknown-uefi #136791

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

nicholasbishop
Copy link
Contributor

This fixes an lld warning:

warning: linker stderr: rust-lld: section name .debug_frame is longer than 8 characters and will use a non-standard string table

See https://reviews.llvm.org/D69594 for details of where the warning was added.

This warning only occurs with the i686 UEFI target, not x86_64 or aarch64. The x86_64 target uses an LLVM target of
x86_64-unknown-windows and aarch64 uses aarch64-unknown-windows, but i686 uses i686-unknown-windows-gnu (note the -gnu). See comments in i686_unknown_uefi.rs for details of why.

The .debug_frame section should not actually be needed; UEFI targets provide a separate PDB file for debugging. Disable DWARF (and by extension the .debug_frame section) by passing /DEBUG:NODWARF to lld.

Tested with:

export RUSTC_LOG=rustc_codegen_ssa::back::link=info
cargo +stage1 build --release --target i686-unknown-uefi

This issue was originally raised here: #119286 (comment). See also #136096. It was suggested to file an LLVM bug, but I don't think LLVM is actually doing anything wrong as such.

CC @dvdhrm @jyn514 let me know if you have any feedback on this approach

This fixes an lld warning:
> warning: linker stderr: rust-lld: section name .debug_frame is longer
> than 8 characters and will use a non-standard string table

See https://reviews.llvm.org/D69594 for details of where the warning was
added.

This warning only occurs with the i686 UEFI target, not x86_64 or
aarch64. The x86_64 target uses an LLVM target of
`x86_64-unknown-windows` and aarch64 uses `aarch64-unknown-windows`, but
i686 uses `i686-unknown-windows-gnu` (note the `-gnu`). See comments in
`i686_unknown_uefi.rs` for details of why.

The `.debug_frame` section should not actually be needed; UEFI targets
provide a separate PDB file for debugging. Disable DWARF (and by
extension the `.debug_frame` section) by passing `/DEBUG:NODWARF` to lld.

Tested with:
export RUSTC_LOG=rustc_codegen_ssa::back::link=info
cargo +stage1 build --release --target i686-unknown-uefi
@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2025

r? @cjgillot

rustbot has assigned @cjgillot.
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 Feb 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2025

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

@jyn514
Copy link
Member

jyn514 commented Feb 9, 2025

Oh. Hmm. That seems reasonable, I don't know why we would need both DWARF and PDB for the same object file.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me as well, thanks

@jieyouxu jieyouxu assigned jieyouxu and unassigned cjgillot Feb 10, 2025
@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Feb 10, 2025

📌 Commit 9da96a6 has been approved by jieyouxu

It is now in the queue for this repository.

@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 Feb 10, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#136419 (adding autodiff tests)
 - rust-lang#136628 (ci: upgrade to crosstool-ng 1.27.0)
 - rust-lang#136681 (resolve `llvm-config` path properly on cross builds)
 - rust-lang#136714 (Update `compiler-builtins` to 0.1.146)
 - rust-lang#136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync")
 - rust-lang#136791 (Disable DWARF in linker options for i686-unknown-uefi)

Failed merges:

 - rust-lang#136767 (improve host/cross target checking)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
Rollup merge of rust-lang#136791 - nicholasbishop:bishop-disable-dwarf, r=jieyouxu

Disable DWARF in linker options for i686-unknown-uefi

This fixes an lld warning:
> warning: linker stderr: rust-lld: section name .debug_frame is longer than 8 characters and will use a non-standard string table

See https://reviews.llvm.org/D69594 for details of where the warning was added.

This warning only occurs with the i686 UEFI target, not x86_64 or aarch64. The x86_64 target uses an LLVM target of
`x86_64-unknown-windows` and aarch64 uses `aarch64-unknown-windows`, but i686 uses `i686-unknown-windows-gnu` (note the `-gnu`). See comments in `i686_unknown_uefi.rs` for details of why.

The `.debug_frame` section should not actually be needed; UEFI targets provide a separate PDB file for debugging. Disable DWARF (and by extension the `.debug_frame` section) by passing `/DEBUG:NODWARF` to lld.

Tested with:
```
export RUSTC_LOG=rustc_codegen_ssa::back::link=info
cargo +stage1 build --release --target i686-unknown-uefi
```

This issue was originally raised here: rust-lang#119286 (comment). See also rust-lang#136096. It was suggested to file an LLVM bug, but I don't think LLVM is actually doing anything wrong as such.

CC `@dvdhrm` `@jyn514` let me know if you have any feedback on this approach
@bors bors merged commit 4fff320 into rust-lang:master Feb 10, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 10, 2025
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#136419 (adding autodiff tests)
 - rust-lang#136628 (ci: upgrade to crosstool-ng 1.27.0)
 - rust-lang#136681 (resolve `llvm-config` path properly on cross builds)
 - rust-lang#136714 (Update `compiler-builtins` to 0.1.146)
 - rust-lang#136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync")
 - rust-lang#136791 (Disable DWARF in linker options for i686-unknown-uefi)

Failed merges:

 - rust-lang#136767 (improve host/cross target checking)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#136419 (adding autodiff tests)
 - rust-lang#136628 (ci: upgrade to crosstool-ng 1.27.0)
 - rust-lang#136681 (resolve `llvm-config` path properly on cross builds)
 - rust-lang#136714 (Update `compiler-builtins` to 0.1.146)
 - rust-lang#136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync")
 - rust-lang#136791 (Disable DWARF in linker options for i686-unknown-uefi)

Failed merges:

 - rust-lang#136767 (improve host/cross target checking)

r? `@ghost`
`@rustbot` modify labels: rollup
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.

6 participants