-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'platform:windows
Description
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:
> 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:
llvm-project/clang/lib/Driver/ToolChains/MSVC.cpp
Lines 167 to 168 in 7b98280
| if (Args.hasArg(options::OPT_g_Group, options::OPT__SLASH_Z7)) | |
| CmdArgs.push_back("-debug"); |
Is this expected/intentional?
Metadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'platform:windows