source: clfs-embedded/patches/uClibc-0.9.30-branch_update-1.patch@ 320a81a

Last change on this file since 320a81a was 3139927, checked in by Jim Gifford <clfs@…>, 16 years ago

Update uClibc

  • Property mode set to 100644
File size: 87.4 KB
RevLine 
[3139927]1Submitted By: Jim Gifford (jim at cross-lfs dot org)
2Date: 01-24-2009
3Initial Package Version: 0.9.30
4Origin: Upstream
5Upstream Status: Applied
6Description: This is a branch update for uClibc-0.9.30, and should be
7 rechecked periodically.
8
9diff -Naur uClibc-0.9.30.orig/extra/locale/gen_wc8bit.c uClibc-0.9.30/extra/locale/gen_wc8bit.c
10--- uClibc-0.9.30.orig/extra/locale/gen_wc8bit.c 2008-10-09 05:21:41.000000000 -0700
11+++ uClibc-0.9.30/extra/locale/gen_wc8bit.c 2008-11-25 04:33:55.200309000 -0800
12@@ -219,8 +219,8 @@
13 fprintf(out, "\t{ /* %.*s */", n, s0);
14 }
15
16- memset(&csd[numsets],sizeof(charset_data),0);
17- memset(xi, sizeof(xi), 0);
18+ memset(&csd[numsets], 0, sizeof(charset_data));
19+ memset(xi, 0, sizeof(xi));
20 {
21 unsigned long c, wc;
22 int lines;
23diff -Naur uClibc-0.9.30.orig/extra/scripts/conf-header.sh uClibc-0.9.30/extra/scripts/conf-header.sh
24--- uClibc-0.9.30.orig/extra/scripts/conf-header.sh 2007-03-16 19:45:59.000000000 -0700
25+++ uClibc-0.9.30/extra/scripts/conf-header.sh 2009-01-21 14:13:07.946159000 -0800
26@@ -8,7 +8,7 @@
27 fi
28
29 cat <<EOF
30-#if !defined __FEATURES_H && !defined __need_uClibc_config_h
31+#if !defined _FEATURES_H && !defined __need_uClibc_config_h
32 # error Never include <bits/uClibc_config.h> directly; use <features.h> instead
33 #endif
34
35diff -Naur uClibc-0.9.30.orig/include/math.h uClibc-0.9.30/include/math.h
36--- uClibc-0.9.30.orig/include/math.h 2008-10-03 07:24:28.000000000 -0700
37+++ uClibc-0.9.30/include/math.h 2008-12-22 03:55:13.991752000 -0800
38@@ -46,6 +46,10 @@
39 /* Get general and ISO C99 specific information. */
40 #include <bits/mathdef.h>
41
42+#if !(defined _LIBC && (defined NOT_IN_libc && defined IS_IN_libm))
43+# define libm_hidden_proto(name, attrs...)
44+#endif
45+
46 /* The file <bits/mathcalls.h> contains the prototypes for all the
47 actual math functions. These macros are used for those prototypes,
48 so we can easily declare each function as both `name' and `__name',
49@@ -54,16 +58,30 @@
50 #define __MATHCALL(function,suffix, args) \
51 __MATHDECL (_Mdouble_,function,suffix, args)
52 #define __MATHDECL(type, function,suffix, args) \
53- __MATHDECL_1(type, function,suffix, args); \
54- __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
55+ __MATHDECL_1(type, function,suffix, args);
56 #define __MATHCALLX(function,suffix, args, attrib) \
57 __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
58 #define __MATHDECLX(type, function,suffix, args, attrib) \
59 __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
60- __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
61+ __MATHDECLI_MAINVARIANT(function)
62 #define __MATHDECL_1(type, function,suffix, args) \
63 extern type __MATH_PRECNAME(function,suffix) args __THROW
64+/* Decls which are also used internally in libm.
65+ Only the main variant is used internally, no need to try to avoid relocs
66+ for the {l,f} variants. */
67+#define __MATHCALLI(function,suffix, args) \
68+ __MATHDECLI (_Mdouble_,function,suffix, args)
69+#define __MATHDECLI(type, function,suffix, args) \
70+ __MATHDECL_1(type, function,suffix, args); \
71+ __MATHDECLI_MAINVARIANT(function)
72+/* Private helpers for purely macro impls below.
73+ Only make __foo{,f,l} visible but not (the macro-only) foo. */
74+#define __MATHDECL_PRIV(type, function,suffix, args, attrib) \
75+ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) \
76+ __attribute__ (attrib); \
77+ libm_hidden_proto(__MATH_PRECNAME(__##function,suffix))
78
79+#define __MATHDECLI_MAINVARIANT libm_hidden_proto
80 #define _Mdouble_ double
81 #define __MATH_PRECNAME(name,r) __CONCAT(name,r)
82 # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
83@@ -72,7 +90,9 @@
84 #undef _Mdouble_
85 #undef _Mdouble_BEGIN_NAMESPACE
86 #undef _Mdouble_END_NAMESPACE
87-#undef __MATH_PRECNAME
88+#undef __MATH_PRECNAME
89+#undef __MATHDECLI_MAINVARIANT
90+#define __MATHDECLI_MAINVARIANT(x)
91
92 #if defined __USE_MISC || defined __USE_ISOC99
93
94diff -Naur uClibc-0.9.30.orig/include/sched.h uClibc-0.9.30/include/sched.h
95--- uClibc-0.9.30.orig/include/sched.h 2007-02-12 14:52:32.000000000 -0800
96+++ uClibc-0.9.30/include/sched.h 2008-11-15 07:55:31.019090000 -0800
97@@ -63,7 +63,7 @@
98 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
99
100
101-#ifdef __USE_GNU
102+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
103 /* Access macros for `cpu_set'. */
104 #define CPU_SETSIZE __CPU_SETSIZE
105 #define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
106diff -Naur uClibc-0.9.30.orig/include/sys/mman.h uClibc-0.9.30/include/sys/mman.h
107--- uClibc-0.9.30.orig/include/sys/mman.h 2008-07-23 04:19:00.000000000 -0700
108+++ uClibc-0.9.30/include/sys/mman.h 2008-11-15 07:55:31.019090000 -0800
109@@ -157,11 +157,13 @@
110 extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
111 int __flags, ...) __THROW;
112
113+#ifdef __UCLIBC_LINUX_SPECIFIC__
114 /* Remap arbitrary pages of a shared backing store within an existing
115 VMA. */
116 extern int remap_file_pages (void *__start, size_t __size, int __prot,
117 size_t __pgoff, int __flags) __THROW;
118 #endif
119+#endif
120
121
122 /* Open shared memory segment. */
123diff -Naur uClibc-0.9.30.orig/include/sys/sysinfo.h uClibc-0.9.30/include/sys/sysinfo.h
124--- uClibc-0.9.30.orig/include/sys/sysinfo.h 2003-10-22 02:15:57.000000000 -0700
125+++ uClibc-0.9.30/include/sys/sysinfo.h 2008-11-15 07:55:31.019090000 -0800
126@@ -48,7 +48,7 @@
127 /* Returns information on overall system statistics. */
128 extern int sysinfo (struct sysinfo *__info) __THROW;
129
130-
131+#if 0
132 /* Return number of configured processors. */
133 extern int get_nprocs_conf (void) __THROW;
134
135@@ -61,6 +61,7 @@
136
137 /* Return number of available physical pages of memory in the system. */
138 extern long int get_avphys_pages (void) __THROW;
139+#endif
140
141 __END_DECLS
142
143diff -Naur uClibc-0.9.30.orig/include/unistd.h uClibc-0.9.30/include/unistd.h
144--- uClibc-0.9.30.orig/include/unistd.h 2008-07-07 19:41:21.000000000 -0700
145+++ uClibc-0.9.30/include/unistd.h 2008-11-15 07:55:31.019090000 -0800
146@@ -869,10 +869,12 @@
147 __THROW __nonnull ((1)) __wur;
148 #endif
149
150+#if defined __UCLIBC_LINUX_SPECIFIC__
151 /* Revoke access permissions to all processes currently communicating
152 with the control terminal, and then send a SIGHUP signal to the process
153 group of the control terminal. */
154 extern int vhangup (void) __THROW;
155+#endif
156
157 #if 0
158 /* Revoke the access of all descriptors currently open on FILE. */
159diff -Naur uClibc-0.9.30.orig/ldso/ldso/dl-elf.c uClibc-0.9.30/ldso/ldso/dl-elf.c
160--- uClibc-0.9.30.orig/ldso/ldso/dl-elf.c 2008-09-23 08:07:43.000000000 -0700
161+++ uClibc-0.9.30/ldso/ldso/dl-elf.c 2008-11-18 06:01:35.928405000 -0800
162@@ -928,29 +928,3 @@
163 {
164 __dl_parse_dynamic_info(dpnt, dynamic_info, debug_addr, load_off);
165 }
166-
167-/* we want this in ldso.so and libdl.a but nowhere else */
168-#ifdef __USE_GNU
169-#if defined IS_IN_rtld || (defined IS_IN_libdl && ! defined SHARED)
170-extern __typeof(dl_iterate_phdr) __dl_iterate_phdr;
171-int
172-__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
173-{
174- struct elf_resolve *l;
175- struct dl_phdr_info info;
176- int ret = 0;
177-
178- for (l = _dl_loaded_modules; l != NULL; l = l->next) {
179- info.dlpi_addr = l->loadaddr;
180- info.dlpi_name = l->libname;
181- info.dlpi_phdr = l->ppnt;
182- info.dlpi_phnum = l->n_phent;
183- ret = callback (&info, sizeof (struct dl_phdr_info), data);
184- if (ret)
185- break;
186- }
187- return ret;
188-}
189-strong_alias(__dl_iterate_phdr, dl_iterate_phdr)
190-#endif
191-#endif
192diff -Naur uClibc-0.9.30.orig/ldso/ldso/dl-hash.c uClibc-0.9.30/ldso/ldso/dl-hash.c
193--- uClibc-0.9.30.orig/ldso/ldso/dl-hash.c 2008-07-23 04:19:00.000000000 -0700
194+++ uClibc-0.9.30/ldso/ldso/dl-hash.c 2008-11-18 06:01:35.928405000 -0800
195@@ -32,14 +32,6 @@
196
197
198 /* Various symbol table handling functions, including symbol lookup */
199-
200-/*
201- * This is the start of the linked list that describes all of the files present
202- * in the system with pointers to all of the symbol, string, and hash tables,
203- * as well as all of the other good stuff in the binary.
204- */
205-struct elf_resolve *_dl_loaded_modules = NULL;
206-
207 /*
208 * This is the list of modules that are loaded when the image is first
209 * started. As we add more via dlopen, they get added into other
210diff -Naur uClibc-0.9.30.orig/ldso/ldso/dl-symbols.c uClibc-0.9.30/ldso/ldso/dl-symbols.c
211--- uClibc-0.9.30.orig/ldso/ldso/dl-symbols.c 1969-12-31 16:00:00.000000000 -0800
212+++ uClibc-0.9.30/ldso/ldso/dl-symbols.c 2008-11-18 06:01:35.928405000 -0800
213@@ -0,0 +1,21 @@
214+/*
215+ * This contains all symbols shared between
216+ * dynamic linker ld.so and into static libc
217+ *
218+ * Copyright (c) 2008 STMicroelectronics Ltd
219+ * Author: Carmelo Amoroso <carmelo.amoroso@st.com>
220+ *
221+ *
222+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
223+ *
224+ */
225+
226+/*
227+ * This is the start of the linked list that describes all of the files present
228+ * in the system with pointers to all of the symbol, string, and hash tables,
229+ * as well as all of the other good stuff in the binary.
230+ */
231+#include <ldso.h>
232+
233+struct elf_resolve *_dl_loaded_modules = NULL;
234+
235diff -Naur uClibc-0.9.30.orig/ldso/ldso/ldso.c uClibc-0.9.30/ldso/ldso/ldso.c
236--- uClibc-0.9.30.orig/ldso/ldso/ldso.c 2008-09-30 05:09:55.000000000 -0700
237+++ uClibc-0.9.30/ldso/ldso/ldso.c 2008-11-18 06:01:35.928405000 -0800
238@@ -67,6 +67,7 @@
239 unsigned long attribute_hidden _dl_skip_args = 0;
240 const char *_dl_progname = UCLIBC_LDSO; /* The name of the executable being run */
241 #include "dl-startup.c"
242+#include "dl-symbols.c"
243 #include "dl-array.c"
244 /* Forward function declarations */
245 static int _dl_suid_ok(void);
246diff -Naur uClibc-0.9.30.orig/libc/inet/getaddrinfo.c uClibc-0.9.30/libc/inet/getaddrinfo.c
247--- uClibc-0.9.30.orig/libc/inet/getaddrinfo.c 2008-10-28 09:25:10.000000000 -0700
248+++ uClibc-0.9.30/libc/inet/getaddrinfo.c 2008-12-08 08:29:41.229254000 -0800
249@@ -186,7 +186,7 @@
250 return seen;
251 }
252
253- for (runp = ifa; runp != NULL; runp = runp->ifa_next)
254+ for (runp = ifa; runp != NULL; runp = runp->ifa_next) {
255 #if defined __UCLIBC_HAS_IPV4__
256 if (runp->ifa_addr->sa_family == PF_INET)
257 seen |= SEEN_IPV4;
258@@ -195,7 +195,7 @@
259 if (runp->ifa_addr->sa_family == PF_INET6)
260 seen |= SEEN_IPV6;
261 #endif /* __UCLIBC_HAS_IPV6__ */
262-
263+ }
264 freeifaddrs(ifa);
265 }
266 #else
267diff -Naur uClibc-0.9.30.orig/libc/inet/ifaddrs.c uClibc-0.9.30/libc/inet/ifaddrs.c
268--- uClibc-0.9.30.orig/libc/inet/ifaddrs.c 2008-10-28 02:55:44.000000000 -0700
269+++ uClibc-0.9.30/libc/inet/ifaddrs.c 2008-11-15 07:55:31.019090000 -0800
270@@ -330,7 +330,7 @@
271 that a RTM_NEWADDR index is not known to this map. */
272 static int
273 internal_function
274-map_newlink (int index, struct ifaddrs_storage *ifas, int *map, int max)
275+map_newlink (int idx, struct ifaddrs_storage *ifas, int *map, int max)
276 {
277 int i;
278
279@@ -338,12 +338,12 @@
280 {
281 if (map[i] == -1)
282 {
283- map[i] = index;
284+ map[i] = idx;
285 if (i > 0)
286 ifas[i - 1].ifa.ifa_next = &ifas[i].ifa;
287 return i;
288 }
289- else if (map[i] == index)
290+ else if (map[i] == idx)
291 return i;
292 }
293 /* This should never be reached. If this will be reached, we have
294diff -Naur uClibc-0.9.30.orig/libc/misc/elf/dl-core.c uClibc-0.9.30/libc/misc/elf/dl-core.c
295--- uClibc-0.9.30.orig/libc/misc/elf/dl-core.c 1969-12-31 16:00:00.000000000 -0800
296+++ uClibc-0.9.30/libc/misc/elf/dl-core.c 2008-11-18 06:01:35.928405000 -0800
297@@ -0,0 +1,20 @@
298+/*
299+ * This contains all symbols and functions to support
300+ * dynamic linking into static libc.
301+
302+ * Copyright (c) 2008 STMicroelectronics Ltd
303+ * Author: Carmelo Amoroso <carmelo.amoroso@st.com>
304+ *
305+ * Based on draft work by Peter S. Mazinger <ps.m@gmx.net>
306+ *
307+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
308+ *
309+ */
310+
311+#ifdef SHARED
312+#error "This file is not suitable for linking into dynamic libc"
313+#else
314+/* Include ldso symbols and functions used into static libc */
315+#include "../../../ldso/ldso/dl-symbols.c"
316+#endif
317+
318diff -Naur uClibc-0.9.30.orig/libc/misc/elf/dl-iterate-phdr.c uClibc-0.9.30/libc/misc/elf/dl-iterate-phdr.c
319--- uClibc-0.9.30.orig/libc/misc/elf/dl-iterate-phdr.c 1969-12-31 16:00:00.000000000 -0800
320+++ uClibc-0.9.30/libc/misc/elf/dl-iterate-phdr.c 2008-11-18 06:01:35.928405000 -0800
321@@ -0,0 +1,76 @@
322+/* Get loaded objects program headers.
323+
324+ Based on GNU C library (file: libc/elf/dl-iteratephdr.c)
325+
326+ Copyright (C) 2001,2002,2003,2004,2006,2007 Free Software Foundation, Inc.
327+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
328+
329+ Copyright (C) 2008 STMicroelectronics Ltd.
330+ Author: Carmelo Amoroso <carmelo.amoroso@st.com>
331+
332+ Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
333+*/
334+
335+
336+#include <link.h>
337+#include <ldso.h>
338+
339+/* we want this in libc but nowhere else */
340+#ifdef __USE_GNU
341+
342+extern __typeof(dl_iterate_phdr) __dl_iterate_phdr;
343+
344+hidden_proto(__dl_iterate_phdr)
345+int
346+__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
347+{
348+ struct elf_resolve *l;
349+ struct dl_phdr_info info;
350+ int ret = 0;
351+
352+ for (l = _dl_loaded_modules; l != NULL; l = l->next) {
353+ info.dlpi_addr = l->loadaddr;
354+ info.dlpi_name = l->libname;
355+ info.dlpi_phdr = l->ppnt;
356+ info.dlpi_phnum = l->n_phent;
357+ ret = callback (&info, sizeof (struct dl_phdr_info), data);
358+ if (ret)
359+ break;
360+ }
361+ return ret;
362+}
363+hidden_def (__dl_iterate_phdr)
364+
365+# ifdef SHARED
366+
367+weak_alias(__dl_iterate_phdr, dl_iterate_phdr)
368+
369+# else
370+
371+/* dl-support.c defines these and initializes them early on. */
372+extern ElfW(Phdr) *_dl_phdr;
373+extern size_t _dl_phnum;
374+
375+int
376+dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
377+ size_t size, void *data), void *data)
378+{
379+ if (_dl_phnum != 0)
380+ {
381+ /* This entry describes this statically-linked program itself. */
382+ struct dl_phdr_info info;
383+ int ret;
384+ info.dlpi_addr = 0;
385+ info.dlpi_name = "";
386+ info.dlpi_phdr = _dl_phdr;
387+ info.dlpi_phnum = _dl_phnum;
388+ ret = (*callback) (&info, sizeof (struct dl_phdr_info), data);
389+ if (ret)
390+ return ret;
391+ }
392+ /* Then invoke callback on loaded modules, if any */
393+ return __dl_iterate_phdr (callback, data);
394+}
395+
396+# endif
397+#endif
398diff -Naur uClibc-0.9.30.orig/libc/misc/elf/dl-support.c uClibc-0.9.30/libc/misc/elf/dl-support.c
399--- uClibc-0.9.30.orig/libc/misc/elf/dl-support.c 1969-12-31 16:00:00.000000000 -0800
400+++ uClibc-0.9.30/libc/misc/elf/dl-support.c 2008-11-18 06:01:35.928405000 -0800
401@@ -0,0 +1,29 @@
402+/*
403+ * Support for dynamic linking code in static libc.
404+ * Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
405+ *
406+ * Partially based on GNU C Library (file: libc/elf/dl-support.c)
407+ *
408+ * Copyright (C) 2008 STMicroelectronics Ltd.
409+ * Author: Carmelo Amoroso <carmelo.amoroso@st.com>
410+ *
411+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
412+ *
413+ */
414+
415+#include <link.h>
416+#include <elf.h>
417+
418+ElfW(Phdr) *_dl_phdr;
419+size_t _dl_phnum;
420+
421+void
422+internal_function
423+_dl_aux_init (ElfW(auxv_t) *av)
424+{
425+ /* Get the program headers base address from the aux vect */
426+ _dl_phdr = (ElfW(Phdr) *) av[AT_PHDR].a_un.a_val;
427+
428+ /* Get the number of program headers from the aux vect */
429+ _dl_phnum = (size_t) av[AT_PHNUM].a_un.a_val;
430+}
431diff -Naur uClibc-0.9.30.orig/libc/misc/elf/Makefile uClibc-0.9.30/libc/misc/elf/Makefile
432--- uClibc-0.9.30.orig/libc/misc/elf/Makefile 1969-12-31 16:00:00.000000000 -0800
433+++ uClibc-0.9.30/libc/misc/elf/Makefile 2008-11-18 06:01:35.928405000 -0800
434@@ -0,0 +1,12 @@
435+# Copyright (C) 2008 STMicroelectronics Ltd.
436+# Author: Carmelo Amoroso <carmelo.amoroso@st.com>
437+
438+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
439+#
440+
441+top_srcdir=../../../
442+top_builddir=../../../
443+all: objs
444+include $(top_builddir)Rules.mak
445+include Makefile.in
446+include $(top_srcdir)Makerules
447diff -Naur uClibc-0.9.30.orig/libc/misc/elf/Makefile.in uClibc-0.9.30/libc/misc/elf/Makefile.in
448--- uClibc-0.9.30.orig/libc/misc/elf/Makefile.in 1969-12-31 16:00:00.000000000 -0800
449+++ uClibc-0.9.30/libc/misc/elf/Makefile.in 2008-11-18 06:01:35.928405000 -0800
450@@ -0,0 +1,20 @@
451+# Copyright (C) 2008 STMicroelectronics Ltd.
452+# Author: Carmelo Amoroso <carmelo.amoroso@st.com>
453+
454+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
455+#
456+
457+libc_a_CSRC = dl-support.c dl-core.c dl-iterate-phdr.c
458+CFLAGS-dl-iterate-phdr.c=-D_GNU_SOURCE -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include
459+CFLAGS-dl-core.c=-I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include
460+
461+MISC_ELF_OUT:=$(top_builddir)libc/misc/elf
462+MISC_ELF_OBJ:=$(patsubst %.c,$(MISC_ELF_OUT)/%.o,$(libc_a_CSRC))
463+
464+libc-static-y += $(MISC_ELF_OBJ)
465+libc-shared-y += $(MISC_ELF_OUT)/dl-iterate-phdr.oS
466+
467+objclean-y+= misc_elf_objclean
468+
469+misc_elf_objclean:
470+ $(RM) $(MISC_ELF_OUT)/*.{o,os,oS}
471diff -Naur uClibc-0.9.30.orig/libc/misc/internals/__uClibc_main.c uClibc-0.9.30/libc/misc/internals/__uClibc_main.c
472--- uClibc-0.9.30.orig/libc/misc/internals/__uClibc_main.c 2008-06-27 12:12:50.000000000 -0700
473+++ uClibc-0.9.30/libc/misc/internals/__uClibc_main.c 2008-11-18 06:01:35.928405000 -0800
474@@ -72,6 +72,11 @@
475 # endif
476 # endif
477
478+/*
479+ * Needed to initialize _dl_phdr when statically linked
480+ */
481+
482+void internal_function _dl_aux_init (ElfW(auxv_t) *av);
483 #endif /* !SHARED */
484
485 /*
486@@ -114,9 +119,8 @@
487 #endif
488
489 /*
490- * Declare the __environ global variable and create a strong alias environ.
491- * Note: Apparently we must initialize __environ to ensure that the strong
492- * environ symbol is also included.
493+ * Declare the __environ global variable and create a weak alias environ.
494+ * This must be initialized; we cannot have a weak alias into bss.
495 */
496 char **__environ = 0;
497 weak_alias(__environ, environ)
498@@ -310,6 +314,12 @@
499 }
500 aux_dat += 2;
501 }
502+#ifndef SHARED
503+ /* Get the program headers (_dl_phdr) from the aux vector
504+ It will be used into __libc_setup_tls. */
505+
506+ _dl_aux_init (auxvt);
507+#endif
508 #endif
509
510 /* We need to initialize uClibc. If we are dynamically linked this
511diff -Naur uClibc-0.9.30.orig/libc/misc/Makefile.in uClibc-0.9.30/libc/misc/Makefile.in
512--- uClibc-0.9.30.orig/libc/misc/Makefile.in 2007-01-10 14:03:34.000000000 -0800
513+++ uClibc-0.9.30/libc/misc/Makefile.in 2008-11-18 06:01:35.928405000 -0800
514@@ -12,6 +12,7 @@
515 include $(top_srcdir)libc/misc/ctype/Makefile.in
516 include $(top_srcdir)libc/misc/dirent/Makefile.in
517 include $(top_srcdir)libc/misc/error/Makefile.in
518+include $(top_srcdir)libc/misc/elf/Makefile.in
519 include $(top_srcdir)libc/misc/file/Makefile.in
520 include $(top_srcdir)libc/misc/fnmatch/Makefile.in
521 include $(top_srcdir)libc/misc/ftw/Makefile.in
522diff -Naur uClibc-0.9.30.orig/libc/misc/wchar/wchar.c uClibc-0.9.30/libc/misc/wchar/wchar.c
523--- uClibc-0.9.30.orig/libc/misc/wchar/wchar.c 2008-09-29 01:51:31.000000000 -0700
524+++ uClibc-0.9.30/libc/misc/wchar/wchar.c 2008-12-02 09:15:35.191305000 -0800
525@@ -1143,6 +1143,13 @@
526 {
527 int count;
528 wchar_t wc;
529+ size_t i;
530+
531+ for (i = 0 ; (i < n) && pwcs[i] ; i++) {
532+ if (pwcs[i] != (pwcs[i] & 0x7f)) {
533+ return -1;
534+ }
535+ }
536
537 for (count = 0 ; n && (wc = *pwcs++) ; n--) {
538 if (wc <= 0xff) {
539@@ -1246,7 +1253,7 @@
540 "\x08\xec""UCS-4\x00" /* always BE */
541 "\x0a\xec""UCS-4BE\x00"
542 "\x0a\xed""UCS-4LE\x00"
543- "\x09\fe4""UTF-32\x00" /* platform endian with BOM */
544+ "\x09\xe4""UTF-32\x00" /* platform endian with BOM */
545 "\x0b\xe4""UTF-32BE\x00"
546 "\x0b\xe5""UTF-32LE\x00"
547 "\x08\xe2""UCS-2\x00" /* always BE */
548diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/alpha/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/alpha/bits/fcntl.h
549--- uClibc-0.9.30.orig/libc/sysdeps/linux/alpha/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
550+++ uClibc-0.9.30/libc/sysdeps/linux/alpha/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
551@@ -159,7 +159,6 @@
552 };
553 #endif
554
555-
556 /* Define some more compatibility macros to be backward compatible with
557 BSD systems which did not managed to hide these kernel macros. */
558 #ifdef __USE_BSD
559@@ -181,7 +180,7 @@
560 #endif
561
562
563-#ifdef __USE_GNU
564+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
565 /* Flags for SYNC_FILE_RANGE. */
566 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
567 in the range before performing the
568@@ -204,7 +203,7 @@
569
570 __BEGIN_DECLS
571
572-#ifdef __USE_GNU
573+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
574
575 /* Provide kernel hint to read ahead. */
576 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
577diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/arm/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/arm/bits/fcntl.h
578--- uClibc-0.9.30.orig/libc/sysdeps/linux/arm/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
579+++ uClibc-0.9.30/libc/sysdeps/linux/arm/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
580@@ -189,7 +189,7 @@
581 #endif
582
583
584-#ifdef __USE_GNU
585+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
586 /* Flags for SYNC_FILE_RANGE. */
587 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
588 in the range before performing the
589@@ -212,7 +212,7 @@
590
591 __BEGIN_DECLS
592
593-#ifdef __USE_GNU
594+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
595
596 /* Provide kernel hint to read ahead. */
597 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
598diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/arm/crt1.S uClibc-0.9.30/libc/sysdeps/linux/arm/crt1.S
599--- uClibc-0.9.30.orig/libc/sysdeps/linux/arm/crt1.S 2008-03-26 06:40:36.000000000 -0700
600+++ uClibc-0.9.30/libc/sysdeps/linux/arm/crt1.S 2008-11-25 04:27:50.759727000 -0800
601@@ -238,7 +238,11 @@
602
603 #ifdef __PIC__
604 .L_GOT:
605+#ifdef __thumb__
606+ .word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+4)
607+#else /* __thumb2__ */
608 .word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8)
609+#endif
610 .word _fini(GOT)
611 .word _init(GOT)
612 .word main(GOT)
613diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/avr32/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/avr32/bits/fcntl.h
614--- uClibc-0.9.30.orig/libc/sysdeps/linux/avr32/bits/fcntl.h 2008-11-03 07:48:07.000000000 -0800
615+++ uClibc-0.9.30/libc/sysdeps/linux/avr32/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
616@@ -167,8 +167,8 @@
617 # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
618 #endif
619
620-#ifdef __USE_GNU
621
622+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
623 /* Flags for SYNC_FILE_RANGE. */
624 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
625 in the range before performing
626diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/bfin/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/bfin/bits/fcntl.h
627--- uClibc-0.9.30.orig/libc/sysdeps/linux/bfin/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
628+++ uClibc-0.9.30/libc/sysdeps/linux/bfin/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
629@@ -185,7 +185,7 @@
630 #endif
631
632
633-#ifdef __USE_GNU
634+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
635 /* Flags for SYNC_FILE_RANGE. */
636 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
637 in the range before performing the
638@@ -208,7 +208,7 @@
639
640 __BEGIN_DECLS
641
642-#ifdef __USE_GNU
643+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
644
645 /* Provide kernel hint to read ahead. */
646 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
647diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/common/bits/mathcalls.h uClibc-0.9.30/libc/sysdeps/linux/common/bits/mathcalls.h
648--- uClibc-0.9.30.orig/libc/sysdeps/linux/common/bits/mathcalls.h 2008-09-26 07:50:16.000000000 -0700
649+++ uClibc-0.9.30/libc/sysdeps/linux/common/bits/mathcalls.h 2008-12-22 03:55:13.991752000 -0800
650@@ -52,59 +52,45 @@
651
652 _Mdouble_BEGIN_NAMESPACE
653 /* Arc cosine of X. */
654-__MATHCALL (acos,, (_Mdouble_ __x));
655-libm_hidden_proto(acos)
656+__MATHCALLI (acos,, (_Mdouble_ __x));
657 /* Arc sine of X. */
658-__MATHCALL (asin,, (_Mdouble_ __x));
659-libm_hidden_proto(asin)
660+__MATHCALLI (asin,, (_Mdouble_ __x));
661 /* Arc tangent of X. */
662-__MATHCALL (atan,, (_Mdouble_ __x));
663-libm_hidden_proto(atan)
664+__MATHCALLI (atan,, (_Mdouble_ __x));
665 /* Arc tangent of Y/X. */
666-__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
667-libm_hidden_proto(atan2)
668+__MATHCALLI (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
669
670 /* Cosine of X. */
671-__MATHCALL (cos,, (_Mdouble_ __x));
672-libm_hidden_proto(cos)
673+__MATHCALLI (cos,, (_Mdouble_ __x));
674 /* Sine of X. */
675-__MATHCALL (sin,, (_Mdouble_ __x));
676-libm_hidden_proto(sin)
677+__MATHCALLI (sin,, (_Mdouble_ __x));
678 /* Tangent of X. */
679-__MATHCALL (tan,, (_Mdouble_ __x));
680-libm_hidden_proto(tan)
681+__MATHCALLI (tan,, (_Mdouble_ __x));
682
683 /* Hyperbolic functions. */
684
685 /* Hyperbolic cosine of X. */
686-__MATHCALL (cosh,, (_Mdouble_ __x));
687-libm_hidden_proto(cosh)
688+__MATHCALLI (cosh,, (_Mdouble_ __x));
689 /* Hyperbolic sine of X. */
690-__MATHCALL (sinh,, (_Mdouble_ __x));
691-libm_hidden_proto(sinh)
692+__MATHCALLI (sinh,, (_Mdouble_ __x));
693 /* Hyperbolic tangent of X. */
694-__MATHCALL (tanh,, (_Mdouble_ __x));
695-libm_hidden_proto(tanh)
696+__MATHCALLI (tanh,, (_Mdouble_ __x));
697 _Mdouble_END_NAMESPACE
698
699 #if 0 /*def __USE_GNU*/
700 /* Cosine and sine of X. */
701 __MATHDECL (void,sincos,,
702 (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
703-libm_hidden_proto(sincos)
704 #endif
705
706 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
707 __BEGIN_NAMESPACE_C99
708 /* Hyperbolic arc cosine of X. */
709-__MATHCALL (acosh,, (_Mdouble_ __x));
710-libm_hidden_proto(acosh)
711+__MATHCALLI (acosh,, (_Mdouble_ __x));
712 /* Hyperbolic arc sine of X. */
713-__MATHCALL (asinh,, (_Mdouble_ __x));
714-libm_hidden_proto(asinh)
715+__MATHCALLI (asinh,, (_Mdouble_ __x));
716 /* Hyperbolic arc tangent of X. */
717-__MATHCALL (atanh,, (_Mdouble_ __x));
718-libm_hidden_proto(atanh)
719+__MATHCALLI (atanh,, (_Mdouble_ __x));
720 __END_NAMESPACE_C99
721 #endif
722
723@@ -112,64 +98,51 @@
724
725 _Mdouble_BEGIN_NAMESPACE
726 /* Exponential function of X. */
727-__MATHCALL (exp,, (_Mdouble_ __x));
728-libm_hidden_proto(exp)
729+__MATHCALLI (exp,, (_Mdouble_ __x));
730
731 /* Break VALUE into a normalized fraction and an integral power of 2. */
732-__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));
733-libm_hidden_proto(frexp)
734+__MATHCALLI (frexp,, (_Mdouble_ __x, int *__exponent));
735
736 /* X times (two to the EXP power). */
737-__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
738-libm_hidden_proto(ldexp)
739+__MATHCALLI (ldexp,, (_Mdouble_ __x, int __exponent));
740
741 /* Natural logarithm of X. */
742-__MATHCALL (log,, (_Mdouble_ __x));
743-libm_hidden_proto(log)
744+__MATHCALLI (log,, (_Mdouble_ __x));
745
746 /* Base-ten logarithm of X. */
747-__MATHCALL (log10,, (_Mdouble_ __x));
748-libm_hidden_proto(log10)
749+__MATHCALLI (log10,, (_Mdouble_ __x));
750
751 /* Break VALUE into integral and fractional parts. */
752-__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
753-libm_hidden_proto(modf)
754+__MATHCALLI (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
755 _Mdouble_END_NAMESPACE
756
757 #if 0 /*def __USE_GNU*/
758 /* A function missing in all standards: compute exponent to base ten. */
759 __MATHCALL (exp10,, (_Mdouble_ __x));
760-libm_hidden_proto(exp10)
761 /* Another name occasionally used. */
762 __MATHCALL (pow10,, (_Mdouble_ __x));
763-libm_hidden_proto(pow10)
764 #endif
765
766 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
767 __BEGIN_NAMESPACE_C99
768 /* Return exp(X) - 1. */
769-__MATHCALL (expm1,, (_Mdouble_ __x));
770-libm_hidden_proto(expm1)
771+__MATHCALLI (expm1,, (_Mdouble_ __x));
772
773 /* Return log(1 + X). */
774-__MATHCALL (log1p,, (_Mdouble_ __x));
775-libm_hidden_proto(log1p)
776+__MATHCALLI (log1p,, (_Mdouble_ __x));
777
778 /* Return the base 2 signed integral exponent of X. */
779-__MATHCALL (logb,, (_Mdouble_ __x));
780-libm_hidden_proto(logb)
781+__MATHCALLI (logb,, (_Mdouble_ __x));
782 __END_NAMESPACE_C99
783 #endif
784
785 #ifdef __USE_ISOC99
786 __BEGIN_NAMESPACE_C99
787 /* Compute base-2 exponential of X. */
788-__MATHCALL (exp2,, (_Mdouble_ __x));
789-libm_hidden_proto(exp2)
790+__MATHCALLI (exp2,, (_Mdouble_ __x));
791
792 /* Compute base-2 logarithm of X. */
793 __MATHCALL (log2,, (_Mdouble_ __x));
794-libm_hidden_proto(log2)
795 __END_NAMESPACE_C99
796 #endif
797
798@@ -178,27 +151,23 @@
799
800 _Mdouble_BEGIN_NAMESPACE
801 /* Return X to the Y power. */
802-__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
803-libm_hidden_proto(pow)
804+__MATHCALLI (pow,, (_Mdouble_ __x, _Mdouble_ __y));
805
806 /* Return the square root of X. */
807-__MATHCALL (sqrt,, (_Mdouble_ __x));
808-libm_hidden_proto(sqrt)
809+__MATHCALLI (sqrt,, (_Mdouble_ __x));
810 _Mdouble_END_NAMESPACE
811
812 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
813 __BEGIN_NAMESPACE_C99
814 /* Return `sqrt(X*X + Y*Y)'. */
815-__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
816-libm_hidden_proto(hypot)
817+__MATHCALLI (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
818 __END_NAMESPACE_C99
819 #endif
820
821 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
822 __BEGIN_NAMESPACE_C99
823 /* Return the cube root of X. */
824-__MATHCALL (cbrt,, (_Mdouble_ __x));
825-libm_hidden_proto(cbrt)
826+__MATHCALLI (cbrt,, (_Mdouble_ __x));
827 __END_NAMESPACE_C99
828 #endif
829
830@@ -208,56 +177,46 @@
831 _Mdouble_BEGIN_NAMESPACE
832 /* Smallest integral value not less than X. */
833 __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
834-libm_hidden_proto(ceil)
835
836 /* Absolute value of X. */
837 __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
838-libm_hidden_proto(fabs)
839
840 /* Largest integer not greater than X. */
841 __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
842-libm_hidden_proto(floor)
843
844 /* Floating-point modulo remainder of X/Y. */
845-__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
846-libm_hidden_proto(fmod)
847+__MATHCALLI (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
848
849
850 /* Return 0 if VALUE is finite or NaN, +1 if it
851 is +Infinity, -1 if it is -Infinity. */
852-__MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
853-libm_hidden_proto(__isinf)
854+__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__));
855
856 /* Return nonzero if VALUE is finite and not NaN. */
857-__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
858-libm_hidden_proto(__finite)
859+__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__));
860 _Mdouble_END_NAMESPACE
861
862 #ifdef __USE_MISC
863+#if 0
864 /* Return 0 if VALUE is finite or NaN, +1 if it
865 is +Infinity, -1 if it is -Infinity. */
866-__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
867-libm_hidden_proto(isinf)
868+__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__));
869
870 /* Return nonzero if VALUE is finite and not NaN. */
871-__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
872-libm_hidden_proto(finite)
873-
874+__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__));
875+#endif
876 /* Return the remainder of X/Y. */
877 __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
878-libm_hidden_proto(drem)
879
880
881 /* Return the fractional part of X after dividing out `ilogb (X)'. */
882 __MATHCALL (significand,, (_Mdouble_ __x));
883-libm_hidden_proto(significand)
884 #endif /* Use misc. */
885
886 #if defined __USE_MISC || defined __USE_ISOC99
887 __BEGIN_NAMESPACE_C99
888 /* Return X with its signed changed to Y's. */
889 __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
890-libm_hidden_proto(copysign)
891 __END_NAMESPACE_C99
892 #endif
893
894@@ -265,60 +224,46 @@
895 __BEGIN_NAMESPACE_C99
896 /* Return representation of NaN for double type. */
897 __MATHCALLX (nan,, (__const char *__tagb), (__const__));
898-libm_hidden_proto(nan)
899 __END_NAMESPACE_C99
900 #endif
901
902
903 /* Return nonzero if VALUE is not a number. */
904-__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
905-libm_hidden_proto(__isnan)
906+__MATHDECL_PRIV (int,__isnan,, (_Mdouble_ __value), (__const__));
907
908 #if defined __USE_MISC || defined __USE_XOPEN
909 /* Return nonzero if VALUE is not a number. */
910-__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
911-libm_hidden_proto(isnan)
912+__MATHDECL_PRIV (int,isnan,, (_Mdouble_ __value), (__const__));
913
914 /* Bessel functions. */
915 __MATHCALL (j0,, (_Mdouble_));
916-libm_hidden_proto(j0)
917 __MATHCALL (j1,, (_Mdouble_));
918-libm_hidden_proto(j1)
919 __MATHCALL (jn,, (int, _Mdouble_));
920-libm_hidden_proto(jn)
921 __MATHCALL (y0,, (_Mdouble_));
922-libm_hidden_proto(y0)
923 __MATHCALL (y1,, (_Mdouble_));
924-libm_hidden_proto(y1)
925 __MATHCALL (yn,, (int, _Mdouble_));
926-libm_hidden_proto(yn)
927 #endif
928
929
930 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
931 __BEGIN_NAMESPACE_C99
932 /* Error and gamma functions. */
933-__MATHCALL (erf,, (_Mdouble_));
934-libm_hidden_proto(erf)
935-__MATHCALL (erfc,, (_Mdouble_));
936-libm_hidden_proto(erfc)
937-__MATHCALL (lgamma,, (_Mdouble_));
938-libm_hidden_proto(lgamma)
939+__MATHCALLI (erf,, (_Mdouble_));
940+__MATHCALLI (erfc,, (_Mdouble_));
941+__MATHCALLI (lgamma,, (_Mdouble_));
942 __END_NAMESPACE_C99
943 #endif
944
945 #ifdef __USE_ISOC99
946 __BEGIN_NAMESPACE_C99
947 /* True gamma function. */
948-__MATHCALL (tgamma,, (_Mdouble_));
949-libm_hidden_proto(tgamma)
950+__MATHCALLI (tgamma,, (_Mdouble_));
951 __END_NAMESPACE_C99
952 #endif
953
954 #if defined __USE_MISC || defined __USE_XOPEN
955 /* Obsolete alias for `lgamma'. */
956 __MATHCALL (gamma,, (_Mdouble_));
957-libm_hidden_proto(gamma)
958 #endif
959
960 #ifdef __USE_MISC
961@@ -326,7 +271,6 @@
962 `signgam'. The reentrant version instead takes a pointer and stores
963 the value through it. */
964 __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
965-libm_hidden_proto(lgamma_r)
966 #endif
967
968
969@@ -334,103 +278,80 @@
970 __BEGIN_NAMESPACE_C99
971 /* Return the integer nearest X in the direction of the
972 prevailing rounding mode. */
973-__MATHCALL (rint,, (_Mdouble_ __x));
974-libm_hidden_proto(rint)
975+__MATHCALLI (rint,, (_Mdouble_ __x));
976
977 /* Return X + epsilon if X < Y, X - epsilon if X > Y. */
978 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
979-libm_hidden_proto(nextafter)
980 # if defined __USE_ISOC99 && !defined __LDBL_COMPAT
981 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
982-libm_hidden_proto(nexttoward)
983 # endif
984
985 /* Return the remainder of integer divison X / Y with infinite precision. */
986-__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
987-libm_hidden_proto(remainder)
988+__MATHCALLI (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
989
990 # if defined __USE_MISC || defined __USE_ISOC99
991 /* Return X times (2 to the Nth power). */
992-__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
993-libm_hidden_proto(scalbn)
994+__MATHCALLI (scalbn,, (_Mdouble_ __x, int __n));
995 # endif
996
997 /* Return the binary exponent of X, which must be nonzero. */
998-__MATHDECL (int,ilogb,, (_Mdouble_ __x));
999-libm_hidden_proto(ilogb)
1000+__MATHDECLI (int,ilogb,, (_Mdouble_ __x));
1001 #endif
1002
1003 #ifdef __USE_ISOC99
1004 /* Return X times (2 to the Nth power). */
1005-__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
1006-libm_hidden_proto(scalbln)
1007+__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n));
1008
1009 /* Round X to integral value in floating-point format using current
1010 rounding direction, but do not raise inexact exception. */
1011-__MATHCALL (nearbyint,, (_Mdouble_ __x));
1012-libm_hidden_proto(nearbyint)
1013+__MATHCALLI (nearbyint,, (_Mdouble_ __x));
1014
1015 /* Round X to nearest integral value, rounding halfway cases away from
1016 zero. */
1017 __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
1018-libm_hidden_proto(round)
1019
1020 /* Round X to the integral value in floating-point format nearest but
1021 not larger in magnitude. */
1022 __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
1023-libm_hidden_proto(trunc)
1024
1025 /* Compute remainder of X and Y and put in *QUO a value with sign of x/y
1026 and magnitude congruent `mod 2^n' to the magnitude of the integral
1027 quotient x/y, with n >= 3. */
1028-__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
1029-libm_hidden_proto(remquo)
1030+__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
1031
1032
1033 /* Conversion functions. */
1034
1035 /* Round X to nearest integral value according to current rounding
1036 direction. */
1037-__MATHDECL (long int,lrint,, (_Mdouble_ __x));
1038-libm_hidden_proto(lrint)
1039-__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
1040-libm_hidden_proto(llrint)
1041+__MATHDECLI (long int,lrint,, (_Mdouble_ __x));
1042+__MATHDECLI (long long int,llrint,, (_Mdouble_ __x));
1043
1044 /* Round X to nearest integral value, rounding halfway cases away from
1045 zero. */
1046-__MATHDECL (long int,lround,, (_Mdouble_ __x));
1047-libm_hidden_proto(lround)
1048-__MATHDECL (long long int,llround,, (_Mdouble_ __x));
1049-libm_hidden_proto(llround)
1050+__MATHDECLI (long int,lround,, (_Mdouble_ __x));
1051+__MATHDECLI (long long int,llround,, (_Mdouble_ __x));
1052
1053
1054 /* Return positive difference between X and Y. */
1055-__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
1056-libm_hidden_proto(fdim)
1057+__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
1058
1059 /* Return maximum numeric value from X and Y. */
1060-__MATHCALL (fmax,, (_Mdouble_ __x, _Mdouble_ __y));
1061-libm_hidden_proto(fmax)
1062+__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y));
1063
1064 /* Return minimum numeric value from X and Y. */
1065-__MATHCALL (fmin,, (_Mdouble_ __x, _Mdouble_ __y));
1066-libm_hidden_proto(fmin)
1067+__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y));
1068
1069
1070 /* Classify given number. */
1071-__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
1072- __attribute__ ((__const__));
1073-libm_hidden_proto(__fpclassify)
1074+__MATHDECL_PRIV (int, fpclassify,, (_Mdouble_ __value), (__const__));
1075
1076 /* Test for negative number. */
1077-__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
1078- __attribute__ ((__const__));
1079-libm_hidden_proto(__signbit)
1080+__MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__));
1081
1082
1083 /* Multiply-add function computed as a ternary operation. */
1084-__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
1085-libm_hidden_proto(fma)
1086+__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
1087 #endif /* Use ISO C99. */
1088
1089 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
1090@@ -440,5 +361,4 @@
1091 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
1092 /* Return X times (2 to the Nth power). */
1093 __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
1094-libm_hidden_proto(scalb)
1095 #endif
1096diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/cris/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/cris/bits/fcntl.h
1097--- uClibc-0.9.30.orig/libc/sysdeps/linux/cris/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1098+++ uClibc-0.9.30/libc/sysdeps/linux/cris/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1099@@ -186,7 +186,7 @@
1100 #endif
1101
1102
1103-#ifdef __USE_GNU
1104+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1105 /* Flags for SYNC_FILE_RANGE. */
1106 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1107 in the range before performing the
1108@@ -209,7 +209,7 @@
1109
1110 __BEGIN_DECLS
1111
1112-#ifdef __USE_GNU
1113+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1114
1115 /* Provide kernel hint to read ahead. */
1116 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1117diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/e1/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/e1/bits/fcntl.h
1118--- uClibc-0.9.30.orig/libc/sysdeps/linux/e1/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1119+++ uClibc-0.9.30/libc/sysdeps/linux/e1/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1120@@ -182,7 +182,7 @@
1121 #endif
1122
1123
1124-#ifdef __USE_GNU
1125+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1126 /* Flags for SYNC_FILE_RANGE. */
1127 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1128 in the range before performing the
1129@@ -205,7 +205,7 @@
1130
1131 __BEGIN_DECLS
1132
1133-#ifdef __USE_GNU
1134+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1135
1136 /* Provide kernel hint to read ahead. */
1137 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1138@@ -231,4 +231,4 @@
1139
1140 #endif
1141 __END_DECLS
1142-
1143+#endif /* LINUX_SPECIFIC */
1144diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/frv/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/frv/bits/fcntl.h
1145--- uClibc-0.9.30.orig/libc/sysdeps/linux/frv/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1146+++ uClibc-0.9.30/libc/sysdeps/linux/frv/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1147@@ -164,7 +164,7 @@
1148 #endif
1149
1150
1151-#ifdef __USE_GNU
1152+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1153 /* Flags for SYNC_FILE_RANGE. */
1154 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1155 in the range before performing the
1156@@ -187,7 +187,7 @@
1157
1158 __BEGIN_DECLS
1159
1160-#ifdef __USE_GNU
1161+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1162
1163 /* Provide kernel hint to read ahead. */
1164 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1165diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/h8300/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/h8300/bits/fcntl.h
1166--- uClibc-0.9.30.orig/libc/sysdeps/linux/h8300/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1167+++ uClibc-0.9.30/libc/sysdeps/linux/h8300/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1168@@ -182,7 +182,7 @@
1169 #endif
1170
1171
1172-#ifdef __USE_GNU
1173+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1174 /* Flags for SYNC_FILE_RANGE. */
1175 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1176 in the range before performing the
1177@@ -205,7 +205,7 @@
1178
1179 __BEGIN_DECLS
1180
1181-#ifdef __USE_GNU
1182+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1183
1184 /* Provide kernel hint to read ahead. */
1185 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1186diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/hppa/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/hppa/bits/fcntl.h
1187--- uClibc-0.9.30.orig/libc/sysdeps/linux/hppa/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1188+++ uClibc-0.9.30/libc/sysdeps/linux/hppa/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1189@@ -176,7 +176,7 @@
1190 #endif
1191
1192
1193-#ifdef __USE_GNU
1194+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1195 /* Flags for SYNC_FILE_RANGE. */
1196 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1197 in the range before performing the
1198@@ -199,7 +199,7 @@
1199
1200 __BEGIN_DECLS
1201
1202-#ifdef __USE_GNU
1203+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1204
1205 /* Provide kernel hint to read ahead. */
1206 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1207diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/i386/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/i386/bits/fcntl.h
1208--- uClibc-0.9.30.orig/libc/sysdeps/linux/i386/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1209+++ uClibc-0.9.30/libc/sysdeps/linux/i386/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1210@@ -189,7 +189,7 @@
1211 #endif
1212
1213
1214-#ifdef __USE_GNU
1215+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1216 /* Flags for SYNC_FILE_RANGE. */
1217 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1218 in the range before performing the
1219@@ -212,7 +212,7 @@
1220
1221 __BEGIN_DECLS
1222
1223-#ifdef __USE_GNU
1224+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1225
1226 /* Provide kernel hint to read ahead. */
1227 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1228diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/i386/bits/kernel_types.h uClibc-0.9.30/libc/sysdeps/linux/i386/bits/kernel_types.h
1229--- uClibc-0.9.30.orig/libc/sysdeps/linux/i386/bits/kernel_types.h 2008-07-23 04:23:36.000000000 -0700
1230+++ uClibc-0.9.30/libc/sysdeps/linux/i386/bits/kernel_types.h 2009-01-12 07:04:25.958006000 -0800
1231@@ -7,9 +7,14 @@
1232
1233 /* a hack for compiling a 32 bit user space with 64 bit
1234 * kernel on x86_64 */
1235-#if !defined(__ARCH_I386_POSIX_TYPES_H) && !defined(_ASM_X86_64_POSIX_TYPES_H)
1236+#if !defined(__ARCH_I386_POSIX_TYPES_H) && \
1237+ !defined(_ASM_X86_64_POSIX_TYPES_H) && \
1238+ !defined(_ASM_X86_POSIX_TYPES_32_H) && \
1239+ !defined(_ASM_X86_POSIX_TYPES_64_H)
1240 #define _ASM_X86_64_POSIX_TYPES_H
1241 #define __ARCH_I386_POSIX_TYPES_H
1242+#define _ASM_X86_POSIX_TYPES_32_H
1243+#define _ASM_X86_POSIX_TYPES_64_H
1244
1245 typedef unsigned short __kernel_dev_t;
1246 typedef unsigned long __kernel_ino_t;
1247diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/i960/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/i960/bits/fcntl.h
1248--- uClibc-0.9.30.orig/libc/sysdeps/linux/i960/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1249+++ uClibc-0.9.30/libc/sysdeps/linux/i960/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1250@@ -182,7 +182,7 @@
1251 #endif
1252
1253
1254-#ifdef __USE_GNU
1255+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1256 /* Flags for SYNC_FILE_RANGE. */
1257 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1258 in the range before performing the
1259@@ -205,7 +205,7 @@
1260
1261 __BEGIN_DECLS
1262
1263-#ifdef __USE_GNU
1264+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1265
1266 /* Provide kernel hint to read ahead. */
1267 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1268diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/ia64/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/ia64/bits/fcntl.h
1269--- uClibc-0.9.30.orig/libc/sysdeps/linux/ia64/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1270+++ uClibc-0.9.30/libc/sysdeps/linux/ia64/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1271@@ -161,7 +161,6 @@
1272 };
1273 #endif
1274
1275-
1276 /* Define some more compatibility macros to be backward compatible with
1277 BSD systems which did not managed to hide these kernel macros. */
1278 #ifdef __USE_BSD
1279@@ -183,7 +182,7 @@
1280 #endif
1281
1282
1283-#ifdef __USE_GNU
1284+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1285 /* Flags for SYNC_FILE_RANGE. */
1286 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1287 in the range before performing the
1288@@ -206,7 +205,7 @@
1289
1290 __BEGIN_DECLS
1291
1292-#ifdef __USE_GNU
1293+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1294
1295 /* Provide kernel hint to read ahead. */
1296 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1297diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/m68k/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/m68k/bits/fcntl.h
1298--- uClibc-0.9.30.orig/libc/sysdeps/linux/m68k/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1299+++ uClibc-0.9.30/libc/sysdeps/linux/m68k/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1300@@ -185,7 +185,7 @@
1301 #endif
1302
1303
1304-#ifdef __USE_GNU
1305+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1306 /* Flags for SYNC_FILE_RANGE. */
1307 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1308 in the range before performing the
1309@@ -208,7 +208,7 @@
1310
1311 __BEGIN_DECLS
1312
1313-#ifdef __USE_GNU
1314+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1315
1316 /* Provide kernel hint to read ahead. */
1317 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1318diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/microblaze/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/microblaze/bits/fcntl.h
1319--- uClibc-0.9.30.orig/libc/sysdeps/linux/microblaze/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1320+++ uClibc-0.9.30/libc/sysdeps/linux/microblaze/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1321@@ -182,7 +182,7 @@
1322 #endif
1323
1324
1325-#ifdef __USE_GNU
1326+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1327 /* Flags for SYNC_FILE_RANGE. */
1328 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1329 in the range before performing the
1330@@ -205,7 +205,7 @@
1331
1332 __BEGIN_DECLS
1333
1334-#ifdef __USE_GNU
1335+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1336
1337 /* Provide kernel hint to read ahead. */
1338 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1339diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/mips/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/mips/bits/fcntl.h
1340--- uClibc-0.9.30.orig/libc/sysdeps/linux/mips/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1341+++ uClibc-0.9.30/libc/sysdeps/linux/mips/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1342@@ -209,7 +209,7 @@
1343 #endif
1344
1345
1346-#ifdef __USE_GNU
1347+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1348 /* Flags for SYNC_FILE_RANGE. */
1349 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1350 in the range before performing the
1351@@ -232,7 +232,7 @@
1352
1353 __BEGIN_DECLS
1354
1355-#ifdef __USE_GNU
1356+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1357
1358 /* Provide kernel hint to read ahead. */
1359 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1360diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/mips/bits/socket.h uClibc-0.9.30/libc/sysdeps/linux/mips/bits/socket.h
1361--- uClibc-0.9.30.orig/libc/sysdeps/linux/mips/bits/socket.h 2008-10-06 01:54:40.000000000 -0700
1362+++ uClibc-0.9.30/libc/sysdeps/linux/mips/bits/socket.h 2008-12-04 12:06:41.248672000 -0800
1363@@ -268,8 +268,8 @@
1364 + CMSG_ALIGN (sizeof (struct cmsghdr)))
1365 #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
1366
1367-extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr,
1368- struct cmsghdr *__cmsg)) __THROW;
1369+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
1370+ struct cmsghdr *__cmsg) __THROW;
1371 #ifdef __USE_EXTERN_INLINES
1372 # ifndef _EXTERN_INLINE
1373 # define _EXTERN_INLINE extern __inline
1374diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/nios/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/nios/bits/fcntl.h
1375--- uClibc-0.9.30.orig/libc/sysdeps/linux/nios/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1376+++ uClibc-0.9.30/libc/sysdeps/linux/nios/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1377@@ -185,7 +185,7 @@
1378 #endif
1379
1380
1381-#ifdef __USE_GNU
1382+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1383 /* Flags for SYNC_FILE_RANGE. */
1384 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1385 in the range before performing the
1386@@ -208,7 +208,7 @@
1387
1388 __BEGIN_DECLS
1389
1390-#ifdef __USE_GNU
1391+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1392
1393 /* Provide kernel hint to read ahead. */
1394 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1395diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/nios2/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/nios2/bits/fcntl.h
1396--- uClibc-0.9.30.orig/libc/sysdeps/linux/nios2/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1397+++ uClibc-0.9.30/libc/sysdeps/linux/nios2/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1398@@ -185,7 +185,7 @@
1399 #endif
1400
1401
1402-#ifdef __USE_GNU
1403+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1404 /* Flags for SYNC_FILE_RANGE. */
1405 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1406 in the range before performing the
1407@@ -208,7 +208,7 @@
1408
1409 __BEGIN_DECLS
1410
1411-#ifdef __USE_GNU
1412+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1413
1414 /* Provide kernel hint to read ahead. */
1415 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1416diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/powerpc/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/powerpc/bits/fcntl.h
1417--- uClibc-0.9.30.orig/libc/sysdeps/linux/powerpc/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1418+++ uClibc-0.9.30/libc/sysdeps/linux/powerpc/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1419@@ -189,7 +189,7 @@
1420 #endif
1421
1422
1423-#ifdef __USE_GNU
1424+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1425 /* Flags for SYNC_FILE_RANGE. */
1426 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1427 in the range before performing the
1428@@ -212,7 +212,7 @@
1429
1430 __BEGIN_DECLS
1431
1432-#ifdef __USE_GNU
1433+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1434
1435 /* Provide kernel hint to read ahead. */
1436 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1437diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/sh/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/sh/bits/fcntl.h
1438--- uClibc-0.9.30.orig/libc/sysdeps/linux/sh/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1439+++ uClibc-0.9.30/libc/sysdeps/linux/sh/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1440@@ -189,7 +189,7 @@
1441 #endif
1442
1443
1444-#ifdef __USE_GNU
1445+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1446 /* Flags for SYNC_FILE_RANGE. */
1447 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1448 in the range before performing the
1449@@ -212,7 +212,7 @@
1450
1451 __BEGIN_DECLS
1452
1453-#ifdef __USE_GNU
1454+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1455
1456 /* Provide kernel hint to read ahead. */
1457 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1458diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/sh64/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/sh64/bits/fcntl.h
1459--- uClibc-0.9.30.orig/libc/sysdeps/linux/sh64/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1460+++ uClibc-0.9.30/libc/sysdeps/linux/sh64/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1461@@ -164,7 +164,7 @@
1462 #endif
1463
1464
1465-#ifdef __USE_GNU
1466+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1467 /* Flags for SYNC_FILE_RANGE. */
1468 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1469 in the range before performing the
1470@@ -187,7 +187,7 @@
1471
1472 __BEGIN_DECLS
1473
1474-#ifdef __USE_GNU
1475+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1476
1477 /* Provide kernel hint to read ahead. */
1478 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1479diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/sparc/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/sparc/bits/fcntl.h
1480--- uClibc-0.9.30.orig/libc/sysdeps/linux/sparc/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1481+++ uClibc-0.9.30/libc/sysdeps/linux/sparc/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1482@@ -208,7 +208,7 @@
1483 #endif
1484
1485
1486-#ifdef __USE_GNU
1487+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1488 /* Flags for SYNC_FILE_RANGE. */
1489 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1490 in the range before performing the
1491@@ -231,7 +231,7 @@
1492
1493 __BEGIN_DECLS
1494
1495-#ifdef __USE_GNU
1496+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1497
1498 /* Provide kernel hint to read ahead. */
1499 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1500diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/v850/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/v850/bits/fcntl.h
1501--- uClibc-0.9.30.orig/libc/sysdeps/linux/v850/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1502+++ uClibc-0.9.30/libc/sysdeps/linux/v850/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1503@@ -182,7 +182,7 @@
1504 #endif
1505
1506
1507-#ifdef __USE_GNU
1508+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1509 /* Flags for SYNC_FILE_RANGE. */
1510 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1511 in the range before performing the
1512@@ -205,7 +205,7 @@
1513
1514 __BEGIN_DECLS
1515
1516-#ifdef __USE_GNU
1517+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1518
1519 /* Provide kernel hint to read ahead. */
1520 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1521diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/vax/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/vax/bits/fcntl.h
1522--- uClibc-0.9.30.orig/libc/sysdeps/linux/vax/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1523+++ uClibc-0.9.30/libc/sysdeps/linux/vax/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1524@@ -162,7 +162,7 @@
1525 #endif
1526
1527
1528-#ifdef __USE_GNU
1529+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1530 /* Flags for SYNC_FILE_RANGE. */
1531 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1532 in the range before performing the
1533@@ -185,7 +185,7 @@
1534
1535 __BEGIN_DECLS
1536
1537-#ifdef __USE_GNU
1538+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1539
1540 /* Provide kernel hint to read ahead. */
1541 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1542diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/x86_64/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/x86_64/bits/fcntl.h
1543--- uClibc-0.9.30.orig/libc/sysdeps/linux/x86_64/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1544+++ uClibc-0.9.30/libc/sysdeps/linux/x86_64/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1545@@ -203,7 +203,7 @@
1546 #endif
1547
1548
1549-#ifdef __USE_GNU
1550+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1551 /* Flags for SYNC_FILE_RANGE. */
1552 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1553 in the range before performing the
1554@@ -226,7 +226,7 @@
1555
1556 __BEGIN_DECLS
1557
1558-#ifdef __USE_GNU
1559+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1560
1561 /* Provide kernel hint to read ahead. */
1562 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1563diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/x86_64/bits/kernel_types.h uClibc-0.9.30/libc/sysdeps/linux/x86_64/bits/kernel_types.h
1564--- uClibc-0.9.30.orig/libc/sysdeps/linux/x86_64/bits/kernel_types.h 2008-07-23 04:23:36.000000000 -0700
1565+++ uClibc-0.9.30/libc/sysdeps/linux/x86_64/bits/kernel_types.h 2009-01-12 07:04:25.958006000 -0800
1566@@ -4,8 +4,17 @@
1567 * our private content, and not the kernel header, will win.
1568 * -Erik
1569 */
1570-#ifndef _ASM_X86_64_POSIX_TYPES_H
1571+
1572+/* a hack for compiling a 32 bit user space with 64 bit
1573+ * kernel on x86_64 */
1574+#if !defined(__ARCH_I386_POSIX_TYPES_H) && \
1575+ !defined(_ASM_X86_64_POSIX_TYPES_H) && \
1576+ !defined(_ASM_X86_POSIX_TYPES_32_H) && \
1577+ !defined(_ASM_X86_POSIX_TYPES_64_H)
1578 #define _ASM_X86_64_POSIX_TYPES_H
1579+#define __ARCH_I386_POSIX_TYPES_H
1580+#define _ASM_X86_POSIX_TYPES_32_H
1581+#define _ASM_X86_POSIX_TYPES_64_H
1582
1583 typedef unsigned long __kernel_dev_t;
1584 typedef unsigned long __kernel_ino_t;
1585diff -Naur uClibc-0.9.30.orig/libc/sysdeps/linux/xtensa/bits/fcntl.h uClibc-0.9.30/libc/sysdeps/linux/xtensa/bits/fcntl.h
1586--- uClibc-0.9.30.orig/libc/sysdeps/linux/xtensa/bits/fcntl.h 2008-09-16 07:02:54.000000000 -0700
1587+++ uClibc-0.9.30/libc/sysdeps/linux/xtensa/bits/fcntl.h 2008-11-15 07:55:31.019090000 -0800
1588@@ -186,7 +186,7 @@
1589 #endif
1590
1591
1592-#ifdef __USE_GNU
1593+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1594 /* Flags for SYNC_FILE_RANGE. */
1595 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
1596 in the range before performing the
1597@@ -209,7 +209,7 @@
1598
1599 __BEGIN_DECLS
1600
1601-#ifdef __USE_GNU
1602+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
1603
1604 /* Provide kernel hint to read ahead. */
1605 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
1606diff -Naur uClibc-0.9.30.orig/libm/e_scalb.c uClibc-0.9.30/libm/e_scalb.c
1607--- uClibc-0.9.30.orig/libm/e_scalb.c 2008-09-26 07:50:16.000000000 -0700
1608+++ uClibc-0.9.30/libm/e_scalb.c 2008-12-22 03:55:13.991752000 -0800
1609@@ -44,7 +44,7 @@
1610 return scalbn(x,fn);
1611 #else
1612 if (isnan(x)||isnan(fn)) return x*fn;
1613- if (!finite(fn)) {
1614+ if (!isfinite(fn)) {
1615 if(fn>0.0) return x*fn;
1616 else return x/(-fn);
1617 }
1618diff -Naur uClibc-0.9.30.orig/libm/float_wrappers.c uClibc-0.9.30/libm/float_wrappers.c
1619--- uClibc-0.9.30.orig/libm/float_wrappers.c 2008-09-26 07:50:16.000000000 -0700
1620+++ uClibc-0.9.30/libm/float_wrappers.c 2008-12-22 03:55:13.991752000 -0800
1621@@ -36,6 +36,7 @@
1622 float atan2f(float, float);
1623 float atanf(float);
1624 float atanhf(float);
1625+float cargf(float complex);
1626 float cbrtf(float);
1627 float ceilf(float);
1628 float copysignf(float, float);
1629@@ -133,7 +134,7 @@
1630 #ifdef L_cargf
1631 float cargf (float complex x)
1632 {
1633- return (float) carg( (double)x );
1634+ return (float) carg( (double complex)x );
1635 }
1636 #endif
1637
1638@@ -532,3 +533,10 @@
1639 return (float) trunc( (double)x );
1640 }
1641 #endif
1642+
1643+#ifdef L_fmaf
1644+float fmaf (float x, float y, float z)
1645+{
1646+ return (float) fma( (double)x, (double)y, (double)z );
1647+}
1648+#endif
1649diff -Naur uClibc-0.9.30.orig/libm/ldouble_wrappers.c uClibc-0.9.30/libm/ldouble_wrappers.c
1650--- uClibc-0.9.30.orig/libm/ldouble_wrappers.c 2008-10-03 07:24:28.000000000 -0700
1651+++ uClibc-0.9.30/libm/ldouble_wrappers.c 2009-01-22 05:37:09.015514000 -0800
1652@@ -11,6 +11,8 @@
1653 */
1654
1655 #include "math.h"
1656+#include <complex.h>
1657+
1658
1659 /* Implement the following, as defined by SuSv3 */
1660 #if 0
1661@@ -21,6 +23,7 @@
1662 long double atan2l(long double, long double);
1663 long double atanhl(long double);
1664 long double atanl(long double);
1665+long double cargl(long double complex);
1666 long double cbrtl(long double);
1667 long double ceill(long double);
1668 long double copysignl(long double, long double);
1669@@ -128,6 +131,14 @@
1670 #endif
1671
1672
1673+#ifdef L_cargl
1674+long double cargl (long double complex x)
1675+{
1676+ return (long double) carg( (double complex)x );
1677+}
1678+#endif
1679+
1680+
1681 #ifdef L_cbrtl
1682 long double cbrtl (long double x)
1683 {
1684@@ -521,3 +532,43 @@
1685 return (long double) trunc( (double)x );
1686 }
1687 #endif
1688+
1689+
1690+#ifdef __DO_C99_MATH__
1691+
1692+#ifdef L_fpclassifyl
1693+int __fpclassifyl (long double x)
1694+{
1695+ return __fpclassify ( (double) x );
1696+}
1697+#endif
1698+
1699+#ifdef L_finitel
1700+int __finitel (long double x)
1701+{
1702+ return __finite ( (double)x );
1703+}
1704+#endif
1705+
1706+#ifdef L_signbitl
1707+int __signbitl (long double x)
1708+{
1709+ return __signbitl ( (double)x );
1710+}
1711+#endif
1712+
1713+#ifdef L_isnanl
1714+int __isnanl (long double x)
1715+{
1716+ return __isnan ( (double)x );
1717+}
1718+#endif
1719+
1720+#ifdef L_isinfl
1721+int __isinfl (long double x)
1722+{
1723+ return __isinf ( (double)x );
1724+}
1725+#endif
1726+
1727+#endif
1728diff -Naur uClibc-0.9.30.orig/libm/Makefile.in uClibc-0.9.30/libm/Makefile.in
1729--- uClibc-0.9.30.orig/libm/Makefile.in 2008-11-07 13:15:53.000000000 -0800
1730+++ uClibc-0.9.30/libm/Makefile.in 2008-12-22 03:55:13.991752000 -0800
1731@@ -86,13 +86,13 @@
1732 scalblnf.o scalbnf.o sinf.o sinhf.o sqrtf.o tanf.o tanhf.o \
1733 tgammaf.o truncf.o cargf.o llrintf.o
1734
1735-LD_MOBJ := acoshl.o acosl.o asinhl.o asinl.o atan2l.o atanhl.o atanl.o cbrtl.o \
1736+LD_MOBJ := acoshl.o acosl.o asinhl.o asinl.o atan2l.o atanhl.o atanl.o cargl.o cbrtl.o \
1737 ceill.o copysignl.o coshl.o cosl.o erfcl.o erfl.o exp2l.o expl.o \
1738- expm1l.o fabsl.o fdiml.o floorl.o fmal.o fmaxl.o fminl.o fmodl.o \
1739- frexpl.o gammal.o hypotl.o ilogbl.o ldexpl.o lgammal.o llrintl.o \
1740+ expm1l.o fabsl.o finitel.o fdiml.o floorl.o fmal.o fmaxl.o fminl.o fmodl.o fpclassifyl.o \
1741+ frexpl.o gammal.o hypotl.o ilogbl.o isinfl.o isnanl.o ldexpl.o lgammal.o llrintl.o \
1742 llroundl.o log10l.o log1pl.o XXXlog2l.o logbl.o logl.o lrintl.o lroundl.o \
1743 modfl.o nearbyintl.o nextafterl.o XXXnexttowardl.o powl.o remainderl.o \
1744- remquol.o rintl.o roundl.o scalblnl.o scalbnl.o sinhl.o sinl.o sqrtl.o \
1745+ remquol.o rintl.o roundl.o scalblnl.o scalbnl.o signbitl.o sinhl.o sinl.o sqrtl.o \
1746 tanhl.o tanl.o tgammal.o truncl.o
1747 else
1748 # This list of math functions was taken from POSIX/IEEE 1003.1b-1993
1749@@ -139,21 +139,21 @@
1750 libm_OBJ := $(patsubst $(libm_DIR)/%.c,$(libm_OUT)/%.o,$(libm_SRC))
1751
1752 ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y)
1753-libm_MSRC2 := $(libm_DIR)/$(LD_MSRC)
1754-libm_MOBJ2 := $(patsubst %.o,$(libm_OUT)/%.o,$(LD_MOBJ))
1755+libm_MSRC_LD := $(libm_DIR)/$(LD_MSRC)
1756+libm_MOBJ_LD := $(patsubst %.o,$(libm_OUT)/%.o,$(LD_MOBJ))
1757 endif
1758-libm_MSRC := $(libm_DIR)/$(FL_MSRC)
1759-libm_MOBJ := $(patsubst %.o,$(libm_OUT)/%.o,$(FL_MOBJ))
1760+libm_MSRC_FL := $(libm_DIR)/$(FL_MSRC)
1761+libm_MOBJ_FL := $(patsubst %.o,$(libm_OUT)/%.o,$(FL_MOBJ))
1762
1763
1764 ifneq ($(DOMULTI),n)
1765-CFLAGS-libm += $(patsubst %,-DL_%,$(subst .o,,$(notdir $(libm_MOBJ))))
1766+CFLAGS-libm += $(patsubst %,-DL_%,$(subst .o,,$(notdir $(libm_MOBJ_FL))))
1767 ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y)
1768-CFLAGS-libm += $(patsubst %,-DL_%,$(subst .o,,$(notdir $(libm_MOBJ2))))
1769+CFLAGS-libm += $(patsubst %,-DL_%,$(subst .o,,$(notdir $(libm_MOBJ_LD))))
1770 endif
1771 endif
1772
1773-libm_OBJS := $(libm_OBJ) $(libm_MOBJ) $(libm_MOBJ2)
1774+libm_OBJS := $(libm_OBJ) $(libm_MOBJ_FL) $(libm_MOBJ_LD)
1775
1776 ifeq ($(DOPIC),y)
1777 libm-a-y += $(libm_OBJS:.o=.os)
1778@@ -182,7 +182,7 @@
1779 $(Q)$(RM) $@
1780 $(do_ar)
1781
1782-$(libm_OUT)/libm.oS: $(libm_SRC) $(libm_MSRC) $(libm_MSRC2) $(libm_ARCH_SRC)
1783+$(libm_OUT)/libm.oS: $(libm_SRC) $(libm_MSRC_FL) $(libm_MSRC_LD) $(libm_ARCH_SRC)
1784 $(Q)$(RM) $@
1785 $(compile-m)
1786
1787@@ -191,17 +191,24 @@
1788 $(Q)$(RM) $@
1789 $(do_ar)
1790
1791-$(libm_MOBJ): $(libm_MSRC)
1792+$(libm_MOBJ_FL): $(libm_MSRC_FL)
1793 $(compile.m)
1794
1795-$(libm_MOBJ2): $(libm_MSRC2)
1796+$(libm_MOBJ_LD): $(libm_MSRC_LD)
1797 $(compile.m)
1798
1799-$(libm_MOBJ:.o=.os): $(libm_MSRC)
1800+$(libm_MOBJ_FL:.o=.os): $(libm_MSRC_FL)
1801 $(compile.m)
1802
1803-$(libm_MOBJ2:.o=.os): $(libm_MSRC2)
1804+$(libm_MOBJ_LD:.o=.os): $(libm_MSRC_LD)
1805 $(compile.m)
1806
1807+# spare us from adding a gazillion dummy two-liner files
1808+$(libm_MOBJ_FL:.o=.i): $(libm_MSRC_FL)
1809+ $(compile.mi)
1810+
1811+$(libm_MOBJ_LD:.o=.i): $(libm_MSRC_LD)
1812+ $(compile.mi)
1813+
1814 libm_clean:
1815 $(do_rm) $(addprefix $(libm_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*.,$(d)$(e))))
1816diff -Naur uClibc-0.9.30.orig/libm/s_finite.c uClibc-0.9.30/libm/s_finite.c
1817--- uClibc-0.9.30.orig/libm/s_finite.c 2008-09-26 07:50:16.000000000 -0700
1818+++ uClibc-0.9.30/libm/s_finite.c 2008-12-22 03:55:13.991752000 -0800
1819@@ -25,5 +25,3 @@
1820 return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
1821 }
1822 libm_hidden_def(__finite)
1823-weak_alias(__finite,finite)
1824-libm_hidden_weak(finite)
1825diff -Naur uClibc-0.9.30.orig/libm/s_finitef.c uClibc-0.9.30/libm/s_finitef.c
1826--- uClibc-0.9.30.orig/libm/s_finitef.c 2008-09-26 07:50:16.000000000 -0700
1827+++ uClibc-0.9.30/libm/s_finitef.c 2008-12-22 03:55:13.991752000 -0800
1828@@ -21,7 +21,6 @@
1829 #include "math.h"
1830 #include "math_private.h"
1831
1832-libm_hidden_proto(__finitef)
1833 int __finitef(float x)
1834 {
1835 int32_t ix;
1836@@ -29,4 +28,3 @@
1837 return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31);
1838 }
1839 libm_hidden_def(__finitef)
1840-strong_alias(__finitef,finitef)
1841diff -Naur uClibc-0.9.30.orig/libm/s_fma.c uClibc-0.9.30/libm/s_fma.c
1842--- uClibc-0.9.30.orig/libm/s_fma.c 2008-09-26 07:50:16.000000000 -0700
1843+++ uClibc-0.9.30/libm/s_fma.c 2008-12-22 03:55:13.991752000 -0800
1844@@ -20,11 +20,9 @@
1845
1846 #include <math.h>
1847
1848-libm_hidden_proto(__fma)
1849 double
1850-__fma (double x, double y, double z)
1851+fma (double x, double y, double z)
1852 {
1853 return (x * y) + z;
1854 }
1855-libm_hidden_def(__fma)
1856-strong_alias (__fma, fma)
1857+libm_hidden_def(fma)
1858diff -Naur uClibc-0.9.30.orig/libm/s_fpclassify.c uClibc-0.9.30/libm/s_fpclassify.c
1859--- uClibc-0.9.30.orig/libm/s_fpclassify.c 2008-09-26 07:50:16.000000000 -0700
1860+++ uClibc-0.9.30/libm/s_fpclassify.c 2008-12-22 03:55:13.991752000 -0800
1861@@ -40,4 +40,4 @@
1862
1863 return retval;
1864 }
1865-libm_hidden_def (__fpclassify)
1866+libm_hidden_def(__fpclassify)
1867diff -Naur uClibc-0.9.30.orig/libm/s_fpclassifyf.c uClibc-0.9.30/libm/s_fpclassifyf.c
1868--- uClibc-0.9.30.orig/libm/s_fpclassifyf.c 2008-09-26 07:50:16.000000000 -0700
1869+++ uClibc-0.9.30/libm/s_fpclassifyf.c 2008-12-22 03:55:13.991752000 -0800
1870@@ -21,9 +21,7 @@
1871 #include <math.h>
1872 #include "math_private.h"
1873
1874-libm_hidden_proto (__fpclassifyf)
1875-int
1876-__fpclassifyf (float x)
1877+int __fpclassifyf (float x)
1878 {
1879 u_int32_t wx;
1880 int retval = FP_NORMAL;
1881@@ -39,4 +37,4 @@
1882
1883 return retval;
1884 }
1885-libm_hidden_def (__fpclassifyf)
1886+libm_hidden_def(__fpclassifyf)
1887diff -Naur uClibc-0.9.30.orig/libm/s_isinf.c uClibc-0.9.30/libm/s_isinf.c
1888--- uClibc-0.9.30.orig/libm/s_isinf.c 2008-09-26 07:50:16.000000000 -0700
1889+++ uClibc-0.9.30/libm/s_isinf.c 2008-12-22 03:55:13.991752000 -0800
1890@@ -22,5 +22,3 @@
1891 return ~(lx >> 31) & (hx >> 30);
1892 }
1893 libm_hidden_def(__isinf)
1894-weak_alias (__isinf, isinf)
1895-libm_hidden_weak(isinf)
1896diff -Naur uClibc-0.9.30.orig/libm/s_isinff.c uClibc-0.9.30/libm/s_isinff.c
1897--- uClibc-0.9.30.orig/libm/s_isinff.c 2008-09-26 07:50:16.000000000 -0700
1898+++ uClibc-0.9.30/libm/s_isinff.c 2008-12-22 03:55:13.991752000 -0800
1899@@ -11,7 +11,6 @@
1900 #include "math.h"
1901 #include "math_private.h"
1902
1903-libm_hidden_proto(__isinff)
1904 int
1905 __isinff (float x)
1906 {
1907@@ -23,4 +22,3 @@
1908 return ~(t >> 31) & (ix >> 30);
1909 }
1910 libm_hidden_def(__isinff)
1911-strong_alias (__isinff, isinff)
1912diff -Naur uClibc-0.9.30.orig/libm/s_isnan.c uClibc-0.9.30/libm/s_isnan.c
1913--- uClibc-0.9.30.orig/libm/s_isnan.c 2008-09-26 07:50:16.000000000 -0700
1914+++ uClibc-0.9.30/libm/s_isnan.c 2008-12-22 03:55:13.991752000 -0800
1915@@ -18,12 +18,7 @@
1916 #include "math.h"
1917 #include "math_private.h"
1918
1919-#ifdef __STDC__
1920- int __isnan(double x)
1921-#else
1922- int __isnan(x)
1923- double x;
1924-#endif
1925+int __isnan(double x)
1926 {
1927 int32_t hx,lx;
1928 EXTRACT_WORDS(hx,lx,x);
1929@@ -33,5 +28,3 @@
1930 return (int)(((u_int32_t)hx)>>31);
1931 }
1932 libm_hidden_def(__isnan)
1933-weak_alias(__isnan,isnan)
1934-libm_hidden_weak(isnan)
1935diff -Naur uClibc-0.9.30.orig/libm/s_isnanf.c uClibc-0.9.30/libm/s_isnanf.c
1936--- uClibc-0.9.30.orig/libm/s_isnanf.c 2008-09-26 07:50:16.000000000 -0700
1937+++ uClibc-0.9.30/libm/s_isnanf.c 2008-12-22 03:55:13.991752000 -0800
1938@@ -21,7 +21,6 @@
1939 #include "math.h"
1940 #include "math_private.h"
1941
1942-libm_hidden_proto (__isnanf)
1943 int __isnanf(float x)
1944 {
1945 int32_t ix;
1946@@ -30,5 +29,4 @@
1947 ix = 0x7f800000 - ix;
1948 return (int)(((u_int32_t)(ix))>>31);
1949 }
1950-libm_hidden_def (__isnanf)
1951-weak_alias (__isnanf, isnanf)
1952+libm_hidden_def(__isnanf)
1953diff -Naur uClibc-0.9.30.orig/libm/s_ldexp.c uClibc-0.9.30/libm/s_ldexp.c
1954--- uClibc-0.9.30.orig/libm/s_ldexp.c 2008-09-26 07:50:16.000000000 -0700
1955+++ uClibc-0.9.30/libm/s_ldexp.c 2008-12-22 03:55:13.991752000 -0800
1956@@ -26,9 +26,9 @@
1957 double value; int exp;
1958 #endif
1959 {
1960- if(!finite(value)||value==0.0) return value;
1961+ if(!isfinite(value)||value==0.0) return value;
1962 value = scalbn(value,exp);
1963- if(!finite(value)||value==0.0) errno = ERANGE;
1964+ if(!isfinite(value)||value==0.0) errno = ERANGE;
1965 return value;
1966 }
1967 libm_hidden_def(ldexp)
1968diff -Naur uClibc-0.9.30.orig/libm/s_signbitf.c uClibc-0.9.30/libm/s_signbitf.c
1969--- uClibc-0.9.30.orig/libm/s_signbitf.c 2008-09-25 10:43:58.000000000 -0700
1970+++ uClibc-0.9.30/libm/s_signbitf.c 2008-12-22 03:55:13.991752000 -0800
1971@@ -22,7 +22,6 @@
1972
1973 #include "math_private.h"
1974
1975-libm_hidden_proto(__signbitf)
1976 int
1977 __signbitf (float x)
1978 {
1979diff -Naur uClibc-0.9.30.orig/libm/s_significand.c uClibc-0.9.30/libm/s_significand.c
1980--- uClibc-0.9.30.orig/libm/s_significand.c 2008-09-26 07:50:16.000000000 -0700
1981+++ uClibc-0.9.30/libm/s_significand.c 2008-12-22 03:55:13.991752000 -0800
1982@@ -33,4 +33,3 @@
1983 {
1984 return __ieee754_scalb(x,(double) -ilogb(x));
1985 }
1986-libm_hidden_def(significand)
1987diff -Naur uClibc-0.9.30.orig/libm/w_drem.c uClibc-0.9.30/libm/w_drem.c
1988--- uClibc-0.9.30.orig/libm/w_drem.c 2008-09-26 07:50:16.000000000 -0700
1989+++ uClibc-0.9.30/libm/w_drem.c 2008-12-22 03:55:13.991752000 -0800
1990@@ -12,4 +12,3 @@
1991 {
1992 return remainder(x, y);
1993 }
1994-libm_hidden_def(drem)
1995diff -Naur uClibc-0.9.30.orig/libm/w_exp.c uClibc-0.9.30/libm/w_exp.c
1996--- uClibc-0.9.30.orig/libm/w_exp.c 2008-09-26 07:50:16.000000000 -0700
1997+++ uClibc-0.9.30/libm/w_exp.c 2008-12-22 03:55:13.991752000 -0800
1998@@ -42,7 +42,7 @@
1999 double z;
2000 z = __ieee754_exp(x);
2001 if(_LIB_VERSION == _IEEE_) return z;
2002- if(finite(x)) {
2003+ if(isfinite(x)) {
2004 if(x>o_threshold)
2005 return __kernel_standard(x,x,6); /* exp overflow */
2006 else if(x<u_threshold)
2007diff -Naur uClibc-0.9.30.orig/libm/w_gamma.c uClibc-0.9.30/libm/w_gamma.c
2008--- uClibc-0.9.30.orig/libm/w_gamma.c 2008-09-26 07:50:16.000000000 -0700
2009+++ uClibc-0.9.30/libm/w_gamma.c 2008-12-22 03:55:13.991752000 -0800
2010@@ -37,7 +37,7 @@
2011 double y;
2012 y = __ieee754_lgamma_r(x,&signgam);
2013 if(_LIB_VERSION == _IEEE_) return y;
2014- if(!finite(y)&&finite(x)) {
2015+ if(!isfinite(y)&&isfinite(x)) {
2016 if(floor(x)==x&&x<=0.0)
2017 return __kernel_standard(x,x,41); /* gamma pole */
2018 else
2019@@ -46,4 +46,3 @@
2020 return y;
2021 #endif
2022 }
2023-libm_hidden_def(gamma)
2024diff -Naur uClibc-0.9.30.orig/libm/w_gamma_r.c uClibc-0.9.30/libm/w_gamma_r.c
2025--- uClibc-0.9.30.orig/libm/w_gamma_r.c 2008-09-26 07:50:16.000000000 -0700
2026+++ uClibc-0.9.30/libm/w_gamma_r.c 2008-12-22 03:55:13.991752000 -0800
2027@@ -37,7 +37,7 @@
2028 double y;
2029 y = __ieee754_lgamma_r(x,signgamp);
2030 if(_LIB_VERSION == _IEEE_) return y;
2031- if(!finite(y)&&finite(x)) {
2032+ if(!isfinite(y)&&isfinite(x)) {
2033 if(floor(x)==x&&x<=0.0)
2034 return __kernel_standard(x,x,41); /* gamma pole */
2035 else
2036diff -Naur uClibc-0.9.30.orig/libm/w_hypot.c uClibc-0.9.30/libm/w_hypot.c
2037--- uClibc-0.9.30.orig/libm/w_hypot.c 2008-09-26 07:50:16.000000000 -0700
2038+++ uClibc-0.9.30/libm/w_hypot.c 2008-12-22 03:55:13.991752000 -0800
2039@@ -34,7 +34,7 @@
2040 double z;
2041 z = __ieee754_hypot(x,y);
2042 if(_LIB_VERSION == _IEEE_) return z;
2043- if((!finite(z))&&finite(x)&&finite(y))
2044+ if((!isfinite(z))&&isfinite(x)&&isfinite(y))
2045 return __kernel_standard(x,y,4); /* hypot overflow */
2046 else
2047 return z;
2048diff -Naur uClibc-0.9.30.orig/libm/w_j0.c uClibc-0.9.30/libm/w_j0.c
2049--- uClibc-0.9.30.orig/libm/w_j0.c 2008-09-26 07:50:16.000000000 -0700
2050+++ uClibc-0.9.30/libm/w_j0.c 2008-12-22 03:55:13.991752000 -0800
2051@@ -39,7 +39,6 @@
2052 return z;
2053 #endif
2054 }
2055-libm_hidden_def(j0)
2056
2057 #ifdef __STDC__
2058 double y0(double x) /* wrapper y0 */
2059@@ -68,4 +67,3 @@
2060 return z;
2061 #endif
2062 }
2063-libm_hidden_def(y0)
2064diff -Naur uClibc-0.9.30.orig/libm/w_j1.c uClibc-0.9.30/libm/w_j1.c
2065--- uClibc-0.9.30.orig/libm/w_j1.c 2008-09-26 07:50:16.000000000 -0700
2066+++ uClibc-0.9.30/libm/w_j1.c 2008-12-22 03:55:13.991752000 -0800
2067@@ -40,7 +40,6 @@
2068 return z;
2069 #endif
2070 }
2071-libm_hidden_def(j1)
2072
2073 #ifdef __STDC__
2074 double y1(double x) /* wrapper y1 */
2075@@ -69,4 +68,3 @@
2076 return z;
2077 #endif
2078 }
2079-libm_hidden_def(y1)
2080diff -Naur uClibc-0.9.30.orig/libm/w_jn.c uClibc-0.9.30/libm/w_jn.c
2081--- uClibc-0.9.30.orig/libm/w_jn.c 2008-09-26 07:50:16.000000000 -0700
2082+++ uClibc-0.9.30/libm/w_jn.c 2008-12-22 03:55:13.991752000 -0800
2083@@ -62,7 +62,6 @@
2084 return z;
2085 #endif
2086 }
2087-libm_hidden_def(jn)
2088
2089 #ifdef __STDC__
2090 double yn(int n, double x) /* wrapper yn */
2091@@ -91,4 +90,3 @@
2092 return z;
2093 #endif
2094 }
2095-libm_hidden_def(yn)
2096diff -Naur uClibc-0.9.30.orig/libm/w_lgamma.c uClibc-0.9.30/libm/w_lgamma.c
2097--- uClibc-0.9.30.orig/libm/w_lgamma.c 2008-09-26 07:50:16.000000000 -0700
2098+++ uClibc-0.9.30/libm/w_lgamma.c 2008-12-22 03:55:13.991752000 -0800
2099@@ -37,7 +37,7 @@
2100 double y;
2101 y = __ieee754_lgamma_r(x,&signgam);
2102 if(_LIB_VERSION == _IEEE_) return y;
2103- if(!finite(y)&&finite(x)) {
2104+ if(!isfinite(y)&&isfinite(x)) {
2105 if(floor(x)==x&&x<=0.0)
2106 return __kernel_standard(x,x,15); /* lgamma pole */
2107 else
2108diff -Naur uClibc-0.9.30.orig/libm/w_lgamma_r.c uClibc-0.9.30/libm/w_lgamma_r.c
2109--- uClibc-0.9.30.orig/libm/w_lgamma_r.c 2008-09-26 07:50:16.000000000 -0700
2110+++ uClibc-0.9.30/libm/w_lgamma_r.c 2008-12-22 03:55:13.991752000 -0800
2111@@ -34,7 +34,7 @@
2112 double y;
2113 y = __ieee754_lgamma_r(x,signgamp);
2114 if(_LIB_VERSION == _IEEE_) return y;
2115- if(!finite(y)&&finite(x)) {
2116+ if(!isfinite(y)&&isfinite(x)) {
2117 if(floor(x)==x&&x<=0.0)
2118 return __kernel_standard(x,x,15); /* lgamma pole */
2119 else
2120@@ -43,4 +43,3 @@
2121 return y;
2122 #endif
2123 }
2124-libm_hidden_def(lgamma_r)
2125diff -Naur uClibc-0.9.30.orig/libm/w_log2.c uClibc-0.9.30/libm/w_log2.c
2126--- uClibc-0.9.30.orig/libm/w_log2.c 2008-10-06 03:24:41.000000000 -0700
2127+++ uClibc-0.9.30/libm/w_log2.c 2008-12-22 03:55:13.991752000 -0800
2128@@ -11,4 +11,3 @@
2129 {
2130 return __ieee754_log2 (d);
2131 }
2132-libm_hidden_def(log2)
2133diff -Naur uClibc-0.9.30.orig/libm/w_pow.c uClibc-0.9.30/libm/w_pow.c
2134--- uClibc-0.9.30.orig/libm/w_pow.c 2008-09-26 07:50:16.000000000 -0700
2135+++ uClibc-0.9.30/libm/w_pow.c 2008-12-22 03:55:13.991752000 -0800
2136@@ -41,19 +41,19 @@
2137 if(x==0.0){
2138 if(y==0.0)
2139 return __kernel_standard(x,y,20); /* pow(0.0,0.0) */
2140- if(finite(y)&&y<0.0)
2141+ if(isfinite(y)&&y<0.0)
2142 return __kernel_standard(x,y,23); /* pow(0.0,negative) */
2143 return z;
2144 }
2145- if(!finite(z)) {
2146- if(finite(x)&&finite(y)) {
2147+ if(!isfinite(z)) {
2148+ if(isfinite(x)&&isfinite(y)) {
2149 if(isnan(z))
2150 return __kernel_standard(x,y,24); /* pow neg**non-int */
2151 else
2152 return __kernel_standard(x,y,21); /* pow overflow */
2153 }
2154 }
2155- if(z==0.0&&finite(x)&&finite(y))
2156+ if(z==0.0&&isfinite(x)&&isfinite(y))
2157 return __kernel_standard(x,y,22); /* pow underflow */
2158 return z;
2159 #endif
2160diff -Naur uClibc-0.9.30.orig/libm/w_scalb.c uClibc-0.9.30/libm/w_scalb.c
2161--- uClibc-0.9.30.orig/libm/w_scalb.c 2008-09-26 07:50:16.000000000 -0700
2162+++ uClibc-0.9.30/libm/w_scalb.c 2008-12-22 03:55:13.991752000 -0800
2163@@ -46,16 +46,15 @@
2164 double z;
2165 z = __ieee754_scalb(x,fn);
2166 if(_LIB_VERSION == _IEEE_) return z;
2167- if(!(finite(z)||isnan(z))&&finite(x)) {
2168+ if(!(isfinite(z)||isnan(z))&&isfinite(x)) {
2169 return __kernel_standard(x,(double)fn,32); /* scalb overflow */
2170 }
2171 if(z==0.0&&z!=x) {
2172 return __kernel_standard(x,(double)fn,33); /* scalb underflow */
2173 }
2174 #ifndef _SCALB_INT
2175- if(!finite(fn)) errno = ERANGE;
2176+ if(!isfinite(fn)) errno = ERANGE;
2177 #endif
2178 return z;
2179 #endif
2180 }
2181-libm_hidden_def(scalb)
2182diff -Naur uClibc-0.9.30.orig/libm/w_sinh.c uClibc-0.9.30/libm/w_sinh.c
2183--- uClibc-0.9.30.orig/libm/w_sinh.c 2008-09-26 07:50:16.000000000 -0700
2184+++ uClibc-0.9.30/libm/w_sinh.c 2008-12-22 03:55:13.991752000 -0800
2185@@ -34,7 +34,7 @@
2186 double z;
2187 z = __ieee754_sinh(x);
2188 if(_LIB_VERSION == _IEEE_) return z;
2189- if(!finite(z)&&finite(x)) {
2190+ if(!isfinite(z)&&isfinite(x)) {
2191 return __kernel_standard(x,x,25); /* sinh overflow */
2192 } else
2193 return z;
2194diff -Naur uClibc-0.9.30.orig/libm/w_tgamma.c uClibc-0.9.30/libm/w_tgamma.c
2195--- uClibc-0.9.30.orig/libm/w_tgamma.c 2008-09-26 07:50:16.000000000 -0700
2196+++ uClibc-0.9.30/libm/w_tgamma.c 2008-12-22 03:55:13.991752000 -0800
2197@@ -35,7 +35,7 @@
2198 #else
2199 if(_LIB_VERSION == _IEEE_) return y;
2200
2201- if(!finite(y)&&finite(x)) {
2202+ if(!isfinite(y)&&isfinite(x)) {
2203 if(floor(x)==x&&x<=0.0)
2204 return __kernel_standard(x,x,41); /* tgamma pole */
2205 else
2206diff -Naur uClibc-0.9.30.orig/libnsl/Makefile.in uClibc-0.9.30/libnsl/Makefile.in
2207--- uClibc-0.9.30.orig/libnsl/Makefile.in 2008-11-07 13:15:53.000000000 -0800
2208+++ uClibc-0.9.30/libnsl/Makefile.in 2009-01-22 01:50:29.175100000 -0800
2209@@ -7,7 +7,7 @@
2210
2211 CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl $(SSP_ALL_CFLAGS)
2212
2213-LDFLAGS-libnsl.so := $(LDFLAGS)
2214+LDFLAGS-libnsl.so := $(LDFLAGS) $(call link.asneeded,-lc)
2215
2216 LIBS-libnsl.so := $(LIBS)
2217
2218diff -Naur uClibc-0.9.30.orig/libpthread/linuxthreads/sysdeps/pthread/pthread.h uClibc-0.9.30/libpthread/linuxthreads/sysdeps/pthread/pthread.h
2219--- uClibc-0.9.30.orig/libpthread/linuxthreads/sysdeps/pthread/pthread.h 2006-12-07 19:19:36.000000000 -0800
2220+++ uClibc-0.9.30/libpthread/linuxthreads/sysdeps/pthread/pthread.h 2009-01-21 15:19:15.303392000 -0800
2221@@ -290,7 +290,7 @@
2222
2223 #ifdef __USE_GNU
2224 /* Initialize thread attribute *ATTR with attributes corresponding to the
2225- already running thread TH. It shall be called on unitialized ATTR
2226+ already running thread TH. It shall be called on uninitialized ATTR
2227 and destroyed with pthread_attr_destroy when no longer needed. */
2228 extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
2229 #endif
2230diff -Naur uClibc-0.9.30.orig/libpthread/linuxthreads.old/sysdeps/mips/pt-machine.h uClibc-0.9.30/libpthread/linuxthreads.old/sysdeps/mips/pt-machine.h
2231--- uClibc-0.9.30.orig/libpthread/linuxthreads.old/sysdeps/mips/pt-machine.h 2008-07-23 04:19:00.000000000 -0700
2232+++ uClibc-0.9.30/libpthread/linuxthreads.old/sysdeps/mips/pt-machine.h 2008-11-18 00:01:04.405155000 -0800
2233@@ -25,40 +25,13 @@
2234 #define _PT_MACHINE_H 1
2235
2236 #include <features.h>
2237+#include <sgidefs.h>
2238+#include <sys/tas.h>
2239
2240 #ifndef PT_EI
2241 # define PT_EI __extern_always_inline
2242 #endif
2243
2244-/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2245- This file is part of the GNU C Library.
2246- Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. */
2247-static __inline__ int
2248-__NTH (_test_and_set (int *p, int v))
2249-{
2250- int r, t;
2251-
2252- __asm__ __volatile__
2253- ("/* Inline test and set */\n"
2254- "1:\n\t"
2255- ".set push\n\t"
2256- ".set mips2\n\t"
2257- "ll %0,%3\n\t"
2258- "move %1,%4\n\t"
2259- "beq %0,%4,2f\n\t"
2260- "sc %1,%2\n\t"
2261- ".set pop\n\t"
2262- "beqz %1,1b\n"
2263- "2:\n\t"
2264- "/* End test and set */"
2265- : "=&r" (r), "=&r" (t), "=m" (*p)
2266- : "m" (*p), "r" (v)
2267- : "memory");
2268-
2269- return r;
2270-}
2271-
2272-
2273 /* Spinlock implementation; required. */
2274
2275 PT_EI long int
2276@@ -86,12 +59,22 @@
2277 ("/* Inline compare & swap */\n"
2278 "1:\n\t"
2279 ".set push\n\t"
2280+#if _MIPS_SIM == _ABIO32
2281 ".set mips2\n\t"
2282+#endif
2283+#if _MIPS_SIM == _ABI64
2284+ "lld %1,%5\n\t"
2285+#else
2286 "ll %1,%5\n\t"
2287+#endif
2288 "move %0,$0\n\t"
2289 "bne %1,%3,2f\n\t"
2290 "move %0,%4\n\t"
2291+#if _MIPS_SIM == _ABI64
2292+ "scd %0,%2\n\t"
2293+#else
2294 "sc %0,%2\n\t"
2295+#endif
2296 ".set pop\n\t"
2297 "beqz %0,1b\n"
2298 "2:\n\t"
2299diff -Naur uClibc-0.9.30.orig/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h uClibc-0.9.30/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h
2300--- uClibc-0.9.30.orig/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h 2007-11-22 08:55:08.000000000 -0800
2301+++ uClibc-0.9.30/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h 2009-01-21 15:19:15.303392000 -0800
2302@@ -293,7 +293,7 @@
2303
2304 #ifdef __USE_GNU
2305 /* Initialize thread attribute *ATTR with attributes corresponding to the
2306- already running thread TH. It shall be called on unitialized ATTR
2307+ already running thread TH. It shall be called on uninitialized ATTR
2308 and destroyed with pthread_attr_destroy when no longer needed. */
2309 extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
2310 #endif
2311diff -Naur uClibc-0.9.30.orig/libresolv/Makefile.in uClibc-0.9.30/libresolv/Makefile.in
2312--- uClibc-0.9.30.orig/libresolv/Makefile.in 2008-11-07 13:15:53.000000000 -0800
2313+++ uClibc-0.9.30/libresolv/Makefile.in 2009-01-22 01:50:29.175100000 -0800
2314@@ -7,7 +7,7 @@
2315
2316 CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv $(SSP_ALL_CFLAGS)
2317
2318-LDFLAGS-libresolv.so := $(LDFLAGS)
2319+LDFLAGS-libresolv.so := $(LDFLAGS) $(call link.asneeded,-lc)
2320
2321 LIBS-libresolv.so := $(LIBS)
2322
2323diff -Naur uClibc-0.9.30.orig/librt/Makefile.in uClibc-0.9.30/librt/Makefile.in
2324--- uClibc-0.9.30.orig/librt/Makefile.in 2008-11-07 13:15:53.000000000 -0800
2325+++ uClibc-0.9.30/librt/Makefile.in 2009-01-22 01:50:29.175100000 -0800
2326@@ -7,7 +7,7 @@
2327
2328 CFLAGS-librt := -DNOT_IN_libc -DIS_IN_librt $(SSP_ALL_CFLAGS)
2329
2330-LDFLAGS-librt.so := $(LDFLAGS)
2331+LDFLAGS-librt.so := $(LDFLAGS) $(call link.asneeded,-lc)
2332
2333 LIBS-librt.so := $(LIBS)
2334
2335diff -Naur uClibc-0.9.30.orig/Makefile.in uClibc-0.9.30/Makefile.in
2336--- uClibc-0.9.30.orig/Makefile.in 2008-11-07 13:15:53.000000000 -0800
2337+++ uClibc-0.9.30/Makefile.in 2008-11-17 14:38:34.243941000 -0800
2338@@ -159,7 +159,7 @@
2339 @$(disp_gen)
2340 $(Q)set -e; \
2341 cd $(top_builddir); \
2342- tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null`; \
2343+ tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null || true`; \
2344 [ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \
2345 KERNEL_HEADERS="${KERNEL_HEADERS}" top_builddir=. CC="$(CC) $(CPU_CFLAGS)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
2346 if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
2347@@ -167,6 +167,15 @@
2348 else \
2349 mv -f $$tmp include/bits/sysnum.h; \
2350 fi
2351+ @# Ugly linux specific hack..
2352+ $(Q)if grep -q __NR_ $@; then true; else \
2353+ rm -f $@; \
2354+ echo "ERROR: Could not generate syscalls."; \
2355+ echo "Make sure that you have proper kernel headers."; \
2356+ echo "Your .config in KERNEL_HEADERS=\"\" was set to:"; \
2357+ echo "${KERNEL_HEADERS}"; \
2358+ exit 1; \
2359+ fi
2360
2361 $(LOCAL_INSTALL_PATH):
2362 $(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
2363@@ -315,7 +324,13 @@
2364 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/inotify.h
2365 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/perm.h
2366 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/personality.h
2367+ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/prctl.h
2368+ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/reboot.h
2369+ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/sendfile.h
2370+ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/fsuid.h
2371 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/signalfd.h
2372+ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/swap.h
2373+ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/sysctl.h
2374 endif
2375 ifneq ($(UCLIBC_SV4_DEPRECATED),y)
2376 # Remove ustat.h since deprecated SV4 support was disabled upon request
2377diff -Naur uClibc-0.9.30.orig/Makerules uClibc-0.9.30/Makerules
2378--- uClibc-0.9.30.orig/Makerules 2008-11-07 13:15:53.000000000 -0800
2379+++ uClibc-0.9.30/Makerules 2009-01-14 08:03:24.358149000 -0800
2380@@ -80,6 +80,7 @@
2381 pur_disp_compile.u = echo " "CC $(show_objs)
2382 pur_disp_compile.S = echo " "AS $(show_objs)
2383 pur_disp_compile.m = $(pur_disp_compile.c)
2384+pur_disp_compile.mi= echo " "CPP-m $(show_objs)
2385 pur_disp_compile-m = echo " "CC-m $(show_objs)
2386 pur_disp_hcompile.u= echo " "HOSTCC $(show_objs)
2387 pur_disp_hcompile.o= echo " "HOSTCC-o $(show_objs)
2388@@ -99,6 +100,7 @@
2389 sil_disp_compile.u = true
2390 sil_disp_compile.S = true
2391 sil_disp_compile.m = true
2392+sil_disp_compile.mi= true
2393 sil_disp_compile-m = true
2394 sil_disp_hcompile.u= true
2395 sil_disp_hcompile.o= true
2396@@ -118,6 +120,7 @@
2397 ver_disp_compile.u = echo $(cmd_compile.u)
2398 ver_disp_compile.S = echo $(cmd_compile.S)
2399 ver_disp_compile.m = echo $(cmd_compile.m)
2400+ver_disp_compile.mi= echo $(cmd_compile.mi)
2401 ver_disp_compile-m = echo $(cmd_compile-m)
2402 ver_disp_hcompile.u= echo $(cmd_hcompile.u)
2403 ver_disp_hcompile.o= echo $(cmd_hcompile.o)
2404@@ -137,6 +140,7 @@
2405 disp_compile.u = $($(DISP)_disp_compile.u)
2406 disp_compile.S = $($(DISP)_disp_compile.S)
2407 disp_compile.m = $($(DISP)_disp_compile.m)
2408+disp_compile.mi= $($(DISP)_disp_compile.mi)
2409 disp_compile-m = $($(DISP)_disp_compile-m)
2410 disp_hcompile.u= $($(DISP)_disp_hcompile.u)
2411 disp_hcompile.o= $($(DISP)_disp_hcompile.o)
2412@@ -189,6 +193,7 @@
2413 cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
2414 cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
2415 cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
2416+cmd_compile.mi= $(cmd_compile.m:-c=-E -dD $(EXTRA_CPPFLAGS))
2417
2418 cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
2419 cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
2420@@ -211,7 +216,8 @@
2421 compile.s = $(call maybe_exec,compile.s)
2422 compile.S = @$(call maybe_exec,compile.S)
2423 compile.m = @$(call maybe_exec,compile.m)
2424-compile-m = @$(disp_compile-m) ; $(cmd_compile-m) ; $(cmd_t_strip)
2425+compile.mi= $(call maybe_exec,compile.mi)
2426+compile-m = @$(disp_compile-m) ; $(cmd_compile-m) && $(cmd_t_strip)
2427 do_strip = @$(disp_strip) ; $(cmd_strip)
2428 do_t_strip= @$(disp_t_strip) ; $(cmd_t_strip)
2429 do_unifdef= @$(disp_unifdef) ; $(cmd_unifdef)
2430@@ -302,7 +308,7 @@
2431 $(Q)$(INSTALL) -d $(dir $@)
2432 $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@
2433 $(Q)echo "#include <features.h>" >> $@
2434- $(Q)echo "const char __dl_ldso__[] __attribute__ ((section " \
2435+ $(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \
2436 "(\".interp\"))) =\""$(SHARED_LIB_LOADER_PREFIX)/$(UCLIBC_LDSO)"\";" >> $@
2437
2438 $(interp): $(top_builddir)lib/interp.c
2439diff -Naur uClibc-0.9.30.orig/Rules.mak uClibc-0.9.30/Rules.mak
2440--- uClibc-0.9.30.orig/Rules.mak 2008-11-12 04:24:16.000000000 -0800
2441+++ uClibc-0.9.30/Rules.mak 2009-01-22 01:50:29.175100000 -0800
2442@@ -417,22 +417,39 @@
2443
2444 # Keep the check_gcc from being needlessly executed
2445 ifndef PIEFLAG
2446-ifneq ($(UCLIBC_BUILD_PIE),y)
2447-export PIEFLAG:=
2448-else
2449 export PIEFLAG:=$(call check_gcc,$(PIEFLAG_NAME),$(PICFLAG))
2450 endif
2451-endif
2452 # We need to keep track of both the CC PIE flag (above) as
2453 # well as the LD PIE flag (below) because we can't rely on
2454-# gcc passing -pie if we used -fPIE
2455+# gcc passing -pie if we used -fPIE. We need to directly use -pie
2456+# instead of -Wl,-pie as gcc picks up the wrong startfile/endfile
2457 ifndef LDPIEFLAG
2458-ifneq ($(UCLIBC_BUILD_PIE),y)
2459-export LDPIEFLAG:=
2460-else
2461-export LDPIEFLAG:=$(shell $(LD) --help 2>/dev/null | grep -q -- -pie && echo "-Wl,-pie")
2462+export LDPIEFLAG:=$(shell $(LD) --help 2>/dev/null | grep -q -- -pie && echo "-pie")
2463+endif
2464+
2465+# Check for --as-needed support in linker
2466+ifndef LD_FLAG_ASNEEDED
2467+_LD_FLAG_ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -- --as-needed)
2468+ifneq ($(_LD_FLAG_ASNEEDED),)
2469+export LD_FLAG_ASNEEDED:=--as-needed
2470+endif
2471+endif
2472+ifndef LD_FLAG_NO_ASNEEDED
2473+ifdef LD_FLAG_ASNEEDED
2474+export LD_FLAG_NO_ASNEEDED:=--no-as-needed
2475+endif
2476+endif
2477+ifndef CC_FLAG_ASNEEDED
2478+ifdef LD_FLAG_ASNEEDED
2479+export CC_FLAG_ASNEEDED:=-Wl,$(LD_FLAG_ASNEEDED)
2480+endif
2481+endif
2482+ifndef CC_FLAG_NO_ASNEEDED
2483+ifdef LD_FLAG_NO_ASNEEDED
2484+export CC_FLAG_NO_ASNEEDED:=-Wl,$(LD_FLAG_NO_ASNEEDED)
2485 endif
2486 endif
2487+link.asneeded = $(if $(and $(CC_FLAG_ASNEEDED),$(CC_FLAG_NO_ASNEEDED)),$(CC_FLAG_ASNEEDED) $(1) $(CC_FLAG_NO_ASNEEDED))
2488
2489 # Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)
2490 ifndef ASNEEDED
2491diff -Naur uClibc-0.9.30.orig/test/locale-mbwc/dat_iswctype.c uClibc-0.9.30/test/locale-mbwc/dat_iswctype.c
2492--- uClibc-0.9.30.orig/test/locale-mbwc/dat_iswctype.c 2008-07-10 03:30:28.000000000 -0700
2493+++ uClibc-0.9.30/test/locale-mbwc/dat_iswctype.c 2008-12-02 09:15:35.191305000 -0800
2494@@ -240,7 +240,7 @@
2495 { { 0x007B, "cntrl" }, { 0,1,0 } },
2496 { { 0x007E, "cntrl" }, { 0,1,0 } },
2497 { { 0x007F, "cntrl" }, { 0,0,0 } },
2498- { { 0x0080, "cntrl" }, { 0,0,0 } },
2499+ { { 0x0080, "cntrl" }, { 0,1,0 } },
2500 { { 0x0000, "digit" }, { 0,1,0 } },
2501 { { 0x001F, "digit" }, { 0,1,0 } },
2502 { { 0x0020, "digit" }, { 0,1,0 } },
2503diff -Naur uClibc-0.9.30.orig/utils/Makefile.in uClibc-0.9.30/utils/Makefile.in
2504--- uClibc-0.9.30.orig/utils/Makefile.in 2008-11-09 05:10:50.000000000 -0800
2505+++ uClibc-0.9.30/utils/Makefile.in 2009-01-14 07:54:12.372155000 -0800
2506@@ -8,7 +8,10 @@
2507 CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) -B$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
2508
2509 CFLAGS-utils-common := -I$(top_srcdir)ldso/include -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO)
2510+CFLAGS-utils-shared :=
2511+ifeq ($(UCLIBC_BUILD_PIE),y)
2512 CFLAGS-utils-shared := $(PIEFLAG) $(LDPIEFLAG)
2513+endif
2514
2515 CFLAGS-ldconfig := $(CFLAGS-utils-common)
2516
Note: See TracBrowser for help on using the repository browser.