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

    <tr>
        <th>Summary</th>
        <td>
            [libc][arm][setjmp/longjmp] enforce minimum sizes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

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

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

<pre>
    https://github.com/ARM-software/abi-aa/blob/main/clibabi32/clibabi32.rst#setjmph

> The minimum jmp_buf size is calculated as follows:
SP, LR: 2x4; reserved to setjmp implementation: 4x4; Total 3x8 bytes
General purpose register save: 8x4; Total 4x8 bytes
Floating point register save: 8x8; Total 8x8 bytes
WMMX (if present): 5x8; Total 5x8 bytes
Total: 20x8 = 160 bytes = 20 8-byte double-words.
If WMMX can be guaranteed not to be present this can be reduced to 15x8 = 120 bytes.
If floating point hardware can be guaranteed not to be present this can be further reduced to 7x8 = 56 bytes.
An implementation may define the size of a jmp_buf to be larger than the ABI-defined minimum size.

We can enforce this via static_asserts in the implementations of setjmp+longjmp. We don't plan to support WMMX.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlE-PszYQxj-NuYyCwEACBw5JU6pX6krV21fa3lZjPIBTYyPbZHf76Ssgu5tUVaVeEkDzm-eZPxr0XvWGqGbFiRXnCOcwWFcb1f4pyeOsjSLnI2Hlez2EMHmWHRlvGG96FYZZxK0dGW-O35923nbhFR0x3qBQO0TGG6GtYLwZURnGm1YrgUJl_P45dj4wnnkKl3EaWHJmyfH2m_0MPwaCURk1ziNcxulFzB149ReB8tCibmeNgSSgh85qbV9Xfyv9-2-M_wS_fmfZEfhbzrITOPLkriQhWNj0QI2TppFMwKCsWWLzLfaHDagheytBvAfyW85fyJBDDdPsJusJHPXKB3Lg8UoLXN7D-SPcaItBmR4mq0z4N7b8YstH9vnp6Q9gvFQdTEsVJjBeLVBxDxWP0PpxLT95K4FlZ0j3yRawvvEEyt3yCtLOQtPu1Trp4w3-1sEq2qIBQdDP6NAEIgnGhqWBgj6sQBjWaayBjuTcbi1Oiw9ZfpP9yt09NmNAJ5fd-d9y3ezCQO5e9nBTLfYPokfzj2HDiO8gqVOGIAy0rZXtAD8XbZPV6HpyEAY0a9zx9G23YfJzNRc2vt_d560UMp11LW2WrwrBL9rtC3pPLnhQW8pHY35xse0n4ydtTX8ZpxielzkZxg8BJr14seDnabIurJOKI1lnssoqjKhOD-khrYqkPERDnaV70co8z7Hb82TPK1m0PC-zsixllhWHSNU84XlSZCnnWZns43RPhZRdTjlVouIVyxMaUelY6-sYW9dHyvuZ6ipPDmmkUZD26wXhXCvRMs6XW-LqJXwn5t6zPNHKB_-VIKig16uzAsWZFSd04_bwUXtzq50V589O3nfcR7PT_3WWFrXb325y9kJtYLxZvXvGm83-teZ_BwAA__9fn6Rq">