about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-10 16:38:28 +0100
committerGitHub <noreply@github.com>2025-02-10 16:38:28 +0100
commit4fff3209df23e432539260f609c79c0acbdf8472 (patch)
tree3ddef2e5a204bb57c6a8621cd9e84750111f819d /compiler/rustc_codegen_llvm/src/errors.rs
parent277dda4ed346cb6946743d6073816e5c2da08755 (diff)
parent9da96a65e1c20a99a644be70661bfdb7bfb5b23d (diff)
downloadrust-4fff3209df23e432539260f609c79c0acbdf8472.tar.gz
rust-4fff3209df23e432539260f609c79c0acbdf8472.zip
Rollup merge of #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: https://github.com/rust-lang/rust/pull/119286#issuecomment-2612746162. See also https://github.com/rust-lang/rust/issues/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
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions