source: rtems/contrib/crossrpms/patches/newlib-1.18.0-rtems4.11-20100617.diff @ 9a458f9

4.115
Last change on this file since 9a458f9 was 9a458f9, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/17/10 at 16:36:00

New.

  • Property mode set to 100644
File size: 40.0 KB
RevLine 
[9a458f9]1diff -Naur newlib-1.18.0.orig/newlib/ChangeLog.rtems newlib-1.18.0/newlib/ChangeLog.rtems
2--- newlib-1.18.0.orig/newlib/ChangeLog.rtems   1970-01-01 01:00:00.000000000 +0100
3+++ newlib-1.18.0/newlib/ChangeLog.rtems        2010-06-17 16:44:57.000000000 +0200
4@@ -0,0 +1,206 @@
5+2010-06-17     Ralf Corsépius <ralf.corsepius@rtems.org>
6+
7+       * libc/sys/rtems/machine/_types.h: Special case for sparc64.
8+
9+2010-04-23     Ralf Corsépius <ralf.corsepius@rtems.org>
10+
11+       * libc/sys/rtems/machine/_types.h: Add _mode_t.
12+       * libc/include/sys/types.h: Derive mode_t from  _mode_t.
13+
14+2010-04-02     Ralf Corsépius <ralf.corsepius@rtems.org>
15+
16+       * libc/include/sched.h, libc/include/sys/sched.h:
17+       Adopt newlib-cvs's versions.
18+
19+2010-03-25     Ralf Corsépius <ralf.corsepius@rtems.org>
20+
21+       * libc/include/strings.h: New (split-out from string.h).
22+       * libc/include/string.h: Remove bcmp, bcopy, bzero, ffs, index, rindex,
23+       strcasecmp, strncasecmp (Moved to strings.h).
24+       Remove strcmpi, stricmp, strncmpi, strnicmp.
25+       * libc/misc/ffs.c: Use <strings.h> instead of <string.h>.
26+       * libc/string/bcmp.c: Use <strings.h> instead of <string.h>.
27+       * libc/string/bzero.c: Use <strings.h> instead of <string.h>.
28+       * libc/string/rindex.c: Use <strings.h> instead of <string.h>.
29+       * libc/string/strcasecmp.c: Use <strings.h> instead of <string.h>.
30+       * libc/string/strcasecmp.c: Use <strings.h> instead of <string.h>.
31+
32+2010-03-23     Ralf Corsépius <ralf.corsepius@rtems.org>
33+
34+       * libc/sys/rtems/machine/_types.h: Add i386 to 64bit off_t targets.
35+
36+2010-03-10     Ralf Corsépius <ralf.corsepius@rtems.org>
37+
38+       * libc/posix/telldir.c: Adopt newlib-cvs's telldir.c
39+
40+2010-02-10     Ralf Corsépius <ralf.corsepius@rtems.org>
41+
42+       * libc/sys/rtems/machine/_types.h: Use __int64_t for _off_t, fpos_t for
43+       selected targets.
44+
45+2010-02-05     Ralf Corsépius <ralf.corsepius@rtems.org>
46+
47+       * libc/posix/telldir.c: Remove bogus nested prototype of lseek().
48+
49+2010-01-11  Sebastian Huber <sebastian.huber@embedded-brains.de>
50+
51+       * libc/posix/telldir.c (_cleanupdir): Fixed usage of freed memory.
52+
53+2009-12-18     Ralf Corsépius <ralf.corsepius@rtems.org>
54+
55+       * libc/search/db_local.h:
56+       Use __uint32_t instead of u_int (prototype mismatches).
57+       * libc/search/extern.h (__buf_init):
58+       Use __uint32_t instead of int (16 bit target portability).
59+       * libc/search/hash_buf.c: Use ptrdiff_t instead of __uint32_t,
60+       use __uint32_t instead of int (16 bit target portability).
61+       * libc/search/hash.h: Use __uint32_it instead of int
62+       (16 bit target portability).
63+       * libm/common/modfl.c: Add cast to (double*) to avoid GCC warning.
64+       * libm/common/sf_llrint.c, libm/common/sf_round.c: Add explicit
65+       casts to __uint32_t to avoid overflows on implicit casts.
66+
67+2009-12-18     Ralf Corsépius <ralf.corsepius@rtems.org>
68+
69+       Merger with newlib-1.18.0.
70+
71+2009-10-29     Ralf Corsépius <ralf.corsepius@rtems.org>
72+
73+       * libc/sys/rtems/machine/_types.h: Rework.
74+       * libc/sys/rtems/machine/stdint.h: Remove.
75+       * libc/include/inttypes.h:
76+       Rework logic to determine PRI*PTR.
77+       Prefer long64 over longlong64.
78+       * libc/include/machine/_default_types.h:
79+       Sync logic for __int32 with stdint.h (Prefer long over int).
80+       * libc/include/stdint.h:
81+       Remove __SPU__ hack.
82+       Prefer int for int16_t (sync with _default_types.h).
83+       Rework intptr_t determination.
84+
85+2009-10-28     Ralf Corsépius <ralf.corsepius@rtems.org>
86+
87+       * libc/sys/rtems/machine/_types.h: New.
88+       Add custom time for _ssize_t.
89+       * libc/stdlib/assert.c: Sync with newlib-CVS.
90+       * configure.host: Add -DHAVE_ASSERT_FUNC to newlib_cflags.
91+
92+2009-10-27     Ralf Corsépius <ralf.corsepius@rtems.org>
93+
94+       * libc/include/sys/pthread.h:
95+       Add pthread_atfork (Mandated by IEEE Std 1003.1-2008).
96+       Add pthread_rwlock_unlock (Formerly missing)
97+
98+2009-10-26     Ralf Corsépius <ralf.corsepius@rtems.org>
99+
100+       * libc/include/sys/signal.h: Sync with newlib-CVS.
101+
102+2009-10-09     Ralf Corsépius <ralf.corsepius@rtems.org>
103+
104+       * libc/include/sys/signal.h: Use pid_t as 1st arg to kill()
105+       (mandated by POSIX).
106+
107+2009-09-22     Ralf Corsépius <ralf.corsepius@rtems.org>
108+
109+       * libc/sys/rtems/sys/queue.h: Update copyright (from FreeBSD).
110+       Remove CIRCLEQ_*.
111+       * libc/search/hcreate.c: Don't include sys/queue.h.
112+
113+2009-09-18  Christopher Faylor  <me+cygwin@cgf.cx>
114+
115+       * libc/include/sys/unistd.h: Declare getpagesize as returning
116+       POSIX-mandated int.
117+
118+2009-09-16     Ralf Corsépius <ralf.corsepius@rtems.org>
119+
120+       * libc/sys/rtems/crt0.c: Use while(1) in _exit stub to silence GCC "noreturn"
121+       warning.
122+
123+2009-09-15     Ralf Corsépius <ralf.corsepius@rtems.org>
124+
125+       * libc/include/stdlib.h: Add posix_memalign.
126+
127+2009-09-11     Ralf Corsépius <ralf.corsepius@rtems.org>
128+
129+       * configure.host (m32c): Remove -D_ABORT_PROVIDED.
130+
131+2009-09-10     Ralf Corsépius <ralf.corsepius@rtems.org>
132+
133+       * configure.host: Add -D_NO_POPEN.
134+       * libc/sys/rtems/crt0.c: Don't provide waitpid unless used.
135+
136+2009-09-09     Ralf Corsépius <ralf.corsepius@rtems.org>
137+
138+       * configure.host: Add -D_NO_WORDEXP.
139+
140+2009-09-06     Ralf Corsépius <ralf.corsepius@rtems.org>
141+
142+       * libc/sys/rtems/crt0.c: Add issetugid.
143+
144+2009-09-02     Ralf Corsépius <ralf.corsepius@rtems.org>
145+
146+       * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB.
147+
148+2009-07-27     Ralf Corsépius <ralf.corsepius@rtems.org>
149+
150+       * libc/sys/rtems/crt0.c: Add _isatty_r.
151+
152+2009-07-06     Joel Sherrill <joel.sherrill@oarcorp.com>
153+
154+       * libc/include/sys/features.h: Define _UNIX98_THREAD_MUTEX_ATTRIBUTES.
155+
156+2009-05-05     Ralf Corsépius <ralf.corsepius@rtems.org>
157+
158+       * configure.host: Remove -DMISSING_SYSCALL_NAMES.
159+
160+2009-03-11     Ralf Corsépius <ralf.corsepius@rtems.org>
161+
162+       * libc/stdlib/assert.c: Don't build __assert_func.
163+       * libc/sys/rtems/crt0.c: Add __assert_func.
164+
165+2009-03-09     Ralf Corsépius <ralf.corsepius@rtems.org>
166+
167+       * libc/machine/powerpc/times.c: Remove.
168+       * libc/machine/powerpc/Makefile.am: Remove times.c.
169+       * libc/machine/powerpc/Makefile.in: Regenerate.
170+
171+2009-02-24     Ralf Corsépius <ralf.corsepius@rtems.org>
172+
173+       * libc/unix/ttyname.c: Sync with newlib-cvs.
174+       * configure.host: Add -DHAVE_BLKSIZE to newlib_cflags.
175+
176+2009-02-22     Ralf Corsépius <ralf.corsepius@rtems.org>
177+
178+       * libc/sys/rtems/machine/stdint.h: Add __lm32__.
179+       * libc/machine/lm32/configure.in: Set AC_CONFIG_SRC to setjmp.S.
180+       * libc/machine/lm32/configure: Regenerate.
181+
182+2009-02-20     Ralf Corsépius <ralf.corsepius@rtems.org>
183+
184+       * libc/unix/Makefile.in: Regenerate.
185+
186+2009-02-20  Craig Howland <howland@LGSInnovations.com> on behalf of
187+       Sebastian Huber <sebastian.huber@embedded-brains.de>
188+
189+       * libc/unix/ttyname.c:  Remove ttyname_r() (to a new file to avoid
190+       coupling ttyname_r() and ttyname() due to the latter's large buffer).
191+       * libc/unix/ttyname_r.c:  New file to hold ttyname_r(), previously in
192+       ttyname.c.
193+       * libc/unix/ttyname.h:  New file (common size definition for the 2
194+       ttyname*c files that are now split).
195+       * libc/unix/Makefile.am (ELIX_2_SOURCES):  Add ttyname_r.c.
196+
197+2009-02-16     Ralf Corsépius <ralf.corsepius@rtems.org>
198+
199+       * libc/sys/rtems/sys/param.h:
200+       Update copyright notice from FreeBSD.
201+       Remove HZ.
202+       Add #include <sys/priority.h>
203+       Remove priority handling (moved to sys/priority.h).
204+       Remove CLBYTES (Unused, abandoned in BSD).
205+
206+2009-02-06     Ralf Corsépius <ralf.corsepius@rtems.org>
207+
208+       * libc/include/sched.h:
209+       Remove (collides with RTEMS's schedul.h).
210+
211diff -Naur newlib-1.18.0.orig/newlib/libc/include/inttypes.h newlib-1.18.0/newlib/libc/include/inttypes.h
212--- newlib-1.18.0.orig/newlib/libc/include/inttypes.h   2009-01-19 23:02:06.000000000 +0100
213+++ newlib-1.18.0/newlib/libc/include/inttypes.h        2010-06-17 13:18:32.000000000 +0200
214@@ -242,6 +242,20 @@
215 #define SCNxMAX                __SCNMAX(x)
216 
217 /* ptr types */
218+#if INTPTR_MAX == INT64_MAX
219+#define __PRIPTR(x) __PRI64(x)
220+#define __SCNPTR(x) __SCN64(x)
221+#elif INTPTR_MAX == INT32_MAX
222+#define __PRIPTR(x) __PRI32(x)
223+#define __SCNPTR(x) __SCN32(x)
224+#elif INTPTR_MAX == INT16_MAX
225+#define __PRIPTR(x) __PRI16(x)
226+#define __SCNPTR(x) __SCN16(x)
227+#else
228+#error cannot determine PRI*PTR
229+#endif
230+
231+#if 0
232 #if __have_long64
233 #define __PRIPTR(x) __STRINGIFY(l##x)
234 #define __SCNPTR(x) __STRINGIFY(l##x)
235@@ -252,6 +266,7 @@
236 #define __PRIPTR(x) __STRINGIFY(x)
237 #define __SCNPTR(x) __STRINGIFY(x)
238 #endif
239+#endif
240 
241 #define PRIdPTR                __PRIPTR(d)
242 #define PRIiPTR                __PRIPTR(i)
243diff -Naur newlib-1.18.0.orig/newlib/libc/include/machine/_default_types.h newlib-1.18.0/newlib/libc/include/machine/_default_types.h
244--- newlib-1.18.0.orig/newlib/libc/include/machine/_default_types.h     2008-06-12 00:14:54.000000000 +0200
245+++ newlib-1.18.0/newlib/libc/include/machine/_default_types.h  2010-06-17 13:18:32.000000000 +0200
246@@ -54,14 +54,14 @@
247 #endif
248 #endif
249 
250-#if __EXP(INT_MAX) == 0x7fffffffL
251-typedef signed int __int32_t;
252-typedef unsigned int __uint32_t;
253-#define ___int32_t_defined 1
254-#elif __EXP(LONG_MAX) == 0x7fffffffL
255+#if __EXP(LONG_MAX) == 0x7fffffffL
256 typedef signed long __int32_t;
257 typedef unsigned long __uint32_t;
258 #define ___int32_t_defined 1
259+#elif __EXP(INT_MAX) == 0x7fffffffL
260+typedef signed int __int32_t;
261+typedef unsigned int __uint32_t;
262+#define ___int32_t_defined 1
263 #elif __EXP(SHRT_MAX) == 0x7fffffffL
264 typedef signed short __int32_t;
265 typedef unsigned short __uint32_t;
266diff -Naur newlib-1.18.0.orig/newlib/libc/include/sched.h newlib-1.18.0/newlib/libc/include/sched.h
267--- newlib-1.18.0.orig/newlib/libc/include/sched.h      2007-09-21 23:02:15.000000000 +0200
268+++ newlib-1.18.0/newlib/libc/include/sched.h   2010-06-17 13:18:32.000000000 +0200
269@@ -1,11 +1,94 @@
270+/*
271+ *  Written by Joel Sherrill <joel@OARcorp.com>.
272+ *
273+ *  COPYRIGHT (c) 1989-2010.
274+ *  On-Line Applications Research Corporation (OAR).
275+ *
276+ *  Permission to use, copy, modify, and distribute this software for any
277+ *  purpose without fee is hereby granted, provided that this entire notice
278+ *  is included in all copies of any software which is or includes a copy
279+ *  or modification of this software.
280+ *
281+ *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
282+ *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
283+ *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
284+ *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
285+ *
286+ *  $Id$
287+ */
288+
289 #ifndef _SCHED_H_
290 #define _SCHED_H_
291 
292+#include <sys/types.h>
293+#include <sys/sched.h>
294+
295 #ifdef __cplusplus
296 extern "C" {
297 #endif
298 
299-#include <sys/sched.h>
300+#if defined(_POSIX_PRIORITY_SCHEDULING)
301+/*
302+ *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803
303+ */
304+int sched_setparam(
305+  pid_t                     __pid,
306+  const struct sched_param *__param
307+);
308+
309+/*
310+ *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800
311+ */
312+int sched_getparam(
313+  pid_t                     __pid,
314+  struct sched_param       *__param
315+);
316+
317+/*
318+ *  XBD 13 - Set Scheduling Policy and Scheduling Parameters,
319+ *         P1003.1b-2008, p. 1805
320+ */
321+int sched_setscheduler(
322+  pid_t                     __pid,
323+  int                       __policy,
324+  const struct sched_param *__param
325+);
326+
327+/*
328+ *  XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801
329+ */
330+int sched_getscheduler(
331+  pid_t                     __pid
332+);
333+
334+/*
335+ *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799
336+ */
337+int sched_get_priority_max(
338+  int __policy
339+);
340+
341+int sched_get_priority_min(
342+  int  __policy
343+);
344+
345+/*
346+ *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802
347+ */
348+int sched_rr_get_interval(
349+  pid_t             __pid,
350+  struct timespec  *__interval
351+);
352+#endif /* _POSIX_PRIORITY_SCHEDULING */
353+
354+#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
355+
356+/*
357+ *  XBD 13 - Yield Processor, P1003.1b-2008, p. 1807
358+ */
359+int sched_yield( void );
360+
361+#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
362 
363 #ifdef __cplusplus
364 }
365diff -Naur newlib-1.18.0.orig/newlib/libc/include/stdint.h newlib-1.18.0/newlib/libc/include/stdint.h
366--- newlib-1.18.0.orig/newlib/libc/include/stdint.h     2009-04-24 23:55:07.000000000 +0200
367+++ newlib-1.18.0/newlib/libc/include/stdint.h  2010-06-17 13:18:32.000000000 +0200
368@@ -33,7 +33,7 @@
369 /* Check if "long" is 64bit or 32bit wide */
370 #if __STDINT_EXP(LONG_MAX) > 0x7fffffff
371 #define __have_long64 1
372-#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
373+#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff
374 #define __have_long32 1
375 #endif
376 
377@@ -49,14 +49,14 @@
378 #define __int_least8_t_defined 1
379 #endif
380 
381-#if __STDINT_EXP(SHRT_MAX) == 0x7fff
382-typedef signed short int16_t;
383-typedef unsigned short uint16_t;
384-#define __int16_t_defined 1
385-#elif __STDINT_EXP(INT_MAX) == 0x7fff
386+#if __STDINT_EXP(INT_MAX) == 0x7fff
387 typedef signed int int16_t;
388 typedef unsigned int uint16_t;
389 #define __int16_t_defined 1
390+#elif __STDINT_EXP(SHRT_MAX) == 0x7fff
391+typedef signed short int16_t;
392+typedef unsigned short uint16_t;
393+#define __int16_t_defined 1
394 #elif __STDINT_EXP(SCHAR_MAX) == 0x7fff
395 typedef signed char int16_t;
396 typedef unsigned char uint16_t;
397@@ -239,6 +239,29 @@
398  * GCC doesn't provide an appropriate macro for [u]intptr_t
399  * For now, use __PTRDIFF_TYPE__
400  */
401+#if defined(__SIZEOF_POINTER__)
402+#if __SIZEOF_POINTER__ == 8
403+  typedef int64_t intptr_t;
404+  typedef uint64_t uintptr_t;
405+#define INTPTR_MAX INT64_MAX
406+#define INTPTR_MIN INT64_MIN
407+#define UINTPTR_MAX UINT64_MAX
408+#elif __SIZEOF_POINTER__ == 4
409+  typedef int32_t intptr_t;
410+  typedef uint32_t uintptr_t;
411+#define INTPTR_MAX INT32_MAX
412+#define INTPTR_MIN INT32_MIN
413+#define UINTPTR_MAX UINT32_MAX
414+#elif __SIZEOF_POINTER__ == 2
415+  typedef int16_t intptr_t;
416+  typedef uint16_t uintptr_t;
417+#define INTPTR_MAX INT16_MAX
418+#define INTPTR_MIN INT16_MIN
419+#define UINTPTR_MAX UINT16_MAX
420+#else
421+#error cannot determine intptr_t
422+#endif
423+#else
424 #if defined(__PTRDIFF_TYPE__)
425 typedef signed __PTRDIFF_TYPE__ intptr_t;
426 typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
427@@ -260,6 +283,7 @@
428 #define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
429 #define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
430 #endif
431+#endif
432 
433 /* Limits of Specified-Width Integer Types */
434 
435diff -Naur newlib-1.18.0.orig/newlib/libc/include/string.h newlib-1.18.0/newlib/libc/include/string.h
436--- newlib-1.18.0.orig/newlib/libc/include/string.h     2008-06-18 17:27:27.000000000 +0200
437+++ newlib-1.18.0/newlib/libc/include/string.h  2010-06-17 13:18:32.000000000 +0200
438@@ -49,18 +49,11 @@
439 #ifndef __STRICT_ANSI__
440 char   *_EXFUN(strtok_r,(char *, const char *, char **));
441 
442-int     _EXFUN(bcmp,(const void *, const void *, size_t));
443-void    _EXFUN(bcopy,(const void *, void *, size_t));
444-void    _EXFUN(bzero,(void *, size_t));
445-int     _EXFUN(ffs,(int));
446-char   *_EXFUN(index,(const char *, int));
447 _PTR    _EXFUN(memccpy,(_PTR, const _PTR, int, size_t));
448 _PTR    _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
449 _PTR    _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t));
450-char   *_EXFUN(rindex,(const char *, int));
451 char   *_EXFUN(stpcpy,(char *, const char *));
452 char   *_EXFUN(stpncpy,(char *, const char *, size_t));
453-int     _EXFUN(strcasecmp,(const char *, const char *));
454 char   *_EXFUN(strcasestr,(const char *, const char *));
455 char   *_EXFUN(strdup,(const char *));
456 char   *_EXFUN(_strdup_r,(struct _reent *, const char *));
457@@ -69,7 +62,6 @@
458 char   *_EXFUN(strerror_r,(int, char *, size_t));
459 size_t  _EXFUN(strlcat,(char *, const char *, size_t));
460 size_t  _EXFUN(strlcpy,(char *, const char *, size_t));
461-int     _EXFUN(strncasecmp,(const char *, const char *, size_t));
462 size_t  _EXFUN(strnlen,(const char *, size_t));
463 char   *_EXFUN(strsep,(char **, const char *));
464 char   *_EXFUN(strlwr,(char *));
465@@ -81,20 +73,6 @@
466 int     _EXFUN(strtosigno, (const char *__name));
467 #endif
468 
469-/* These function names are used on Windows and perhaps other systems.  */
470-#ifndef strcmpi
471-#define strcmpi strcasecmp
472-#endif
473-#ifndef stricmp
474-#define stricmp strcasecmp
475-#endif
476-#ifndef strncmpi
477-#define strncmpi strncasecmp
478-#endif
479-#ifndef strnicmp
480-#define strnicmp strncasecmp
481-#endif
482-
483 #endif /* ! __STRICT_ANSI__ */
484 
485 #include <sys/string.h>
486diff -Naur newlib-1.18.0.orig/newlib/libc/include/strings.h newlib-1.18.0/newlib/libc/include/strings.h
487--- newlib-1.18.0.orig/newlib/libc/include/strings.h    1970-01-01 01:00:00.000000000 +0100
488+++ newlib-1.18.0/newlib/libc/include/strings.h 2010-06-17 13:18:32.000000000 +0200
489@@ -0,0 +1,44 @@
490+/*
491+ * strings.h
492+ *
493+ * Definitions for string operations.
494+ */
495+
496+#ifndef _STRINGS_H_
497+#define _STRINGS_H_
498+
499+#include "_ansi.h"
500+#include <sys/reent.h>
501+
502+#include <sys/types.h> /* for size_t */
503+#include <locale.h> /* for locale_t */
504+
505+_BEGIN_STD_C
506+
507+#ifndef __STRICT_ANSI__
508+/*
509+ * Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
510+ * Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
511+ */
512+int     _EXFUN(bcmp,(const void *, const void *, size_t));
513+void    _EXFUN(bcopy,(const void *, void *, size_t));
514+void    _EXFUN(bzero,(void *, size_t));
515+char   *_EXFUN(index,(const char *, int));
516+char   *_EXFUN(rindex,(const char *, int));
517+#endif /* ! __STRICT_ANSI__ */
518+
519+int     _EXFUN(ffs,(int));
520+int     _EXFUN(strcasecmp,(const char *, const char *));
521+#if 0
522+/* Not implemented */
523+int     _EXFUN(strcasecmp_l,(const char *, const char *, locale_t));
524+#endif
525+int     _EXFUN(strncasecmp,(const char *, const char *, size_t));
526+#if 0
527+/* Not implemented */
528+int     _EXFUN(strncasecmp_l,(const char *, const char *, size_t, locale_t));
529+#endif
530+
531+_END_STD_C
532+
533+#endif /* _STRINGS_H_ */
534diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/sched.h newlib-1.18.0/newlib/libc/include/sys/sched.h
535--- newlib-1.18.0.orig/newlib/libc/include/sys/sched.h  2002-06-20 21:51:24.000000000 +0200
536+++ newlib-1.18.0/newlib/libc/include/sys/sched.h       2010-06-17 13:18:32.000000000 +0200
537@@ -1,7 +1,7 @@
538 /*
539  *  Written by Joel Sherrill <joel@OARcorp.com>.
540  *
541- *  COPYRIGHT (c) 1989-2000.
542+ *  COPYRIGHT (c) 1989-2010.
543  *  On-Line Applications Research Corporation (OAR).
544  *
545  *  Permission to use, copy, modify, and distribute this software for any
546@@ -14,51 +14,53 @@
547  *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
548  *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
549  *
550- *  $Id$
551+ *  $Id$
552  */
553 
554 
555-#ifndef __POSIX_SYS_SCHEDULING_h
556-#define __POSIX_SYS_SCHEDULING_h
557+#ifndef _SYS_SCHED_H_
558+#define _SYS_SCHED_H_
559 
560 #ifdef __cplusplus
561 extern "C" {
562 #endif
563 
564-#include <sys/unistd.h>
565-
566-#include <sys/types.h>
567-#include <sys/time.h>
568-
569-/* Scheduling Policies, P1003.1b-1993, p. 250
570-   NOTE:  SCHED_SPORADIC added by P1003.4b/D8, p. 34.  */
571-
572+/* Scheduling Policies */
573+/* Open Group Specifications Issue 6 */
574+#if defined(__CYGWIN__)
575+#define SCHED_OTHER    3
576+#else
577 #define SCHED_OTHER    0
578+#endif
579+
580 #define SCHED_FIFO     1
581 #define SCHED_RR       2
582 
583 #if defined(_POSIX_SPORADIC_SERVER)
584-#define SCHED_SPORADIC 3
585+#define SCHED_SPORADIC 4
586 #endif
587 
588-/* Scheduling Parameters, P1003.1b-1993, p. 249
589-   NOTE:  Fields whose name begins with "ss_" added by P1003.4b/D8, p. 33.  */
590+/* Scheduling Parameters */
591+/* Open Group Specifications Issue 6 */
592 
593 struct sched_param {
594   int sched_priority;           /* Process execution scheduling priority */
595 
596-#if defined(_POSIX_SPORADIC_SERVER)
597-  int ss_low_priority;          /* Low scheduling priority for sporadic */
598+#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER)
599+  int sched_ss_low_priority;    /* Low scheduling priority for sporadic */
600                                 /*   server */
601-  struct timespec ss_replenish_period;
602+  struct timespec sched_ss_repl_period;
603                                 /* Replenishment period for sporadic server */
604-  struct timespec ss_initial_budget;   /* Initial budget for sporadic server */
605+  struct timespec sched_ss_init_budget;
606+                               /* Initial budget for sporadic server */
607+  int sched_ss_max_repl;       /* Maximum pending replenishments for */
608+                               /* sporadic server */
609 #endif
610 };
611 
612 #ifdef __cplusplus
613 }
614-#endif
615+#endif
616 
617 #endif
618 /* end of include file */
619diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/types.h newlib-1.18.0/newlib/libc/include/sys/types.h
620--- newlib-1.18.0.orig/newlib/libc/include/sys/types.h  2009-09-28 18:42:21.000000000 +0200
621+++ newlib-1.18.0/newlib/libc/include/sys/types.h       2010-06-17 13:18:32.000000000 +0200
622@@ -176,7 +176,11 @@
623 #endif
624 typedef _ssize_t ssize_t;
625 
626-#ifndef __CYGWIN__
627+#if defined(__rtems__)
628+typedef _mode_t mode_t;
629+#endif
630+
631+#if !defined(__CYGWIN__) && !defined(__rtems__)
632 #ifdef __MS_types__
633 typedef        char *  addr_t;
634 typedef int mode_t;
635diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.am newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.am
636--- newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.am  2007-05-24 19:33:35.000000000 +0200
637+++ newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.am       2010-06-17 13:18:32.000000000 +0200
638@@ -10,7 +10,7 @@
639 
640 AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
641 
642-lib_a_SOURCES = setjmp.S times.c
643+lib_a_SOURCES = setjmp.S
644 lib_a_CCASFLAGS=$(AM_CCASFLAGS)
645 lib_a_CFLAGS=$(AM_CFLAGS)
646 lib_a_LIBADD = @extra_objs@
647diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.in newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.in
648--- newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.in  2009-10-21 00:44:03.000000000 +0200
649+++ newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.in       2010-06-17 13:18:32.000000000 +0200
650@@ -51,7 +51,7 @@
651 LIBRARIES = $(noinst_LIBRARIES)
652 ARFLAGS = cru
653 lib_a_AR = $(AR) $(ARFLAGS)
654-am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)
655+am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
656 lib_a_OBJECTS = $(am_lib_a_OBJECTS)
657 DEFAULT_INCLUDES = -I.@am__isrc@
658 depcomp =
659@@ -173,7 +173,7 @@
660 AM_CCASFLAGS = $(INCLUDES)
661 noinst_LIBRARIES = lib.a
662 AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
663-lib_a_SOURCES = setjmp.S times.c
664+lib_a_SOURCES = setjmp.S
665 lib_a_CCASFLAGS = $(AM_CCASFLAGS)
666 lib_a_CFLAGS = $(AM_CFLAGS)
667 lib_a_LIBADD = @extra_objs@
668@@ -184,7 +184,7 @@
669 all: all-am
670 
671 .SUFFIXES:
672-.SUFFIXES: .S .c .o .obj
673+.SUFFIXES: .S .o .obj
674 am--refresh:
675        @:
676 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
677@@ -245,18 +245,6 @@
678 lib_a-setjmp.obj: setjmp.S
679        $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
680 
681-.c.o:
682-       $(COMPILE) -c $<
683-
684-.c.obj:
685-       $(COMPILE) -c `$(CYGPATH_W) '$<'`
686-
687-lib_a-times.o: times.c
688-       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c
689-
690-lib_a-times.obj: times.c
691-       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`
692-
693 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
694        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
695        unique=`for i in $$list; do \
696diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/times.c newlib-1.18.0/newlib/libc/machine/powerpc/times.c
697--- newlib-1.18.0.orig/newlib/libc/machine/powerpc/times.c      2002-07-22 22:26:51.000000000 +0200
698+++ newlib-1.18.0/newlib/libc/machine/powerpc/times.c   1970-01-01 01:00:00.000000000 +0100
699@@ -1,36 +0,0 @@
700-/* Time support routines for PowerPC.
701- *
702- * Written by Aldy Hernandez.
703- */
704-
705-#include <_ansi.h>
706-#include <reent.h>
707-#include <sys/time.h>
708-#include <sys/times.h>
709-#include <sys/resource.h>
710-
711-clock_t
712-times (struct tms *tp)
713-{
714-  struct rusage usage;
715-  union {
716-    struct rusage r;
717-    /* Newlib's rusage has only 2 fields.  We need to make room for
718-       when we call the system's rusage.  This should be enough.  */
719-    int filler[32];
720-  } host_ru;
721-
722-  getrusage (RUSAGE_SELF, (void *)&host_ru);
723-
724-  if (tp)
725-    {
726-      tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000
727-       + host_ru.r.ru_utime.tv_usec;
728-      tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000
729-       + host_ru.r.ru_stime.tv_usec;
730-      tp->tms_cutime = 0;      /* user time, children */
731-      tp->tms_cstime = 0;      /* system time, children */
732-    }
733-
734-  return tp->tms_utime;
735-}
736diff -Naur newlib-1.18.0.orig/newlib/libc/misc/ffs.c newlib-1.18.0/newlib/libc/misc/ffs.c
737--- newlib-1.18.0.orig/newlib/libc/misc/ffs.c   2003-06-06 21:57:51.000000000 +0200
738+++ newlib-1.18.0/newlib/libc/misc/ffs.c        2010-06-17 13:18:32.000000000 +0200
739@@ -24,7 +24,7 @@
740 
741 No supporting OS subroutines are required.  */
742 
743-#include <_ansi.h>
744+#include <strings.h>
745 
746 int
747 _DEFUN(ffs, (word),
748diff -Naur newlib-1.18.0.orig/newlib/libc/posix/telldir.c newlib-1.18.0/newlib/libc/posix/telldir.c
749--- newlib-1.18.0.orig/newlib/libc/posix/telldir.c      2008-11-27 22:01:40.000000000 +0100
750+++ newlib-1.18.0/newlib/libc/posix/telldir.c   2010-06-17 13:18:32.000000000 +0200
751@@ -67,7 +67,7 @@
752 #define        NDIRHASH        32      /* Num of hash lists, must be a power of 2 */
753 #define        LOCHASH(i)      ((i)&(NDIRHASH-1))
754 
755-static long    dd_loccnt;      /* Index of entry for sequential readdir's */
756+static long    dd_loccnt = 1;  /* Index of entry for sequential readdir's */
757 static struct  ddloc *dd_hash[NDIRHASH];   /* Hash list heads for ddlocs */
758 __LOCK_INIT(static, dd_hash_lock);
759 
760@@ -119,40 +119,46 @@
761        register struct ddloc *lp;
762        register struct ddloc **prevlp;
763        struct dirent *dp;
764-       extern long lseek();
765 
766 #ifdef HAVE_DD_LOCK
767        __lock_acquire(dd_hash_lock);
768 #endif
769-       prevlp = &dd_hash[LOCHASH(loc)];
770-       lp = *prevlp;
771-       while (lp != NULL) {
772-               if (lp->loc_index == loc)
773-                       break;
774-               prevlp = &lp->loc_next;
775-               lp = lp->loc_next;
776-       }
777-       if (lp == NULL) {
778+       if (loc != 0) {
779+               prevlp = &dd_hash[LOCHASH(loc)];
780+               lp = *prevlp;
781+               while (lp != NULL) {
782+                       if (lp->loc_index == loc)
783+                               break;
784+                       prevlp = &lp->loc_next;
785+                       lp = lp->loc_next;
786+               }
787+               if (lp == NULL) {
788 #ifdef HAVE_DD_LOCK
789-               __lock_release(dd_hash_lock);
790+                       __lock_release(dd_hash_lock);
791 #endif
792-               return;
793-       }
794-       if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
795-               goto found;
796-       (void) lseek(dirp->dd_fd, lp->loc_seek, 0);
797-       dirp->dd_seek = lp->loc_seek;
798-       dirp->dd_loc = 0;
799-       while (dirp->dd_loc < lp->loc_loc) {
800-               dp = readdir(dirp);
801-               if (dp == NULL)
802-                       break;
803-       }
804+                       return;
805+               }
806+               if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
807+                       goto found;
808+               (void) lseek(dirp->dd_fd, lp->loc_seek, 0);
809+               dirp->dd_seek = lp->loc_seek;
810+               dirp->dd_loc = 0;
811+               while (dirp->dd_loc < lp->loc_loc) {
812+                       dp = readdir(dirp);
813+                       if (dp == NULL)
814+                               break;
815+               }
816 found:
817 #ifdef SINGLEUSE
818-       *prevlp = lp->loc_next;
819-       free((caddr_t)lp);
820+               *prevlp = lp->loc_next;
821+               free((caddr_t)lp);
822 #endif
823+       } else {
824+               // loc 0 means rewinding
825+               (void) lseek(dirp->dd_fd, 0, 0);
826+               dirp->dd_seek = 0;
827+               dirp->dd_loc = 0;
828+       }
829 #ifdef HAVE_DD_LOCK
830        __lock_release(dd_hash_lock);
831 #endif
832@@ -169,26 +175,26 @@
833        __lock_acquire(dd_hash_lock);
834 #endif
835        for (i = 0; i < NDIRHASH; ++i) {
836+               struct ddloc head;
837                register struct ddloc *lp;
838                register struct ddloc *prevlp;
839+
840                lp = dd_hash[i];
841-               while (lp != NULL && lp->loc_dirp == dirp) {
842-                       dd_hash[i] = lp->loc_next;
843-                       prevlp = lp;
844-                       free((caddr_t)lp);
845-                       lp = prevlp->loc_next;
846-               }
847-               prevlp = lp;
848+               head.loc_next = lp;
849+               prevlp = &head;
850                while (lp != NULL) {
851-                       lp = lp->loc_next;
852-                       if (lp != NULL && lp->loc_dirp == dirp) {
853-                               prevlp->loc_next = lp->loc_next;
854+                       struct ddloc *nextlp;
855+
856+                       nextlp = lp->loc_next;
857+                       if (lp->loc_dirp == dirp) {
858+                               prevlp->loc_next = nextlp;
859                                free((caddr_t)lp);
860-                               lp = prevlp;
861                        }
862                        else
863                                prevlp = lp;
864+                       lp = nextlp;
865                }
866+               dd_hash[i] = head.loc_next;
867        }
868 #ifdef HAVE_DD_LOCK
869        __lock_release(dd_hash_lock);
870diff -Naur newlib-1.18.0.orig/newlib/libc/search/db_local.h newlib-1.18.0/newlib/libc/search/db_local.h
871--- newlib-1.18.0.orig/newlib/libc/search/db_local.h    2002-06-25 01:05:08.000000000 +0200
872+++ newlib-1.18.0/newlib/libc/search/db_local.h 2010-06-17 13:18:32.000000000 +0200
873@@ -102,11 +102,11 @@
874 typedef struct __db {
875        DBTYPE type;                    /* Underlying db type. */
876        int (*close)(struct __db *);
877-       int (*del)(const struct __db *, const DBT *, u_int);
878-       int (*get)(const struct __db *, const DBT *, DBT *, u_int);
879-       int (*put)(const struct __db *, DBT *, const DBT *, u_int);
880-       int (*seq)(const struct __db *, DBT *, DBT *, u_int);
881-       int (*sync)(const struct __db *, u_int);
882+       int (*del)(const struct __db *, const DBT *, __uint32_t);
883+       int (*get)(const struct __db *, const DBT *, DBT *, __uint32_t);
884+       int (*put)(const struct __db *, DBT *, const DBT *, __uint32_t);
885+       int (*seq)(const struct __db *, DBT *, DBT *, __uint32_t);
886+       int (*sync)(const struct __db *, __uint32_t);
887        void *internal;                 /* Access method private. */
888        int (*fd)(const struct __db *);
889 } DB;
890diff -Naur newlib-1.18.0.orig/newlib/libc/search/extern.h newlib-1.18.0/newlib/libc/search/extern.h
891--- newlib-1.18.0.orig/newlib/libc/search/extern.h      2002-06-20 21:51:31.000000000 +0200
892+++ newlib-1.18.0/newlib/libc/search/extern.h   2010-06-17 13:18:32.000000000 +0200
893@@ -43,7 +43,7 @@
894 int     __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
895                int, __uint32_t, SPLIT_RETURN *);
896 int     __buf_free(HTAB *, int, int);
897-void    __buf_init(HTAB *, int);
898+void    __buf_init(HTAB *, __uint32_t);
899 __uint32_t      __call_hash(HTAB *, char *, int);
900 int     __delpair(HTAB *, BUFHEAD *, int);
901 int     __expand_table(HTAB *);
902diff -Naur newlib-1.18.0.orig/newlib/libc/search/hash_buf.c newlib-1.18.0/newlib/libc/search/hash_buf.c
903--- newlib-1.18.0.orig/newlib/libc/search/hash_buf.c    2004-05-26 19:57:10.000000000 +0200
904+++ newlib-1.18.0/newlib/libc/search/hash_buf.c 2010-06-17 13:18:32.000000000 +0200
905@@ -118,7 +118,7 @@
906        int newpage;    /* If prev_bp set, indicates a new overflow page. */
907 {
908        BUFHEAD *bp;
909-       __uint32_t is_disk_mask;
910+       ptrdiff_t is_disk_mask;
911        int is_disk, segment_ndx;
912        SEGMENT segp;
913 
914@@ -298,7 +298,7 @@
915 extern void
916 __buf_init(hashp, nbytes)
917        HTAB *hashp;
918-       int nbytes;
919+       __uint32_t nbytes;
920 {
921        BUFHEAD *bfp;
922        int npages;
923diff -Naur newlib-1.18.0.orig/newlib/libc/search/hash.h newlib-1.18.0/newlib/libc/search/hash.h
924--- newlib-1.18.0.orig/newlib/libc/search/hash.h        2008-07-02 20:38:45.000000000 +0200
925+++ newlib-1.18.0/newlib/libc/search/hash.h     2010-06-17 13:18:32.000000000 +0200
926@@ -82,7 +82,7 @@
927 
928 /* Hash Table Information */
929 typedef struct hashhdr {               /* Disk resident portion */
930-       int             magic;          /* Magic NO for hash tables */
931+       __uint32_t      magic;          /* Magic NO for hash tables */
932        int             version;        /* Version ID */
933        __uint32_t      lorder;         /* Byte Order */
934        int             bsize;          /* Bucket/Page Size */
935@@ -97,7 +97,7 @@
936        int             high_mask;      /* Mask to modulo into entire table */
937        int             low_mask;       /* Mask to modulo into lower half of
938                                         * table */
939-       int             ffactor;        /* Fill factor */
940+       __uint32_t      ffactor;        /* Fill factor */
941        int             nkeys;          /* Number of keys in hash table */
942        int             hdrpages;       /* Size of table header */
943        int             h_charkey;      /* value of hash(CHARKEY) */
944diff -Naur newlib-1.18.0.orig/newlib/libc/string/bcmp.c newlib-1.18.0/newlib/libc/string/bcmp.c
945--- newlib-1.18.0.orig/newlib/libc/string/bcmp.c        2005-10-28 23:21:07.000000000 +0200
946+++ newlib-1.18.0/newlib/libc/string/bcmp.c     2010-06-17 13:18:32.000000000 +0200
947@@ -6,11 +6,11 @@
948        bcmp
949 
950 ANSI_SYNOPSIS
951-       #include <string.h>
952+       #include <strings.h>
953        int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
954 
955 TRAD_SYNOPSIS
956-       #include <string.h>
957+       #include <strings.h>
958        int bcmp(<[s1]>, <[s2]>, <[n]>)
959        const void *<[s1]>;
960        const void *<[s2]>;
961@@ -35,7 +35,7 @@
962        bcmp ansi pure
963 */
964 
965-#include <string.h>
966+#include <strings.h>
967 
968 int
969 _DEFUN (bcmp, (m1, m2, n),
970diff -Naur newlib-1.18.0.orig/newlib/libc/string/bcopy.c newlib-1.18.0/newlib/libc/string/bcopy.c
971--- newlib-1.18.0.orig/newlib/libc/string/bcopy.c       2002-05-23 20:46:04.000000000 +0200
972+++ newlib-1.18.0/newlib/libc/string/bcopy.c    2010-06-17 13:18:32.000000000 +0200
973@@ -3,7 +3,7 @@
974        <<bcopy>>---copy memory regions
975 
976 ANSI_SYNOPSIS
977-       #include <string.h>
978+       #include <strings.h>
979        void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>);
980 
981 TRAD_SYNOPSIS
982@@ -26,7 +26,7 @@
983        bcopy - pure
984 */
985 
986-#include <string.h>
987+#include <strings.h>
988 
989 void
990 _DEFUN (bcopy, (b1, b2, length),
991diff -Naur newlib-1.18.0.orig/newlib/libc/string/bzero.c newlib-1.18.0/newlib/libc/string/bzero.c
992--- newlib-1.18.0.orig/newlib/libc/string/bzero.c       2002-05-23 20:46:04.000000000 +0200
993+++ newlib-1.18.0/newlib/libc/string/bzero.c    2010-06-17 13:18:32.000000000 +0200
994@@ -6,11 +6,11 @@
995        bzero
996 
997 ANSI_SYNOPSIS
998-       #include <string.h>
999+       #include <strings.h>
1000        void bzero(void *<[b]>, size_t <[length]>);
1001 
1002 TRAD_SYNOPSIS
1003-       #include <string.h>
1004+       #include <strings.h>
1005        void bzero(<[b]>, <[length]>)
1006        void *<[b]>;
1007        size_t <[length]>;
1008@@ -30,7 +30,7 @@
1009 <<bzero>> requires no supporting OS subroutines.
1010 */
1011 
1012-#include <string.h>
1013+#include <strings.h>
1014 
1015 _VOID
1016 _DEFUN (bzero, (b, length),
1017diff -Naur newlib-1.18.0.orig/newlib/libc/string/index.c newlib-1.18.0/newlib/libc/string/index.c
1018--- newlib-1.18.0.orig/newlib/libc/string/index.c       2000-02-17 20:39:48.000000000 +0100
1019+++ newlib-1.18.0/newlib/libc/string/index.c    2010-06-17 13:18:32.000000000 +0200
1020@@ -10,7 +10,7 @@
1021        char * index(const char *<[string]>, int <[c]>);
1022 
1023 TRAD_SYNOPSIS
1024-       #include <string.h>
1025+       #include <strings.h>
1026        char * index(<[string]>, <[c]>);
1027        char *<[string]>;
1028        int *<[c]>;
1029@@ -33,7 +33,7 @@
1030        index - pure
1031 */
1032 
1033-#include <string.h>
1034+#include <strings.h>
1035 
1036 char *
1037 _DEFUN (index, (s, c),
1038diff -Naur newlib-1.18.0.orig/newlib/libc/string/rindex.c newlib-1.18.0/newlib/libc/string/rindex.c
1039--- newlib-1.18.0.orig/newlib/libc/string/rindex.c      2000-02-17 20:39:48.000000000 +0100
1040+++ newlib-1.18.0/newlib/libc/string/rindex.c   2010-06-17 13:18:32.000000000 +0200
1041@@ -10,7 +10,7 @@
1042        char * rindex(const char *<[string]>, int <[c]>);
1043 
1044 TRAD_SYNOPSIS
1045-       #include <string.h>
1046+       #include <strings.h>
1047        char * rindex(<[string]>, <[c]>);
1048        char *<[string]>;
1049        int *<[c]>;
1050@@ -33,7 +33,7 @@
1051        rindex - pure
1052 */
1053 
1054-#include <string.h>
1055+#include <strings.h>
1056 
1057 char *
1058 _DEFUN (rindex, (s, c),
1059diff -Naur newlib-1.18.0.orig/newlib/libc/string/strcasecmp.c newlib-1.18.0/newlib/libc/string/strcasecmp.c
1060--- newlib-1.18.0.orig/newlib/libc/string/strcasecmp.c  2009-04-23 20:11:22.000000000 +0200
1061+++ newlib-1.18.0/newlib/libc/string/strcasecmp.c       2010-06-17 13:18:32.000000000 +0200
1062@@ -38,7 +38,7 @@
1063        strcasecmp
1064 */
1065 
1066-#include <string.h>
1067+#include <strings.h>
1068 #include <ctype.h>
1069 
1070 int
1071diff -Naur newlib-1.18.0.orig/newlib/libc/string/strncasecmp.c newlib-1.18.0/newlib/libc/string/strncasecmp.c
1072--- newlib-1.18.0.orig/newlib/libc/string/strncasecmp.c 2009-04-23 20:11:22.000000000 +0200
1073+++ newlib-1.18.0/newlib/libc/string/strncasecmp.c      2010-06-17 13:18:32.000000000 +0200
1074@@ -6,11 +6,11 @@
1075        strncasecmp
1076 
1077 ANSI_SYNOPSIS
1078-       #include <string.h>
1079+       #include <strings.h>
1080        int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
1081 
1082 TRAD_SYNOPSIS
1083-       #include <string.h>
1084+       #include <strings.h>
1085        int strncasecmp(<[a]>, <[b]>, <[length]>)
1086        char *<[a]>;
1087        char *<[b]>;
1088@@ -40,7 +40,7 @@
1089        strncasecmp
1090 */
1091 
1092-#include <string.h>
1093+#include <strings.h>
1094 #include <ctype.h>
1095 
1096 int
1097diff -Naur newlib-1.18.0.orig/newlib/libc/sys/rtems/machine/_types.h newlib-1.18.0/newlib/libc/sys/rtems/machine/_types.h
1098--- newlib-1.18.0.orig/newlib/libc/sys/rtems/machine/_types.h   2009-12-17 17:10:41.000000000 +0100
1099+++ newlib-1.18.0/newlib/libc/sys/rtems/machine/_types.h        2010-06-17 16:42:42.000000000 +0200
1100@@ -20,6 +20,9 @@
1101 typedef long signed int _ssize_t;
1102 #endif
1103 #define __ssize_t_defined 1
1104+#elif defined(__sparc__) && defined(__LP64__)
1105+typedef long signed int _ssize_t;
1106+#define __ssize_t_defined 1
1107 #elif defined(__AVR__) || defined(__lm32__) || defined(__m32c__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__) || defined(__sh__)
1108 typedef signed int _ssize_t;
1109 #define __ssize_t_defined 1
1110@@ -31,4 +34,25 @@
1111 
1112 typedef __int32_t blksize_t;
1113 typedef __int32_t blkcnt_t;
1114+
1115+/* EXPERIMENTAL: Use 64bit types */
1116+#if defined(__arm__) || defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__)
1117+/* Use 64bit types */
1118+typedef __int64_t _off_t;
1119+#define __off_t_defined 1
1120+
1121+typedef __int64_t _fpos_t;
1122+#define __fpos_t_defined 1
1123+#else
1124+/* Use 32bit types */
1125+typedef __int32_t _off_t;
1126+#define __off_t_defined 1
1127+
1128+typedef __int32_t _fpos_t;
1129+#define __fpos_t_defined 1
1130+#endif
1131+
1132+typedef __uint32_t _mode_t;
1133+#define __mode_t_defined 1
1134+
1135 #endif
1136diff -Naur newlib-1.18.0.orig/newlib/libm/common/modfl.c newlib-1.18.0/newlib/libm/common/modfl.c
1137--- newlib-1.18.0.orig/newlib/libm/common/modfl.c       2009-04-18 00:15:43.000000000 +0200
1138+++ newlib-1.18.0/newlib/libm/common/modfl.c    2010-06-17 13:18:32.000000000 +0200
1139@@ -36,7 +36,7 @@
1140 long double
1141 modfl (long double x, long double *iptr)
1142 {
1143-  return modf(x, iptr);
1144+  return modf(x, (double*) iptr);
1145 }
1146 #endif
1147 
1148diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_llrint.c newlib-1.18.0/newlib/libm/common/sf_llrint.c
1149--- newlib-1.18.0.orig/newlib/libm/common/sf_llrint.c   2009-04-03 19:39:24.000000000 +0200
1150+++ newlib-1.18.0/newlib/libm/common/sf_llrint.c        2010-06-17 13:18:32.000000000 +0200
1151@@ -71,7 +71,7 @@
1152           GET_FLOAT_WORD (i0, t);
1153           /* Detect the all-zeros representation of plus and
1154              minus zero, which fails the calculation below. */
1155-          if ((i0 & ~(1 << 31)) == 0)
1156+          if ((i0 & ~((__uint32_t)1 << 31)) == 0)
1157               return 0;
1158           j0 = ((i0 >> 23) & 0xff) - 0x7f;
1159           i0 &= 0x7fffff;
1160diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_round.c newlib-1.18.0/newlib/libm/common/sf_round.c
1161--- newlib-1.18.0.orig/newlib/libm/common/sf_round.c    2005-02-24 20:02:35.000000000 +0100
1162+++ newlib-1.18.0/newlib/libm/common/sf_round.c 2010-06-17 13:18:32.000000000 +0200
1163@@ -38,7 +38,7 @@
1164           w &= 0x80000000;
1165           if (exponent_less_127 == -1)
1166             /* Result is +1.0 or -1.0. */
1167-            w |= (127 << 23);
1168+            w |= ((__uint32_t)127 << 23);
1169         }
1170       else
1171         {
1172diff -Naur newlib-1.18.0.orig/newlib/Makefile.am newlib-1.18.0/newlib/Makefile.am
1173--- newlib-1.18.0.orig/newlib/Makefile.am       2009-08-18 23:48:05.000000000 +0200
1174+++ newlib-1.18.0/newlib/Makefile.am    2010-06-17 13:18:32.000000000 +0200
1175@@ -81,7 +81,7 @@
1176        libc.a
1177 endif
1178 
1179-noinst_DATA = stmp-targ-include
1180+BUILT_SOURCES = stmp-targ-include
1181 
1182 toollib_DATA = $(CRT0) $(CRT1)
1183 
1184diff -Naur newlib-1.18.0.orig/newlib/Makefile.in newlib-1.18.0/newlib/Makefile.in
1185--- newlib-1.18.0.orig/newlib/Makefile.in       2009-10-21 00:43:45.000000000 +0200
1186+++ newlib-1.18.0/newlib/Makefile.in    2010-06-17 13:18:32.000000000 +0200
1187@@ -122,7 +122,7 @@
1188        install-pdf-recursive install-ps-recursive install-recursive \
1189        installcheck-recursive installdirs-recursive pdf-recursive \
1190        ps-recursive uninstall-recursive
1191-DATA = $(noinst_DATA) $(toollib_DATA)
1192+DATA = $(toollib_DATA)
1193 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
1194   distclean-recursive maintainer-clean-recursive
1195 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
1196@@ -351,7 +351,7 @@
1197 @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
1198 @USE_LIBTOOL_FALSE@    libc.a
1199 
1200-noinst_DATA = stmp-targ-include
1201+BUILT_SOURCES = stmp-targ-include
1202 toollib_DATA = $(CRT0) $(CRT1)
1203 
1204 # The functions ldexp, frexp and modf are traditionally supplied in
1205@@ -411,7 +411,7 @@
1206 
1207 # dejagnu support
1208 RUNTESTFLAGS =
1209-all: newlib.h
1210+all: $(BUILT_SOURCES) newlib.h
1211        $(MAKE) $(AM_MAKEFLAGS) all-recursive
1212 
1213 .SUFFIXES:
1214@@ -725,14 +725,16 @@
1215        done
1216 check-am:
1217        $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
1218-check: check-recursive
1219+check: $(BUILT_SOURCES)
1220+       $(MAKE) $(AM_MAKEFLAGS) check-recursive
1221 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
1222 installdirs: installdirs-recursive
1223 installdirs-am:
1224        for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
1225          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
1226        done
1227-install: install-recursive
1228+install: $(BUILT_SOURCES)
1229+       $(MAKE) $(AM_MAKEFLAGS) install-recursive
1230 install-exec: install-exec-recursive
1231 install-data: install-data-recursive
1232 uninstall: uninstall-recursive
1233@@ -758,6 +760,7 @@
1234 maintainer-clean-generic:
1235        @echo "This command is intended for maintainers to use"
1236        @echo "it deletes files that may require special tools to rebuild."
1237+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
1238 clean: clean-recursive
1239 
1240 clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
1241@@ -833,8 +836,9 @@
1242 uninstall-am: uninstall-toollibDATA uninstall-toollibLIBRARIES \
1243        uninstall-toollibLTLIBRARIES
1244 
1245-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \
1246-       ctags-recursive install-am install-strip tags-recursive
1247+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
1248+       check-am ctags-recursive install install-am install-strip \
1249+       tags-recursive
1250 
1251 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
1252        all all-am am--refresh check check-DEJAGNU check-am clean \
Note: See TracBrowser for help on using the repository browser.