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

    <tr>
        <th>Summary</th>
        <td>
            Cannot build llvm-libc against Ubuntu 14.04
        </td>
    </tr>

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

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

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

<pre>
    I tried building llvm-libc in the overlay mode against Ubuntu 14.04 based sysroot but I ran into two issues:

1. [libc/src/sys/random/getrandom.h](https://github.com/llvm/llvm-project/blob/877226f01fb75d7989acfdcd5a86754f16fe5365/libc/src/sys/random/getrandom.h#L12) includes `sys/random.h` but this header doesn't (yet) exist in Ubuntu 14.04.
2. [libc/src/sys/stat/linux/kernel_statx.h](https://github.com/llvm/llvm-project/blob/dc298fecb79608e6628bd730ece42a6a77197a3c/libc/src/sys/stat/linux/kernel_statx.h#L76) unconditionally uses `SYS_statx` but this value isn't defined because `__NR_statx` isn't defined on Ubuntu 14.04 (which is used in [libc/config/linux/syscall_numbers.h.inc](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/syscall_numbers.h.inc#L2074)).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklMtr7DYUxv8aeSOukY4fshZe9DYYLoQueumiq0GP47EajRQsKcn898WegZmUtKRkIxv7PL7vh_2plNwxII6k-066h0qVvMR1fMa8LjHhU6WjPY8_aF4dWqqL89aFI_X-5fTNO22oCzQvSOMLrl6d6SlapOqoXEiZ_qFLyIXytmYt1Sqhpemc1hgz1SXTH3RVgbqQI82vkbqUCibS_ELYA2HXk9eUdN-3TQSmtO7nORGYVhVsPBGYjpgv9_VCugcCw5Lz8z4Gpu21y0vRtdlrN9nXy7fnNf6FJhOYtI-awDQIAdDPjM9adFbIQSozW2M7NfSia2fez9g1fbcN-KQeaB45EJDUBeOLxURJz-7r64X0bIeRF5fogsriSm3EFAiITAkMZ8zbBHxzKW-076HWF0jwb5BSVnmXG8obgekJ14D-sD19-yota0AOMxotZM8G7HsYtBUNQ4MtqF4JwaVQjfmY1n8Lg-ZR9JvpEkwM1mUXg_L-TEu6IPz5589L8Tt6L8oXpO6KzuLswvbNolEl4dZ2OPz2-63vn4XxPduN_evizEJd2hbbDf4Ns4lhdsc7D-mcjPL-EMpJ45rqpXbBfI3xSblw4_fJjdA8AhMtAUlA1pUdGysbqSoceS-lZA0bumoZpWKcCTULML2UrRWNGjo02gIKM2tWuREYNJzzhks-sK7Wjeixt42aOSCHjrQMT8r5ehNfx_VY7X_wKIB3vPJKo097rABcHMAWMOu4e9XlmEjLvEs53QZklz2Ov6oQ9ohw3t4lzUepUpXVj_8b7zVpYNql_h0AAP__Mxidyw">