RISC-V: Avoid calloc() poisoning on musl
Checks
Commit Message
This fixes errors like:
```
In file included from /usr/include/pthread.h:30,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/riscv64-gentoo-linux-musl/bits/gthr-default.h:35,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/riscv64-gentoo-linux-musl/bits/gthr.h:148,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/ext/atomicity.h:35,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/bits/ios_base.h:39,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/ios:42,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/istream:38,
from /usr/lib/gcc/riscv64-gentoo-linux-musl/12/include/g++-v12/sstream:38,
from /var/tmp/portage/sys-devel/gcc-13.0.1_pre20230305/work/gcc-13-20230305/gcc/config/riscv/genrvv-type-indexer.cc:22:
/usr/include/sched.h:84:7: error: attempt to use poisoned "calloc"
84 | void *calloc(size_t, size_t);
| ^
/usr/include/sched.h:124:36: error: attempt to use poisoned "calloc"
124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
| ^
make[3]: *** [Makefile:2855: build/genrvv-type-indexer.o] Error 1
```
See also 3b21c21f3f5726823e19728fdd1571a14aae0fb3 and 49d508065bdd36fb1a9b6aad9666b1edb5e06474,
which was fixed in PR106102.
gcc/ChangeLog:
* config/riscv/genrvv-type-indexer.cc: Add missing <pthread.h> include.
Signed-off-by: Sam James <sam@gentoo.org>
---
gcc/ChangeLog | 5 +++++
gcc/config/riscv/genrvv-type-indexer.cc | 1 +
2 files changed, 6 insertions(+)
@@ -1,3 +1,8 @@
+2023-03-11 Sam James <sam@gentoo.org>
+
+ * config/riscv/genrvv-type-indexer.cc: Add missing <pthread.h> include
+ for musl compatibility.
+
2023-03-10 Jakub Jelinek <jakub@redhat.com>
PR target/107703
@@ -14,6 +14,7 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "bconfig.h"
+#define INCLUDE_PTHREAD_H
#include "system.h"
#include "errors.h"