| Issue |
165614
|
| Summary |
[Clang] Compiling and linking with `-gdwarf` generates PDB on Windows
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
Nerixyz
|
When using `-gdwarf` Windows and linking with clang, a PDB file will be generated, because the linker is invoked with `-debug`. The PDB will only contain the `S_PUB32` entries for the symbols from the object files (plus records from the PDBs of the default libraries), but it's confusing that this is generated when DWARF debug info is requested.
To reproduce:
```console
> echo "int main(void){}" > test.c
> clang test.c -gdwarf -fuse-ld=lld -v
clang version 21.1.2
Target: x86_64-pc-windows-msvc
Thread model: posix
[...]
"C:\\Users\\johannes\\scoop\\apps\\llvm-full\\21.1.2\\bin\\lld-link" -out:a.exe -defaultlib:libcmt -defaultlib:oldnames -libpath:[...] -nologo -debug "C:\\Users\\johannes\\AppData\\Local\\Temp\\test-0a0970.o"
```
The flag is added here:
https://github.com/llvm/llvm-project/blob/7b98280b6b7cb89b141a5874ff9ee3ce72dab92a/clang/lib/Driver/ToolChains/MSVC.cpp#L167-L168
Is this expected/intentional?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs