<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58893>58893</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVM 15.0.x: Missing libraries for compiler-rt standalone build on windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          h-vetinari
      </td>
    </tr>
</table>

<pre>
    It's taken me a long time to get to this point (due to a very hard-to-diagnose [bug](https://github.com/llvm/llvm-project/issues/58541) involving symlinks), but [building](https://github.com/conda-forge/compiler-rt-feedstock/pull/53) compiler-rt as for LLVM 14 does not work anymore. In particular, just a very simple invocation of

```
mkdir build
cd build
cmake [options] ../compiler-rt 
cmake build .
cmake install .
```

does not work anymore - nothing gets built or installed.

After digging around a bit in some of the associate CMake [files](https://github.com/llvm/llvm-project/blob/llvmorg-15.0.4/compiler-rt/cmake/Modules/AddCompilerRT.cmake), I tried to exchange the last two lines with
```
cmake --build . --target compiler-rt
cmake --install .
```
since compiler-rt [should](https://github.com/llvm/llvm-project/blob/llvmorg-15.0.4/compiler-rt/cmake/base-config-ix.cmake#L21) contain everything (sidenote: CMake throws up over `cmake build . --target xxx` without the dashes before `build` - but ðŸ¤·)

This seems to be building most libraries, in particular
<details>

```
[252/379] Linking CXX static library lib\windows\clang_rt.ubsan_standalone_cxx-x86_64.lib
[255/379] Linking CXX static library lib\windows\clang_rt.ubsan_standalone-x86_64.lib
[317/379] Linking CXX static library lib\windows\clang_rt.asan-x86_64.lib
[318/379] Linking CXX static library lib\windows\clang_rt.asan_static-x86_64.lib
[319/379] Linking CXX static library lib\windows\clang_rt.asan_cxx-x86_64.lib
[322/379] Linking CXX static library lib\windows\clang_rt.asan-preinit-x86_64.lib
[326/379] Linking CXX static library lib\windows\clang_rt.asan_dll_thunk-x86_64.lib
[327/379] Linking CXX static library lib\windows\clang_rt.asan_dynamic_runtime_thunk-x86_64.lib
[333/379] Linking CXX shared library lib\windows\clang_rt.asan_dynamic-x86_64.dll
[350/379] Linking CXX static library lib\windows\clang_rt.profile-x86_64.lib
[376/379] Linking CXX static library lib\windows\clang_rt.fuzzer_interceptors-x86_64.lib
[378/379] Linking CXX static library lib\windows\clang_rt.fuzzer_no_main-x86_64.lib
[379/379] Linking CXX static library lib\windows\clang_rt.fuzzer-x86_64.lib
```

</details>

But fails upon installation:
```
cmake --install . 
-- Install configuration: "Release"
CMake Error at lib/stats/cmake_install.cmake:36 (file):
  file INSTALL cannot find
  "D:/bld/compiler-rt-packages_1667989486494/work/build/lib/windows/clang_rt.stats-x86_64.lib":
  File exists.
```

The problem does not appear on linux/osx.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9V0uP4jgQ_jXhYiUKeQA5cGDoaakleg-zrdXckBNXwINjR7bT0PPrt-yEBnYzvdqltRKQxHbqq_rqSanY2_LJBsncEEsPIEkDhBKh5I5YjvdWkR1Yd7F7bkiruLQkSBas83uUvIJ-I3uqWWhVyDjdSWWABPmXstsF-QMe3VvbmiBdBckjfnbc7rsyqlSDD0K8ni9hq9UPqFCVR25MBwZv8kWeTYOkIFy-KvHKUSnz1gguD7hbBMmalJ3tsbhguP2PgJWSjIa10jvwT03LBehQ27AGYMaq6oDrbSeEg08d9tUhQg3Bd8lm88czmWaEKTBEKkuOSh8IlW-N0hCRJ0laqi2vOkG10_JHZ-yZKsObVoC3qKKWK0lUHcQPQbwafmfx8PGPzYFxTbx9_ULFbp4adJpjQLVOlkECSBTdmkauj_p3SXS9xKWxVIjz4l8U6H9HLSWhW9o7t2CMGC_bEuRnkAgsupaxqi1owvhu596gWnWSISslt_gCMQqjTdUYZhiAxqiKUwtk_TzYV6Mx5j_GUylUOayi48NpHsVRdsuRe3Jk4PVZsU748Fsxth6OfHuJhn0fdk_Eag7MZQCcqj2VO_CKC4qOtkdFMEaRsCPqNkpqT3wYD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