lld-linker not creating stripped pdb with MSVC toolchain
steps to reproduce:
- build a simple shared lib
- target_link_options with /PDBSTRIPPED:pdbname.pdb
- switch to lld-link by -DCMAKE_LINKER_TYPE=LLD
- lld-linker not creating stripped pdb file while MSVC linker does
the cmakelist.txt i'm using:
cmake_minimum_required(VERSION 3.25)
set(CMAKE_CXX_STANDARD 23)
add_library(safeguard
SHARED
safeguard.h
safeguard.cpp
)
target_link_options(safeguard
PRIVATE
"/PDBSTRIPPED:safeguard/safeguard_p.pdb"
)
the linking command:
C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=safeguard\CMakeFiles\safeguard.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\LLVM\bin\lld-link.exe safeguard\CMakeFiles\safeguard.dir\safeguard.cpp.obj /out:safeguard\safeguard.dll /implib:safeguard\safeguard.lib /pdb:safeguard\safeguard.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL /PDBSTRIPPED:safeguard/safeguard_p.pdb kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && C:\Windows\system32\cmd.exe /C "cd /D C:\Users\isudfv\Desktop\tmp\cxxtst\cmake-build-debug\safeguard && "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass -file "C:/Program Files/Vcpkg/scripts/buildsystems/msbuild/applocal.ps1" -targetBinary C:/Users/isudfv/Desktop/tmp/cxxtst/cmake-build-debug/safeguard/safeguard.dll -installedDir "C:/Program Files/Vcpkg/installed/x64-windows/debug/bin" -OutVariable out""
I'm using latest LLVM and latest nightly cmake
Edited by isudfv