I got a std.stdio hello-world executable to work on Win64 using the
Visual C++ 2015 DLLs, with both MS linker and -link-internally, see
https://github.com/dlang/installer/pull/346.
It still requires a couple of extra command-line args, but will in the
end enable us to get rid of all external dependencies for building on
Windows (via -link-internally and the MinGW-w64-based import libs, which
will only add a few MB to the prebuilt packages).
The Visual C++ 2015 *runtime* will need to be installed when running
binaries linked against the MinGW libs.
In addition (and preferred over) the previous searched-for lib dir
(`<bin dir>/../lib<LIB_SUFFIX CMake var>`). [Incl. searching in some of
their subdirs, e.g., `clang/x.y.z/lib/<OS>`.]
I skipped that backwards-compatibility thingy for the builtins lib on
Windows (not crucial, only linked (if found) on Windows etc.).
And replace the default `-L-L<path>` LDC switches in the default config
accordingly.
The first advantage is for cross-compilation, where additional sections
should now mostly get away with overriding `lib-dirs` (and `rpath` if
need be) only; not just to specify the directory containing cross-
compiled druntime and Phobos, but also further dirs containing the C
libs. No need to override a whole `[post-]switches` array anymore just
to tweak the lib dirs.
The second advantage is that we can search these dirs for compiler-rt
libs instead of being limited to `<bin dir>/../lib<LIB_SUFFIX specified
in CMake command line>` or trying to guess distro-specific paths
=> easy-peasy for distros and users.
This isn't implemented yet.
The LLVM 5.0.1 ASan x64 lib doesn't work with VS 2017 v15.5.5; any
executable linked against it will hang at startup with the msg:
'ASan init calls itself!'
See https://github.com/google/sanitizers/issues/818.
Results in a 7.5% bigger RelWithDebInfo ldc2.exe on Win64 with LLVM 3.9.1.
LLD is currently enforced when building with LDC_WITH_LLD=ON. And LLD
still doesn't support debuginfo (.pdb) generation for MSVC targets.