This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Turn on posix directory for RTEMS
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: Jeff Johnston <jjohnstn at redhat dot com>
- Cc: Joel Sherrill <joel dot sherrill at oarcorp dot com>, "newlib at sources dot redhat dot com" <newlib at sources dot redhat dot com>
- Date: Wed, 19 Nov 2008 11:39:44 +0100
- Subject: Re: Turn on posix directory for RTEMS
- References: <49121B15.2050605@oarcorp.com> <4921EB30.8070001@redhat.com>
On Mon, 2008-11-17 at 17:07 -0500, Jeff Johnston wrote:
> Joel Sherrill wrote:
> > Hi Jeff,
> >
> > You and I discussed this a week or two ago and here
> > is the patch. We had stubs for the exec* routines and
> > a copy of the *dir routines from around newlib 1.8.
> > After this is merged and Ralf turns the crank for
> > new RTEMS gcc/newlib RPMs with this, we can
> > delete some files from RTEMS. :)
> >
> > 2008-11-05 Joel Sherrill <joel.sherrill@oarcorp.com>
> >
> > * configure.host: RTEMS now uses posix subdirectory.
> >
> Patch checked in. Sorry for the delay.
With this patch applied, I am not able to build any rtems-toolchain (!)
anymore:
...
In file included
from /builddir/build/BUILD/rtems-4.10-bfin-rtems4.10-gcc-4.3.2/gcc-4.3.2/newlib/libc/include/stdio.h:34,
from ../../../../../gcc-4.3.2/newlib/libc/posix/rune.h:40,
from ../../../../../gcc-4.3.2/newlib/libc/posix/collate.c:31:
/builddir/build/BUILD/rtems-4.10-bfin-rtems4.10-gcc-4.3.2/build/./gcc/include/stddef.h:214: error: conflicting types for 'size_t'
../../../../../gcc-4.3.2/newlib/libc/posix/runetype.h:54: error:
previous declaration of 'size_t' was here
AFAIS, this code suffers from its BSD-heritage, so I worked around it by
replacing the BSD-types in runetype.h with POSIX/susv3-types from
stddef.h.
Corresponding patch enclosed below.
Ralf
diff -Naur --exclude=CVS --exclude=.cvsignore --exclude='*~' --exclude='.#*' newlib-1.17.0.orig/newlib/libc/posix/runetype.h newlib-1.17.0/newlib/libc/posix/runetype.h
--- newlib-1.17.0.orig/newlib/libc/posix/runetype.h 2008-10-31 22:03:41.000000000 +0100
+++ newlib-1.17.0/newlib/libc/posix/runetype.h 2008-11-19 07:14:46.000000000 +0100
@@ -36,26 +36,15 @@
#ifndef _RUNETYPE_H_
#define _RUNETYPE_H_
+#include <stddef.h>
#include <sys/cdefs.h>
#include <machine/ansi.h>
#ifdef _BSD_RUNE_T_
typedef _BSD_RUNE_T_ rune_t;
#undef _BSD_RUNE_T_
-#endif
-
+#else
typedef int rune_t;
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-typedef unsigned int size_t;
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#undef _BSD_WCHAR_T_
#endif
#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */