While we're installing the VC++ 2010 redisditributable, we've apparently linked lld-link.exe against VC++ 2015 or so.
I just deinstalled all MSVC++ redistributables prior to trying the installer with the new MinGW option.
Seems like we have a couple of options:
- compile lld-link.exe with VC++ 2010 if that still works (could possibly break depending on lld codebase)
- use VC++ 2015 redist as C runtime (requires some changes in the mingw build script and possibly the msvcrt stub) (https://github.com/dlang/installer/pull/289)
- install both redistributables with the MinGW option
- ship msvcp140.dll with lld-link.exe (https://msdn.microsoft.com/en-us/library/dd293574.aspx#Anchor_1)
- link lld-link.exe statically against MSVCRT
Any opionion?
Why was 2010 choosen as redistributable? It feels weird to install such an old C runtime.
IIRC there was some point about msvcrt100.dll being preinstalled on all Windows versions, that would be a plus for distributing D apps.
But I'm not sure how relevant that is and why the installer requires me to install a redistributable VC++ 2010 regardless.
Comment #1 by r.sagitario — 2018-02-23T18:38:38Z
I think we should link lld-link.exe statically against the VC/C++ libraries. I suspect LLVM does not build with anything before VC2015 because latest C++ is used.
I chose VC2010 in the hope that it is already installed on most systems, though plain Windows doesn't seem to have it.
The runtimes for VC2015 or later are a bit messy as they rely on the UCRT aswell. It is a bit of a hassle to install these on Win7 or earlier.
(In reply to Rainer Schuetze from comment #1)
> I think we should link lld-link.exe statically against the VC/C++ libraries.
I agree; CMake option LLVM_USE_CRT_RELEASE=MT (assuming CMAKE_BUILD_TYPE=Release).
> I suspect LLVM does not build with anything before VC2015 because latest C++
> is used.
Yep, from https://llvm.org/docs/GettingStartedVS.html:
"You will need Visual Studio 2015 or higher, with the latest Update installed."