<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64014>64014</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLVM 16 refuses to build statically
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vit9696
</td>
</tr>
</table>
<pre>
There apparently is a RPATH regression in LLVM 16 which happens some time after LLVM 15 was released. I build a statically linked LLVM clang with musl on Linux by adding `-DLLVM_BUILD_STATIC=ON`. Starting with LLVM 16 cmake installation fails due to attempts to change RPATH. Yet RPATH is meaningless in static builds.
Log:
```
CMake Error at utils/TableGen/cmake_install.cmake:55 (file):
file RPATH_CHANGE could not write new RPATH:
$ORIGIN/../lib
to the file:
/home/user/llvm/install-llvm/bin/llvm-tblgen
No valid ELF RPATH or RUNPATH entry exists in the file;
Call Stack (most recent call first):
cmake_install.cmake:68 (include)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk99vozgQx_8a8zIqAvOj4YGHtCndSNnsqZs96Z4qAwP4auzIHprNf38y0Mt2tRJC_jHj-c5nZoRzsteIJcseWLYLxESDseW7pCIv8qA27bU8DWgRxPksLGpSV5AOBLz8tT19AYu9Reek0SA1HA5_f4U4h8sgmwEGcT6jduDMiEByRBAdoV2tMrgIBxYVCodtCHuoJ6laEOBIkGyEUldQUr9hu3g0SugeLpIGGCenwGg4SD39hPoKom2l7oHl0d3OG78-_Ngfdq_fT9vT_pElu29HlkchfCdhSX688qG2GcUbgtSOhFKCfC6dkMpBOyGQAUGE45mcXzeD0D0uyYfwD9LKQToYUWipe4XOeRZLFktSLmTRjkXb5X8wPUu2v56wPFq_efv41Qt6stZYEAQTSeUYr06iVviMmvFqlvy6Sg7nHUu2WQaMbzqpkPHi_xAA_mTR-fr4ZXt8foLGTKoFbQguVhKCxsti8JswAADG028v--f9kfEqDBmvlKw_25ABGnAO87s_49VgRmS8mhxa76zeR8arVfrduq2lXu_uqFY96s8BjgbehZItPB2qFbix8PLjOC9Rk70C_pSOZvI3LQ8rT6GUr33z5vmMxhFYbFAT-C6DTlpHn4j9GW--8e5SN2pqZ8J_qt3yD9oyaYukEAGWcb4pijzOiigYyizO0i6559ht8vtNXfCmLhA3kcizRjRpFsiSRzyJ7nkc36d5EoV11rVRm7ZZXac8zWKWRjgKqUJPKzS2D6RzE5Z5GsVpoESNys3TzLmv6nzJOPfDbcuZcD31jqWR8rxur5AkheXHTFjsJodzyy9jeRvKYLKqHIjOzgPjFeNVL2mY6rAx463Cc6izNf9iQ77gXofv4lnnfwEAAP__3UZkkg">