<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95452>95452</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`LLVM_STATIC_LINK_CXX_STDLIB=Yes` has libc++abi link-time issues when combined with `LLVM_ENABLE_LIBCXX=Yes`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
cmake
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjdb
</td>
</tr>
</table>
<pre>
I get errors to the tune of this when I've configured LLVM with `-DLLVM_STATIC_LINK_CXX_STDLIB=Yes -DLLVM_ENABLE_LIBCXX=Yes`.
```
mold: error: undefined symbol: __cxa_guard_abort
>>> referenced by iostream.cpp
>>> /home/cjdb/opt/lib/x86_64-unknown-linux-gnu/libc++.a(iostream.cpp.o):(std::__1::ios_base::Init::Init())
>>> referenced by locale.cpp
>>> /home/cjdb/opt/lib/x86_64-unknown-linux-gnu/libc++.a(locale.cpp.o):(std::__1::locale::classic())
>>> referenced by locale.cpp
>>> /home/cjdb/opt/lib/x86_64-unknown-linux-gnu/libc++.a(locale.cpp.o):(std::__1::locale::locale())
>>> referenced 6 more times
```
It looks like libc++abi isn't being linked, because things work when I add `LDFLAGS="-L${HOME}/opt/lib -lc++abi"`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVM-PqzYQ_muGi0XkGAhw4JAsmxaV93rYVbU9IWNPwC_GjrDZH_995ZCnXa2qbS89VLKcz2HwzPcx83Hn1GAQK8gOkNURX_xo50r8kH3UW_lWNWRAT3Ce7eyIt8SPSPxikNgT8aNy5GVEQxpg-TMSYc1JDcuMkrTtH9_Ii_IjgR2N63DsHh73j81d1zbff-vunp66h8e6bQ6Q1H-iI7eY--_7Q3vftc3h7ulpfQQ7ugFaA93f9h29retxslpCsl9rDGAxEk_KoCTubeqtDv91nXjl3bDwWXa8t7O_XZXcr4vMeMIZjUBJ-jeirPMz8mkjLpfPkcCOo50Q2DGoBOxoLx7YUauAX4tdt0vjxZyNfTGxVmZ5jQezrAEC2AHYYcOBFR9TbCywEpI9sML5QAaSfddtV6Cs63rucD01RvkPiBXhTVZ-TUdbwTX-h2TeE3xJZQ1bsdCh98T_mMEN_wsCOzLZGYlXE7q_7eF1bzzR1p4d0eqM5L1A3iuinAGWe9KjMgPRypxRArsjPQq-OAyzaAZHXux8vo0k4VKG4WvrY7v_5QGSGhiLW2Ap5Idff_92D3n9US4S6_d8wFgYu0hWiSyTkkdYbfNtkdA0oTQaq3LLZUoTnpVpiQUvZEJpnsu-yHIUuBWRqhhlKd1tk22RZpRuSoo9Zmkv04LK_CQgpThxpTdaP08bOw-Rcm7BqszSjEWa96jd1ZUYExM_Y6goq6O5CvFxvwwOUqqV8-79Bq-8xipw_ie7gR0lI3efRA6yxuErkWstN3MTduqvdvLTzr4wqmiZdTV6f3HXDjoCOw7Kj0u_EXYKOuvnnz_xZbY_UAT112zAjiv554r9FQAA__-exK0i">