<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95615>95615</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] Failed to bootstrap cross build libc on `riscv32-baremetal-unknown`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Kuree
</td>
</tr>
</table>
<pre>
Using the commit: a5985ca51dd7e0759d65fac9cb2b6a4448ebc404
How to reproduce:
```cmd
$ cmake ../llvm \
-G Ninja \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_ENABLE_RUNTIMES=libc \
-DLLVM_LIBC_FULL_BUILD=ON \
-DLLVM_RUNTIME_TARGETS=riscv32-baremetal-unknown \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="host;RISCV"
$ ninja libc
```
gcc version:
```
$ gcc --version
gcc (SUSE Linux) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
Error message:
```
In file included from /tmp/llvm-project/libc/src/stdio/baremetal/putchar.cpp:9:
/tmp/llvm-project/libc/src/stdio/putchar.h:12:10: fatal error: 'stdio.h' file not found
12 | #include <stdio.h>
| ^~~~~~~~~
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PozgQ_TXOpRQEBvJx4EAIzGQnnbQSMtKcImOK4BnAkW26ty_721cGpnt6evawKLJU9nvPqVflYlqLW4cYkXBDwu2M9aaWKvrSK8RZIcuX6KJFdwNTI3DZtsIQPwYWrlchZ6FXlkt0l-G6XIQV42te0GLBgiBYYcEDNyDulrjxuH6Wz2AkKLwrWfYciT8dkIU7_nhbTjs0AN6yHwiOQ2jWNE8tkDAZDwFg_gkOovvOftmcb_f7rw_X9BBv9un18XT8K03y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