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

    <tr>
        <th>Summary</th>
        <td>
            [LoongArch] 'SC_ADDRERR_Z{RD,WR}' was not declared in the musl environment
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          heiher
      </td>
    </tr>
</table>

<pre>
    I encountered these errors when building LLVM with the sanitizer for the Rust `loongarch64-unknown-linux-musl` target.

```
compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:2018:15: error: 'SC_ADDRERR_RD' was not declared in this scope
 2018 |   if (flags & SC_ADDRERR_RD)
      | ^~~~~~~~~~~~~
compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:2020:15: error: 'SC_ADDRERR_WR' was not declared in this scope
 2020 |   if (flags & SC_ADDRERR_WR)
      |               ^~~~~~~~~~~~~
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysk0tv1DAQxz_N5DLalT15NYcc0m5XQiqXIFGJS5XHbGJw7JXt7AIHPjtKuhRaEBUSoyiPSeZv_zL_abxXg2EuIb0GopHVyA6IIN1FzRxG68rHXNTa_kv5Btl0djaBHfcYRvaM7Jx1Hs8jG2xnpXtlBry7e_8WzyqMy0foG6OC-soOD9atmXr2ASET2lozNK4bs2Qzm0_Gns1GKzN_3kyz15AJDI0bOGxB7EBUl3MmLsf62NnpqDS7jQtAe61aoP3Tig-dnSZrnqXWBbbd8QhxRUJeQVzJFOLqEWW5Acrf3TxUu119W9cP9Q4ox3Pj0diAPXe6WfCVwTAqj76zR37cCi5yCPkNIqoDAl0ddDN4BMrwhWBxqVhjqYD09tsv8V_YSLzGdl__AxuJ19kWwd_YnscfSZ-aGvVl3Bdx0URcypwyikWeymgsY9EVzGmS9oei6QspZEZJzG0vhZRpT5EqSVAiChlLiomKbdJR0ssuloLStC0KSARPjdJbrU_T1rohUt7PXEpxlaYi0k3L2l9GwfAZ17eXaXDlUrRp58FDIrTywf-UCSrodYbuFj9Xrhsh3b340x8gv14af3NfQ_4XRzEu1kc2J-WsmdiEaHa6HEM4eogroD3QflBhnNttZ6fFFvr047I5OvuRu8Us6-Y90P5CdyrpewAAAP__p6829Q">