Crossref, there is are -Wbuiltin-declaration-mismatch warnings in 
libgcc/emutls.c,
cf. https://gcc.gnu.org/PR109289

I decided to leave this to Thomas and Florian and just fix the build issue with
the attached patch. That build issue was also mentioned in PR libgcc/109289.

An alternative would be __builtin, but as the other #define were pre-existing,
I went for the tsystem.h version.

OK for mainline?

Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955
tsystem.h: Declare calloc/realloc #ifdef inhibit_libc

Declare calloc and realloc #ifndef and inhibit_libc is
defined.  Those are used by libgcc/emutls.c.

gcc/ChangeLog:

	* tsystem.h (calloc, realloc): Declare when inhibit_libc.

diff --git a/gcc/tsystem.h b/gcc/tsystem.h
index 081c73345cd..c49ff578cb7 100644
--- a/gcc/tsystem.h
+++ b/gcc/tsystem.h
@@ -47,12 +47,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifdef inhibit_libc
 
 #ifndef malloc
 extern void *malloc (size_t);
 #endif
 
+#ifndef calloc
+extern void *calloc(size_t, size_t);
+#endif
+
+#ifndef realloc
+extern void *realloc(void *, size_t);
+#endif
+
 #ifndef free
 extern void free (void *);
 #endif
 
 #ifndef atexit
 extern int atexit (void (*)(void));

Reply via email to