Check out January 9, 2018 http://planet.clang.org/
Look at "Try it!" section:
If you are already using clang-cl and lld-link on Windows today, you can try this. Two flags are needed for this, one for the compiler and one for the linker: To enable the compiler to select the .debug $ H section, you need to pass the undocumented flag -mllvm -emit-codeview-ghash-section to clang-cl (this flag should go in the future as soon as it is considered stable and good enough for inclusion by default). To tell lld-link this information, you need to pass /DEBUG:GHASH to lld.
You just need to pass the -mllvm -emit-codeview-ghash-section flags in your C ++ projects “Command Line: Advanced Options” or put them directly in the “toolset.props” file that you created in C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\LLVM-vs2017 , or C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets\LLVM-vs2017 .
The key is that when you add these cli parameters that you specify clang to emit debug information, lld (aka lld-link ) will understand and use to create fully populated PDB files. Unlimited, which were made before the drops of LLVM 7.0 dated January 09, 2018.
toolset.targets: (any version)
<Project ToolsVersion="14.1" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" /> </Project>
toolset.props: (Win32 version)
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v141\Microsoft.Cpp.$(Platform).v141.props" Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v141\Microsoft.Cpp.$(Platform).v141.props')"/> <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v141\Toolset.props" Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v141\Toolset.props')"/> <PropertyGroup> <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir> <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir> <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath> <LibraryPath>$(LLVMInstallDir)\lib\clang\7.0\lib\windows;$(LibraryPath)</LibraryPath> </PropertyGroup> <ItemDefinitionGroup> <ClCompile> <ProgramDataBaseFileName></ProgramDataBaseFileName> <AdditionalOptions>-m32 -fmsc-version=1913 %(AdditionalOptions)</AdditionalOptions> </ClCompile> </ItemDefinitionGroup> </Project>
For x64, change -m32 to -m64
pps, I also included the Microsoft ARM and ARM64 compilers to create my own Windows-10-ARM applications (and not UWP-modern harvesters). But so far, I have not done enough work in the clang sources to correctly configure something similar for ARM to what -m32 and -m64 do for Intel code-gen.
See the following articles: