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

    <tr>
        <th>Summary</th>
        <td>
            Support use of libc++ with LLVM libc in embedded development
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++,
            libc,
            embedded
      </td>
    </tr>

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

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

<pre>
    We are trying to migrate existing baremetal projects from libstdc++ and newlib to libc++ with libc and we encountered various issues. Most of them appear to be due to the fact that unlike other C library implementations, LLVM libc does not provide a complete set of headers as defined by the C standard, rather it generates headers that only contain types and functions that are supported in baremetal environments.

For example, the [baremetal version of `stdio.h`](https://github.com/llvm/llvm-project/blob/1d900e298449d43547312364751f730b7a0d07d1/libc/config/baremetal/arm/entrypoints.txt#L73-L77) does not include `printf`, `fprintf`, etc. because in baremetal environments, there is typically no concept of standard output or input. This can be characterized as the "don't provide what shouldn't be used" principle.

While libc++ provides options to disable unnecessary functionality to better support restricted environments, we have still encountered cases where libc++ headers transitively pull in unnecessary dependencies. This is a high-level tracking issue, I intend to file separate issues for each case.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM1u60YPfZrxhriGPJKseKHFTS4MfEDu6it61_NDWWzGM8KQsuM-fTGyHSctuujG1vyRh-cc0jDTISL2qn1W7Y-VmWVMuZ9Q8pgY31Y2-Uv_C8FkBMkXigeQBEc6ZCMI-E4sZc-ajEcUE2DK6Q90wjDkdIRAlsU7pZ-VfgYTPUQ8B7IlSCB7PziTjMt6uXJGwOjSHAUzejiZTGlmIOYZeQ0_EwukAWTEI5hpQpNLOIvgZyxfMiIMxgnIaATmGOgNIcmIGV5KlmzyBeg4BTxiFCOUIiv9Aq-vv_-8ovAJGWKSUs2JPIIBl8oDQWBcso9oPGYGw-BxoIge7GVJ_QIsJnqTfQm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