This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: emulating tls for systems without
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Jul 2007 08:16:08 -0400
- Subject: Re: emulating tls for systems without
- References: <20060920143207.GO12531@devserv.devel.redhat.com> <20060921015910.GE5186@redhat.com> <20061004211212.GA15142@redhat.com> <20070702100005.GX5690@sygehus.dk>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jul 02, 2007 at 12:00:05PM +0200, Rask Ingemann Lambertsen wrote:
> On Wed, Oct 04, 2006 at 02:12:12PM -0700, Richard Henderson wrote:
> > Having finally worked out the tcl bits, and a couple of non-regressions
> > that showed up during a merge, I've committed the following.
> ...
>
> > * emutls.c: New file.
>
> /n/12/rask/src/all/libgcc/../gcc/emutls.c: In function '__emutls_get_address':
> /n/12/rask/src/all/libgcc/../gcc/emutls.c:156: warning: implicit declaration of function 'calloc'
> /n/12/rask/src/all/libgcc/../gcc/emutls.c:156: warning: incompatible implicit declaration of built-in function 'calloc'
> /n/12/rask/src/all/libgcc/../gcc/emutls.c:168: warning: implicit declaration of function 'realloc'
> /n/12/rask/src/all/libgcc/../gcc/emutls.c:168: warning: assignment makes pointer from integer without a cast
You haven't mentioned this is a -Dinhibit_libc build, but it must be IMHO.
Does the following patch help?
2007-07-02 Jakub Jelinek <jakub@redhat.com>
* tsystem.h [inhibit_libc] (calloc, realloc): New prototypes.
--- gcc/tsystem.h 2006-10-05 00:28:42.000000000 +0200
+++ gcc/tsystem.h 2007-07-02 14:11:03.000000000 +0200
@@ -1,6 +1,6 @@
/* Get common system includes and various definitions and declarations
based on target macros.
- Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -57,6 +57,14 @@ extern void *malloc (size_t);
extern void free (void *);
#endif
+#ifndef calloc
+extern void *calloc (size_t, size_t);
+#endif
+
+#ifndef realloc
+extern void *realloc (void *, size_t);
+#endif
+
#ifndef atexit
extern int atexit (void (*)(void));
#endif
Jakub