Bug 20405 – pipelink.exe ignores LLVMInstallDir property when lld-link.exe is used.

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
visuald
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2019-11-18T11:06:22Z
Last change time
2019-11-22T10:53:56Z
Assigned to
No Owner
Creator
Richard Manthorpe

Comments

Comment #0 by rmanth — 2019-11-18T11:06:22Z
Visual Studio allows the location of lld-link.exe to be overridden with the "LLVMInstallDir" property. Although pipelink.exe now delegates to the correct linker, it ignores this property. This is particularly problematic as in some cases the 32-bit linker that visual studio provides cannot allocate enough memory. Related to https://issues.dlang.org/show_bug.cgi?id=20387.
Comment #1 by r.sagitario — 2019-11-21T21:56:07Z
I don't find LLVMInstallDir anywhere being used in the VS 2019 installation folders (it is defined in Microsoft.Cpp.Default.props, though). Does it need some special components to be installed? Where do you change/apply this setting?
Comment #2 by rmanth — 2019-11-21T22:06:37Z
Thanks for looking into this! It needs the Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset component (C++ Clang-cl for v142 build tools). There's no GUI setting for it, you just have to set it in a property group in a project file or a props file. It needs to be set after Microsoft.Cpp.Default.props is loaded. It's mentioned here: https://devblogs.microsoft.com/cppblog/clang-llvm-support-for-msbuild-projects/
Comment #3 by r.sagitario — 2019-11-22T08:29:23Z
Works as expected here: - installed the clang components - renamed the VC\Tools\LLVM - switched test project to use clang toolchain (has both cpp and d sources) - added property to set LLVMInstallDir (before importing Microsoft.Cpp.props) - build project -> runs lld-link.exe through pipelink.exe successfully (can be seen in pipelink.read.1.tlog) What's different in your setup?
Comment #4 by rmanth — 2019-11-22T10:53:56Z
You're absolutely right, I'm not sure why I didn't manage to get that working before. Sorry to waste your time!