These are a collection of small fixes to make LLVM/Clang build with a clang+mingw toolchain to target Windows.
The three commits address the following problems:
- When using LTO we pass --lto-cache-directory to lld - but this option is not supported by the lld MingW driver so it fails with unknown argument.
- Don't symlink the tools - a MingW build version of clang should be assumed to be used on Windows - which doesn't support symlinks correctly - so instead use the copy path of the code for MingW as well.
- The logic for linking libclang with libdl was a bit flawed - use the similar logic as to other places in the CMake build system.
If you say this is the same way it's done elsewhere, then sure - although I have no idea about what the issue is, why I haven't run into it, etc. Normally you wouldn't have a libdl on mingw right? What's the concrete issue you're running into, and in which conditions would one run into it?