1 The gcc-4.4 documentation still suggests that the compiler will automatically
2 do format checking for the standard format function prototypes, but it is now
3 also barking warnings suggesting that we add them for this lot too. So added.
5 Signed-off-by: Ron Lee <ron@debian.org>
7 include/stdio.h | 15 ++++++++++-----
8 1 files changed, 10 insertions(+), 5 deletions(-)
10 Index: uClibc-0.9.30.1/include/stdio.h
11 ===================================================================
12 --- uClibc-0.9.30.1.orig/include/stdio.h 2008-09-30 14:17:04.000000000 +0200
13 +++ uClibc-0.9.30.1/include/stdio.h 2009-07-06 21:16:14.000000000 +0200
15 extern int printf (__const char *__restrict __format, ...);
16 /* Write formatted output to S. */
17 extern int sprintf (char *__restrict __s,
18 - __const char *__restrict __format, ...) __THROW;
19 + __const char *__restrict __format, ...)
20 + __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
22 /* Write formatted output to S from argument list ARG.
25 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
26 /* Write formatted output to S from argument list ARG. */
27 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
28 - __gnuc_va_list __arg) __THROW;
29 + __gnuc_va_list __arg)
30 + __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
33 #if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
35 This function is a possible cancellation point and therefore not
36 marked with __THROW. */
37 extern int fscanf (FILE *__restrict __stream,
38 - __const char *__restrict __format, ...) __wur;
39 + __const char *__restrict __format, ...)
40 + __attribute__ ((__format__ (__scanf__, 2, 3))) __wur;
41 /* Read formatted input from stdin.
43 This function is a possible cancellation point and therefore not
44 marked with __THROW. */
45 -extern int scanf (__const char *__restrict __format, ...) __wur;
46 +extern int scanf (__const char *__restrict __format, ...)
47 + __attribute__ ((__format__ (__scanf__, 1, 2))) __wur;
48 /* Read formatted input from S. */
49 extern int sscanf (__const char *__restrict __s,
50 - __const char *__restrict __format, ...) __THROW;
51 + __const char *__restrict __format, ...)
52 + __THROW __attribute__ ((__format__ (__scanf__, 2, 3)));
56 gcc-4.4 now barks about this, so appease it.
58 Signed-off-by: Ron Lee <ron@debian.org>
60 ldso/ldso/arm/dl-sysdep.h | 3 ++-
61 1 files changed, 2 insertions(+), 1 deletions(-)
63 diff --git a/ldso/ldso/arm/dl-sysdep.h b/ldso/ldso/arm/dl-sysdep.h
64 index 5191dd7..75c58b0 100644
65 --- a/ldso/ldso/arm/dl-sysdep.h
66 +++ b/ldso/ldso/arm/dl-sysdep.h
67 @@ -98,11 +98,12 @@ elf_machine_dynamic (void)
71 +extern void __dl_start __asm__ ("_dl_start");
73 /* Return the run-time load address of the shared object. */
74 static __always_inline Elf32_Addr __attribute__ ((unused))
75 elf_machine_load_address (void)
77 - extern void __dl_start __asm__ ("_dl_start");
78 Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
79 Elf32_Addr pcrel_addr;
80 #if defined __OPTIMIZE__ && !defined __thumb__
81 usage() is also made static in answer to warnings about no prototype.
82 In __pthread_manager_event() we also have to drop the return statement,
83 else gcc will in turn complain about a non-returning function having one.
85 Signed-off-by: Ron Lee <ron@debian.org>
87 libpthread/linuxthreads.old/manager.c | 4 ++--
88 utils/ldconfig.c | 4 ++--
89 2 files changed, 4 insertions(+), 4 deletions(-)
91 diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c
92 index 19be92f..0617d7d 100644
93 --- a/libpthread/linuxthreads.old/manager.c
94 +++ b/libpthread/linuxthreads.old/manager.c
95 @@ -248,7 +248,7 @@ int attribute_noreturn __pthread_manager(void *arg)
99 -int __pthread_manager_event(void *arg)
100 +int attribute_noreturn __pthread_manager_event(void *arg)
102 /* If we have special thread_self processing, initialize it. */
103 #ifdef INIT_THREAD_SELF
104 @@ -260,7 +260,7 @@ int __pthread_manager_event(void *arg)
105 /* Free it immediately. */
106 __pthread_unlock (THREAD_GETMEM((&__pthread_manager_thread), p_lock));
108 - return __pthread_manager(arg);
109 + __pthread_manager(arg);
112 /* Process creation */
113 diff --git a/utils/ldconfig.c b/utils/ldconfig.c
114 index c52b170..f6aec5c 100644
115 --- a/utils/ldconfig.c
116 +++ b/utils/ldconfig.c
117 @@ -114,7 +114,7 @@ static void warnx(const char *s, ...)
118 fprintf(stderr, "\n");
121 -static void err(int errnum, const char *s, ...)
122 +static void attribute_noreturn err(int errnum, const char *s, ...)
126 @@ -783,7 +783,7 @@ void cache_print(void)
131 +static void attribute_noreturn usage(void)
134 #ifdef __LDSO_CACHE_SUPPORT__
136 This keeps gcc-4.4 from nagging that they have no prototypes.
138 Signed-off-by: Ron Lee <ron@debian.org>
140 utils/ldconfig.c | 16 ++++++++--------
141 utils/ldd.c | 12 ++++++------
142 utils/readsoname2.c | 2 +-
143 3 files changed, 15 insertions(+), 15 deletions(-)
145 diff --git a/utils/ldconfig.c b/utils/ldconfig.c
146 index f6aec5c..3bd7cee 100644
147 --- a/utils/ldconfig.c
148 +++ b/utils/ldconfig.c
149 @@ -173,8 +173,8 @@ static char *xstrdup(const char *str)
150 #define readsonameXX readsoname64
151 #define __ELF_NATIVE_CLASS 64
152 #include "readsoname2.c"
153 -char *readsoname(char *name, FILE *infile, int expected_type,
154 - int *type, int elfclass)
155 +static char *readsoname(char *name, FILE *infile, int expected_type,
156 + int *type, int elfclass)
160 @@ -206,8 +206,8 @@ char *readsoname(char *name, FILE *infile, int expected_type,
161 * If the expected, actual/deduced types missmatch we display a warning
162 * and use the actual/deduced type.
164 -char *is_shlib(const char *dir, const char *name, int *type,
165 - int *islink, int expected_type)
166 +static char *is_shlib(const char *dir, const char *name, int *type,
167 + int *islink, int expected_type)
171 @@ -323,7 +323,7 @@ char *is_shlib(const char *dir, const char *name, int *type,
174 /* update the symlink to new library */
175 -void link_shlib(const char *dir, const char *file, const char *so)
176 +static void link_shlib(const char *dir, const char *file, const char *so)
179 char libname[BUFFER_SIZE];
180 @@ -380,7 +380,7 @@ void link_shlib(const char *dir, const char *file, const char *so)
183 /* figure out which library is greater */
184 -int libcmp(char *p1, char *p2)
185 +static int libcmp(char *p1, char *p2)
188 if (isdigit(*p1) && isdigit(*p2)) {
189 @@ -412,7 +412,7 @@ struct lib {
192 /* update all shared library links in a directory */
193 -void scan_dir(const char *rawname)
194 +static void scan_dir(const char *rawname)
198 @@ -554,7 +554,7 @@ void cache_write(void)
201 /* return the list of system-specific directories */
202 -char *get_extpath(void)
203 +static char *get_extpath(void)
205 char *res = NULL, *cp;
207 diff --git a/utils/ldd.c b/utils/ldd.c
208 index 1f1dc25..02b37f1 100644
211 @@ -214,7 +214,7 @@ static char *elf_find_rpath(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic)
215 -int check_elf_header(ElfW(Ehdr) *const ehdr)
216 +static int check_elf_header(ElfW(Ehdr) *const ehdr)
218 if (!ehdr || *(uint32_t*)ehdr != ELFMAG_U32
219 || ehdr->e_ident[EI_CLASS] != ELFCLASSM
220 @@ -249,7 +249,7 @@ int check_elf_header(ElfW(Ehdr) *const ehdr)
221 static caddr_t cache_addr = NULL;
222 static size_t cache_size = 0;
225 +static int map_cache(void)
229 @@ -306,7 +306,7 @@ fail:
233 -int unmap_cache(void)
234 +static int unmap_cache(void)
236 if (cache_addr == NULL || cache_addr == (caddr_t) - 1)
238 @@ -372,8 +372,8 @@ static void search_for_named_library(char *name, char *result,
242 -void locate_library_file(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic, int is_suid,
243 - struct library *lib)
244 +static void locate_library_file(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic,
245 + int is_suid, struct library *lib)
249 @@ -608,7 +608,7 @@ static struct library *find_elf_interpreter(ElfW(Ehdr) *ehdr)
251 #warning "There may be two warnings here about vfork() clobbering, ignore them"
253 -int find_dependancies(char *filename)
254 +static int find_dependancies(char *filename)
258 diff --git a/utils/readsoname2.c b/utils/readsoname2.c
259 index a74b46a..5cda331 100644
260 --- a/utils/readsoname2.c
261 +++ b/utils/readsoname2.c
263 -char *readsonameXX(char *name, FILE *infile, int expected_type, int *type)
264 +static char *readsonameXX(char *name, FILE *infile, int expected_type, int *type)
269 This cuts down on a lot of noise from gcc-4.4
271 Signed-off-by: Ron Lee <ron@debian.org>
273 libc/misc/elf/dl-support.c | 5 ++---
274 libc/sysdeps/linux/arm/aeabi_assert.c | 5 ++---
275 libc/sysdeps/linux/arm/aeabi_atexit.c | 4 ++--
276 libc/sysdeps/linux/arm/aeabi_errno_addr.c | 4 ++--
277 libc/sysdeps/linux/arm/aeabi_localeconv.c | 4 ++--
278 libc/sysdeps/linux/arm/aeabi_memclr.c | 4 ++--
279 libc/sysdeps/linux/arm/aeabi_memcpy.c | 4 ++--
280 libc/sysdeps/linux/arm/aeabi_memmove.c | 4 ++--
281 libc/sysdeps/linux/arm/aeabi_memset.c | 4 ++--
282 libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c | 15 ++++++---------
283 libc/sysdeps/linux/arm/find_exidx.c | 4 ++--
284 .../linuxthreads.old/sysdeps/arm/pt-machine.h | 4 ++--
285 utils/chroot_realpath.c | 3 +++
286 13 files changed, 31 insertions(+), 33 deletions(-)
288 diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c
289 index 3c1d853..4dd155e 100644
290 --- a/libc/misc/elf/dl-support.c
291 +++ b/libc/misc/elf/dl-support.c
293 ElfW(Phdr) *_dl_phdr;
298 -_dl_aux_init (ElfW(auxv_t) *av)
299 +void internal_function _dl_aux_init (ElfW(auxv_t) *av);
300 +void internal_function _dl_aux_init (ElfW(auxv_t) *av)
302 /* Get the program headers base address from the aux vect */
303 _dl_phdr = (ElfW(Phdr) *) av[AT_PHDR].a_un.a_val;
304 diff --git a/libc/sysdeps/linux/arm/aeabi_assert.c b/libc/sysdeps/linux/arm/aeabi_assert.c
305 index 53943ac..348ca9b 100644
306 --- a/libc/sysdeps/linux/arm/aeabi_assert.c
307 +++ b/libc/sysdeps/linux/arm/aeabi_assert.c
310 /* libc_hidden_proto(__assert) */
313 -__aeabi_assert (const char *assertion, const char *file,
315 +void __aeabi_assert(const char *assertion, const char *file, unsigned int line);
316 +void __aeabi_assert(const char *assertion, const char *file, unsigned int line)
318 __assert (assertion, file, line, NULL);
320 diff --git a/libc/sysdeps/linux/arm/aeabi_atexit.c b/libc/sysdeps/linux/arm/aeabi_atexit.c
321 index 4a7a6f1..ebb233b 100644
322 --- a/libc/sysdeps/linux/arm/aeabi_atexit.c
323 +++ b/libc/sysdeps/linux/arm/aeabi_atexit.c
324 @@ -24,8 +24,8 @@ libc_hidden_proto(__cxa_atexit)
325 /* Register a function to be called by exit or when a shared library
326 is unloaded. This routine is like __cxa_atexit, but uses the
327 calling sequence required by the ARM EABI. */
329 -__aeabi_atexit (void *arg, void (*func) (void *), void *d)
330 +int __aeabi_atexit (void *arg, void (*func) (void *), void *d);
331 +int __aeabi_atexit (void *arg, void (*func) (void *), void *d)
333 return __cxa_atexit (func, arg, d);
335 diff --git a/libc/sysdeps/linux/arm/aeabi_errno_addr.c b/libc/sysdeps/linux/arm/aeabi_errno_addr.c
336 index 09bdc1e..5e262a6 100644
337 --- a/libc/sysdeps/linux/arm/aeabi_errno_addr.c
338 +++ b/libc/sysdeps/linux/arm/aeabi_errno_addr.c
344 -__aeabi_errno_addr (void)
345 +volatile int * __aeabi_errno_addr (void);
346 +volatile int * __aeabi_errno_addr (void)
350 diff --git a/libc/sysdeps/linux/arm/aeabi_localeconv.c b/libc/sysdeps/linux/arm/aeabi_localeconv.c
351 index 6fa29bb..4c34f57 100644
352 --- a/libc/sysdeps/linux/arm/aeabi_localeconv.c
353 +++ b/libc/sysdeps/linux/arm/aeabi_localeconv.c
356 /* libc_hidden_proto(localeconv) */
359 -__aeabi_localeconv (void)
360 +struct lconv * __aeabi_localeconv (void);
361 +struct lconv * __aeabi_localeconv (void)
363 return localeconv ();
365 diff --git a/libc/sysdeps/linux/arm/aeabi_memclr.c b/libc/sysdeps/linux/arm/aeabi_memclr.c
366 index c0f9021..9125bac 100644
367 --- a/libc/sysdeps/linux/arm/aeabi_memclr.c
368 +++ b/libc/sysdeps/linux/arm/aeabi_memclr.c
371 /* Clear memory. Can't alias to bzero because it's not defined in the
372 same translation unit. */
374 -__aeabi_memclr (void *dest, size_t n)
375 +void __aeabi_memclr (void *dest, size_t n);
376 +void __aeabi_memclr (void *dest, size_t n)
380 diff --git a/libc/sysdeps/linux/arm/aeabi_memcpy.c b/libc/sysdeps/linux/arm/aeabi_memcpy.c
381 index 83eac0b..604c139 100644
382 --- a/libc/sysdeps/linux/arm/aeabi_memcpy.c
383 +++ b/libc/sysdeps/linux/arm/aeabi_memcpy.c
385 /* Copy memory like memcpy, but no return value required. Can't alias
386 to memcpy because it's not defined in the same translation
389 -__aeabi_memcpy (void *dest, const void *src, size_t n)
390 +void __aeabi_memcpy (void *dest, const void *src, size_t n);
391 +void __aeabi_memcpy (void *dest, const void *src, size_t n)
393 memcpy (dest, src, n);
395 diff --git a/libc/sysdeps/linux/arm/aeabi_memmove.c b/libc/sysdeps/linux/arm/aeabi_memmove.c
396 index 164d72b..7ecfbb7 100644
397 --- a/libc/sysdeps/linux/arm/aeabi_memmove.c
398 +++ b/libc/sysdeps/linux/arm/aeabi_memmove.c
400 /* Copy memory like memmove, but no return value required. Can't
401 alias to memmove because it's not defined in the same translation
404 -__aeabi_memmove (void *dest, const void *src, size_t n)
405 +void __aeabi_memmove (void *dest, const void *src, size_t n);
406 +void __aeabi_memmove (void *dest, const void *src, size_t n)
408 memmove (dest, src, n);
410 diff --git a/libc/sysdeps/linux/arm/aeabi_memset.c b/libc/sysdeps/linux/arm/aeabi_memset.c
411 index f1c366f..a37e21f 100644
412 --- a/libc/sysdeps/linux/arm/aeabi_memset.c
413 +++ b/libc/sysdeps/linux/arm/aeabi_memset.c
416 /* Set memory like memset, but different argument order and no return
419 -__aeabi_memset (void *dest, size_t n, int c)
420 +void __aeabi_memset (void *dest, size_t n, int c);
421 +void __aeabi_memset (void *dest, size_t n, int c)
425 diff --git a/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c b/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
426 index e657d38..4544dc7 100644
427 --- a/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
428 +++ b/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
435 -__aeabi_unwind_cpp_pr0 (void)
436 +attribute_hidden void __aeabi_unwind_cpp_pr0 (void);
437 +attribute_hidden void __aeabi_unwind_cpp_pr0 (void)
443 -__aeabi_unwind_cpp_pr1 (void)
444 +attribute_hidden void __aeabi_unwind_cpp_pr1 (void);
445 +attribute_hidden void __aeabi_unwind_cpp_pr1 (void)
451 -__aeabi_unwind_cpp_pr2 (void)
452 +attribute_hidden void __aeabi_unwind_cpp_pr2 (void);
453 +attribute_hidden void __aeabi_unwind_cpp_pr2 (void)
456 diff --git a/libc/sysdeps/linux/arm/find_exidx.c b/libc/sysdeps/linux/arm/find_exidx.c
457 index 9e4f401..a16534b 100644
458 --- a/libc/sysdeps/linux/arm/find_exidx.c
459 +++ b/libc/sysdeps/linux/arm/find_exidx.c
460 @@ -65,8 +65,8 @@ find_exidx_callback (struct dl_phdr_info * info, size_t size, void * ptr)
462 /* Find the exception index table containing PC. */
465 -__gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount)
466 +_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount);
467 +_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount)
469 struct unw_eh_callback_data data;
471 diff --git a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
472 index 14eb6f6..583eb68 100644
473 --- a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
474 +++ b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
476 time; let's hope nobody tries to use one. */
478 /* Spinlock implementation; required. */
480 -testandset (int *spinlock)
481 +PT_EI long int testandset (int *spinlock);
482 +PT_EI long int testandset (int *spinlock)
484 register unsigned int ret;
486 diff --git a/utils/chroot_realpath.c b/utils/chroot_realpath.c
487 index 82ccbf6..d912a06 100644
488 --- a/utils/chroot_realpath.c
489 +++ b/utils/chroot_realpath.c
491 #define MAX_READLINKS 32
493 char *chroot_realpath(const char *chroot, const char *path,
494 + char resolved_path[]);
496 +char *chroot_realpath(const char *chroot, const char *path,
497 char resolved_path[])
499 char copy_path[PATH_MAX];
501 Once again all of these reduce the noise from gcc-4.4.
502 Replaces a few more (USE_TLS && HAVE___THREAD) with USE___THREAD while we need
503 to mess with them for this anyhow.
505 Signed-off-by: Ron Lee <ron@debian.org>
507 libc/misc/fnmatch/fnmatch.c | 2 +-
508 libpthread/linuxthreads.old/cancel.c | 6 +++---
509 libpthread/linuxthreads.old/libc_pthread_init.c | 4 ++--
510 libpthread/linuxthreads.old/pthread.c | 2 +-
511 libpthread/linuxthreads.old/ptlongjmp.c | 4 ++--
512 libpthread/linuxthreads.old/specific.c | 2 +-
513 .../linuxthreads.old_db/td_thr_tls_get_addr.c | 2 +-
514 7 files changed, 11 insertions(+), 11 deletions(-)
516 Index: uClibc-0.9.30.1/libc/misc/fnmatch/fnmatch.c
517 ===================================================================
518 --- uClibc-0.9.30.1.orig/libc/misc/fnmatch/fnmatch.c 2008-06-01 22:44:48.000000000 +0200
519 +++ uClibc-0.9.30.1/libc/misc/fnmatch/fnmatch.c 2009-07-06 21:16:29.000000000 +0200
521 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
525 +#ifdef HAVE_CONFIG_H
529 Index: uClibc-0.9.30.1/libpthread/linuxthreads.old/cancel.c
530 ===================================================================
531 --- uClibc-0.9.30.1.orig/libpthread/linuxthreads.old/cancel.c 2008-07-23 13:23:36.000000000 +0200
532 +++ uClibc-0.9.30.1/libpthread/linuxthreads.old/cancel.c 2009-07-06 21:16:29.000000000 +0200
535 #ifdef _STACK_GROWS_DOWN
536 # define FRAME_LEFT(frame, other) ((char *) frame >= (char *) other)
537 -#elif _STACK_GROWS_UP
538 +#elif defined _STACK_GROWS_UP
539 # define FRAME_LEFT(frame, other) ((char *) frame <= (char *) other)
541 # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
542 @@ -193,10 +193,10 @@
544 for (c = THREAD_GETMEM(self, p_cleanup); c != NULL; c = c->__prev)
546 -#if _STACK_GROWS_DOWN
547 +#ifdef _STACK_GROWS_DOWN
548 if ((char *) c <= currentframe)
550 -#elif _STACK_GROWS_UP
551 +#elif defined _STACK_GROWS_UP
552 if ((char *) c >= currentframe)
555 Index: uClibc-0.9.30.1/libpthread/linuxthreads.old/libc_pthread_init.c
556 ===================================================================
557 --- uClibc-0.9.30.1.orig/libpthread/linuxthreads.old/libc_pthread_init.c 2008-05-20 10:47:51.000000000 +0200
558 +++ uClibc-0.9.30.1/libpthread/linuxthreads.old/libc_pthread_init.c 2009-07-06 21:17:10.000000000 +0200
561 /* Experimentally off - libc_hidden_proto(memcpy) */
563 -#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
564 +#if ! defined USE___THREAD && defined __UCLIBC_HAS_XLOCALE__
565 libc_hidden_proto(uselocale)
569 sizeof (__libc_pthread_functions));
572 -#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
573 +#if ! defined USE___THREAD && defined __UCLIBC_HAS_XLOCALE__
574 /* Initialize thread-locale current locale to point to the global one.
575 With __thread support, the variable's initializer takes care of this. */
576 uselocale (LC_GLOBAL_LOCALE);
577 Index: uClibc-0.9.30.1/libpthread/linuxthreads.old/pthread.c
578 ===================================================================
579 --- uClibc-0.9.30.1.orig/libpthread/linuxthreads.old/pthread.c 2008-10-03 15:59:52.000000000 +0200
580 +++ uClibc-0.9.30.1/libpthread/linuxthreads.old/pthread.c 2009-07-06 21:17:53.000000000 +0200
583 struct pthread_functions __pthread_functions =
585 -#if !(USE_TLS && HAVE___THREAD)
586 +#ifndef USE___THREAD
587 .ptr_pthread_internal_tsd_set = __pthread_internal_tsd_set,
588 .ptr_pthread_internal_tsd_get = __pthread_internal_tsd_get,
589 .ptr_pthread_internal_tsd_address = __pthread_internal_tsd_address,
590 Index: uClibc-0.9.30.1/libpthread/linuxthreads.old/ptlongjmp.c
591 ===================================================================
592 --- uClibc-0.9.30.1.orig/libpthread/linuxthreads.old/ptlongjmp.c 2006-11-09 09:11:33.000000000 +0100
593 +++ uClibc-0.9.30.1/libpthread/linuxthreads.old/ptlongjmp.c 2009-07-06 21:16:29.000000000 +0200
595 c != NULL && _JMPBUF_UNWINDS(target, c);
598 -#if _STACK_GROWS_DOWN
599 +#ifdef _STACK_GROWS_DOWN
600 if ((char *) c <= currentframe)
605 -#elif _STACK_GROWS_UP
606 +#elif defined _STACK_GROWS_UP
607 if ((char *) c >= currentframe)
610 Index: uClibc-0.9.30.1/libpthread/linuxthreads.old/specific.c
611 ===================================================================
612 --- uClibc-0.9.30.1.orig/libpthread/linuxthreads.old/specific.c 2008-05-20 10:47:51.000000000 +0200
613 +++ uClibc-0.9.30.1/libpthread/linuxthreads.old/specific.c 2009-07-06 21:18:28.000000000 +0200
615 __pthread_unlock(THREAD_GETMEM(self, p_lock));
618 -#if !(USE_TLS && HAVE___THREAD)
619 +#ifndef USE___THREAD
621 /* Thread-specific data for libc. */
623 Index: uClibc-0.9.30.1/libpthread/linuxthreads.old_db/td_thr_tls_get_addr.c
624 ===================================================================
625 --- uClibc-0.9.30.1.orig/libpthread/linuxthreads.old_db/td_thr_tls_get_addr.c 2005-11-22 22:32:06.000000000 +0100
626 +++ uClibc-0.9.30.1/libpthread/linuxthreads.old_db/td_thr_tls_get_addr.c 2009-07-06 21:16:29.000000000 +0200
628 size_t offset __attribute__ ((unused)),
629 void **address __attribute__ ((unused)))
634 union dtv pdtv, *dtvp;
636 elf.h needs __BYTE_ORDER, and s_scalbn.c needs {LONG,INT}_MAX.
637 shm.c complains about no prototypes for shm_{open,unlink} without its header.
639 Signed-off-by: Ron Lee <ron@debian.org>
642 libm/s_scalbn.c | 1 +
644 3 files changed, 3 insertions(+), 0 deletions(-)
646 diff --git a/include/elf.h b/include/elf.h
647 index 0129f1e..16a6972 100644
650 @@ -28,6 +28,7 @@ extern "C" {
651 /* Standard ELF types. */
656 /* Type for a 16-bit quantity. */
657 typedef uint16_t Elf32_Half;
658 diff --git a/libm/s_scalbn.c b/libm/s_scalbn.c
659 index c534467..47983b0 100644
660 --- a/libm/s_scalbn.c
661 +++ b/libm/s_scalbn.c
665 #include "math_private.h"
669 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
671 gcc-4.4 barks about that.
673 Signed-off-by: Ron Lee <ron@debian.org>
675 utils/ldconfig.c | 4 ++--
676 1 files changed, 2 insertions(+), 2 deletions(-)
678 diff --git a/utils/ldconfig.c b/utils/ldconfig.c
679 index 3bd7cee..505316b 100644
680 --- a/utils/ldconfig.c
681 +++ b/utils/ldconfig.c
682 @@ -127,14 +127,14 @@ static void attribute_noreturn err(int errnum, const char *s, ...)
684 static void vperror_msg(const char *s, va_list p)
694 - fprintf(stderr, "%s%s\n", s, strerror(err));
695 + fprintf(stderr, "%s%s\n", s, strerror(e));
698 static void warn(const char *s, ...)
700 Signed-off-by: Ron Lee <ron@debian.org>
702 utils/ldconfig.c | 10 +++++-----
704 2 files changed, 7 insertions(+), 7 deletions(-)
706 diff --git a/utils/ldconfig.c b/utils/ldconfig.c
707 index 505316b..139b5f9 100644
708 --- a/utils/ldconfig.c
709 +++ b/utils/ldconfig.c
710 @@ -558,18 +558,18 @@ static char *get_extpath(void)
712 char *res = NULL, *cp;
716 char realconffile[BUFFER_SIZE];
718 if (!chroot_realpath(chroot_dir, conffile, realconffile))
721 if ((file = fopen(realconffile, "r")) != NULL) {
722 - fstat(fileno(file), &stat);
723 - res = xmalloc(stat.st_size + 1);
724 - fread(res, 1, stat.st_size, file);
725 + fstat(fileno(file), &st);
726 + res = xmalloc(st.st_size + 1);
727 + fread(res, 1, st.st_size, file);
729 - res[stat.st_size] = '\0';
730 + res[st.st_size] = '\0';
732 /* convert comments fo spaces */
733 for (cp = res; *cp; /*nada */ ) {
734 diff --git a/utils/ldd.c b/utils/ldd.c
735 index 02b37f1..e7a94cb 100644
738 @@ -683,8 +683,8 @@ foo:
739 && ehdr->e_ident[EI_VERSION] == EV_CURRENT
740 && MATCH_MACHINE(ehdr->e_machine))
742 - struct stat statbuf;
743 - if (stat(interp->path, &statbuf) == 0 && S_ISREG(statbuf.st_mode)) {
745 + if (stat(interp->path, &st) == 0 && S_ISREG(st.st_mode)) {
748 static const char *const environment[] = {
750 Signed-off-by: Ron Lee <ron@debian.org>
752 libpthread/linuxthreads.old/manager.c | 4 ++--
753 1 files changed, 2 insertions(+), 2 deletions(-)
755 diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c
756 index 0617d7d..88c9253 100644
757 --- a/libpthread/linuxthreads.old/manager.c
758 +++ b/libpthread/linuxthreads.old/manager.c
759 @@ -578,9 +578,9 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
760 /* See whether the TD_CREATE event bit is set in any of the
762 int idx = __td_eventword (TD_CREATE);
763 - uint32_t mask = __td_eventmask (TD_CREATE);
764 + uint32_t m = __td_eventmask (TD_CREATE);
766 - if ((mask & (__pthread_threads_events.event_bits[idx]
767 + if ((m & (__pthread_threads_events.event_bits[idx]
768 | event_maskp->event_bits[idx])) != 0)
770 /* Lock the mutex the child will use now so that it will stop. */
772 Signed-off-by: Ron Lee <ron@debian.org>
774 utils/chroot_realpath.c | 12 ++++++------
775 1 files changed, 6 insertions(+), 6 deletions(-)
777 diff --git a/utils/chroot_realpath.c b/utils/chroot_realpath.c
778 index d912a06..0be57bf 100644
779 --- a/utils/chroot_realpath.c
780 +++ b/utils/chroot_realpath.c
783 #define MAX_READLINKS 32
785 -char *chroot_realpath(const char *chroot, const char *path,
786 +char *chroot_realpath(const char *root, const char *path,
787 char resolved_path[]);
789 -char *chroot_realpath(const char *chroot, const char *path,
790 +char *chroot_realpath(const char *root, const char *path,
791 char resolved_path[])
793 char copy_path[PATH_MAX];
794 @@ -41,13 +41,13 @@ char *chroot_realpath(const char *chroot, const char *path,
798 - if (chroot == NULL || *chroot == '\0' ||
799 - (*chroot == '/' && chroot[1] == '\0')) {
800 + if (root == NULL || *root == '\0' ||
801 + (*root == '/' && root[1] == '\0')) {
802 strcpy(resolved_path, path);
803 return resolved_path;
806 - chroot_len = strlen(chroot);
807 + chroot_len = strlen(root);
809 if (chroot_len + strlen(path) >= PATH_MAX - 3) {
810 errno = ENAMETOOLONG;
811 @@ -60,7 +60,7 @@ char *chroot_realpath(const char *chroot, const char *path,
812 max_path = copy_path + PATH_MAX - chroot_len - 3;
814 /* Start with the chroot path. */
815 - strcpy(new_path, chroot);
816 + strcpy(new_path, root);
817 new_path += chroot_len;
818 while (*new_path == '/' && new_path > got_path)
821 Signed-off-by: Ron Lee <ron@debian.org>
823 ldso/ldso/dl-elf.c | 4 +++-
824 ldso/ldso/dl-startup.c | 3 ++-
825 libc/inet/getaddrinfo.c | 9 ++++++---
826 3 files changed, 11 insertions(+), 5 deletions(-)
828 Index: uClibc-0.9.30.1/ldso/ldso/dl-elf.c
829 ===================================================================
830 --- uClibc-0.9.30.1.orig/ldso/ldso/dl-elf.c 2008-11-18 15:01:35.000000000 +0100
831 +++ uClibc-0.9.30.1/ldso/ldso/dl-elf.c 2009-07-06 21:20:03.000000000 +0200
833 ElfW(Addr) relro_addr = 0;
834 size_t relro_size = 0;
837 DL_LOADADDR_TYPE lib_loadaddr;
838 DL_INIT_LOADADDR_EXTRA_DECLS
840 Index: uClibc-0.9.30.1/ldso/ldso/dl-startup.c
841 ===================================================================
842 --- uClibc-0.9.30.1.orig/ldso/ldso/dl-startup.c 2008-05-30 16:22:26.000000000 +0200
843 +++ uClibc-0.9.30.1/ldso/ldso/dl-startup.c 2009-07-06 21:20:03.000000000 +0200
845 struct elf_resolve *tpnt = &tpnt_tmp;
846 ElfW(auxv_t) auxvt[AT_EGID + 1];
850 /* WARNING! -- we cannot make _any_ funtion calls until we have
851 * taken care of fixing up our own relocations. Making static
852 Index: uClibc-0.9.30.1/libc/inet/getaddrinfo.c
853 ===================================================================
854 --- uClibc-0.9.30.1.orig/libc/inet/getaddrinfo.c 2009-02-26 13:49:14.000000000 +0100
855 +++ uClibc-0.9.30.1/libc/inet/getaddrinfo.c 2009-07-06 21:20:03.000000000 +0200
858 if (scope_delim != NULL) {
859 int try_numericscope = 0;
860 - if (IN6_IS_ADDR_LINKLOCAL(at->addr) || IN6_IS_ADDR_MC_LINKLOCAL(at->addr)) {
861 + uint32_t *a32 = (uint32_t*)at->addr;
862 + if (IN6_IS_ADDR_LINKLOCAL(a32) || IN6_IS_ADDR_MC_LINKLOCAL(at->addr)) {
863 at->scopeid = if_nametoindex(scope_delim + 1);
864 if (at->scopeid == 0)
865 try_numericscope = 1;
868 if (req->ai_family == 0 || req->ai_family == AF_INET) {
869 atr->family = AF_INET;
870 - if ((req->ai_flags & AI_PASSIVE) == 0)
871 - *(uint32_t*)atr->addr = htonl(INADDR_LOOPBACK);
872 + if ((req->ai_flags & AI_PASSIVE) == 0) {
873 + uint32_t *a = (uint32_t*)atr->addr;
874 + *a = htonl(INADDR_LOOPBACK);
879 From 8ee834680d39677a60e26a0de4ece2f0c1ebbde2 Mon Sep 17 00:00:00 2001
880 From: Ron <ron@debian.org>
881 Date: Sat, 27 Jun 2009 04:44:27 +0930
882 Subject: [PATCH] Avoid warnings about shifting more bits than we have
884 The test here is a constant expression and will compile out.
885 For platforms that don't need the shift the code gets slightly smaller
886 and simpler, for those that do the result is unchanged.
888 Signed-off-by: Ron Lee <ron@debian.org>
889 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
891 libc/sysdeps/linux/arm/posix_fadvise.c | 6 ++++--
892 1 files changed, 4 insertions(+), 2 deletions(-)
894 --- a/libc/sysdeps/linux/arm/posix_fadvise.c
895 +++ b/libc/sysdeps/linux/arm/posix_fadvise.c
897 #include <sys/syscall.h>
899 #if defined __NR_arm_fadvise64_64
901 +#define HIGH_BITS(x) (sizeof(x) > 4 ? (x) >> 32 : 0)
903 /* This is for the ARM version of fadvise64_64 which swaps the params
904 * * about to avoid having ABI compat issues
908 INTERNAL_SYSCALL_DECL (err);
909 int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise,
910 - __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset),
911 - __LONG_LONG_PAIR ((long)(len >> 32), (long)len));
912 + __LONG_LONG_PAIR (HIGH_BITS(offset), (long)offset),
913 + __LONG_LONG_PAIR (HIGH_BITS(len), (long)len));
915 if (INTERNAL_SYSCALL_ERROR_P (ret, err))
916 return INTERNAL_SYSCALL_ERRNO (ret, err);