<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123164>123164</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Confusing CMake option related to llvm_runtime component compiler-rt
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AugustineYang
</td>
</tr>
</table>
<pre>
I have encountered an issue related to llvm_runtime component compiler-rt. When linking a riscv32 assembly code with ld.lld, I got an error saying `ld.lld: error: cannot open ....../libclang_rt.builtins.a: No such file or directory`. After searching for previous issues like [#87150](https://github.com/llvm/llvm-project/issues/87150), [#72862](https://discourse.llvm.org/t/libclang-rt-builtins-a-is-not-being-built/72862), [How to build libclang_rt.builtins.a?](https://stackoverflow.com/questions/76936217/how-to-build-libclang-rt-builtins-a), it seems that the issue happens because of the lack of building "compiler-rt".
After digging into the [Clang Doc](https://clang.llvm.org/docs/Toolchain.html#compiler-rt-llvm) and the CMakeLists file, it turns out that CMake option `-DLLVM_ENABLE_RUNTIMES=all` will only build default runtime components "libcxx;libcxxabi;libunwind" rather than all supported runtime components "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload". This can result in the possible omission of building the compiler-rt.
Since many people have encountered the issue due to this confusing "all" options, maybe we should add a "default" option for building "default runtime components", and use "all" option to build "all supported runtime components".
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVc1u6zYTfRp6M5AgU5FsL7Sw4xhfgCSL76YtugoocSSxoTgqf-zrty8o-SZOb1Kg9caEZnRmzjkzlHBOdQaxYsWOFfuFCL4nW21DF5xXBn8XplvUJM_VPfTiiICmoWA8WpQgDCjnAoJFLTxK8ARaH4cXG4xXA0JDw0gGjZ9OSqNNrE_htx4NaGVelelAgFWuOeYchHM41PoMDUmEk_I9aJlqLRm_hXvoyMeKaC1ZcOIcX2ZldknJt3MkHhphDHm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