This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: emulating tls for systems without


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]