summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoracoul <acoul@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-11-18 14:58:37 +0000
committeracoul <acoul@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-11-18 14:58:37 +0000
commit9ded36e8ac1c3f66ecc736399f4ac88381a5ea64 (patch)
tree36f98cb56900b7d8514ec4b0a198abe243dc1f90
parentd5e16218b99fd0274764aa4022c0b74ecae6145a (diff)
toolchain/uClibc: push some upstream patches for uClibc-0.9.31. should resolve isses of #8269
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24029 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-initialize_stdio_locking.patch33
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-attribute_optimize_fix.patch25
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch33
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-ctime_fix.patch86
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-enum_fix.patch20
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch (renamed from toolchain/uClibc/patches-0.9.31/902-Fix-use-after-free-bug-in-__dns_lookup.patch)0
6 files changed, 197 insertions, 0 deletions
diff --git a/toolchain/uClibc/patches-0.9.31/000-initialize_stdio_locking.patch b/toolchain/uClibc/patches-0.9.31/000-initialize_stdio_locking.patch
new file mode 100644
index 0000000000..6a32e5d7c0
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-initialize_stdio_locking.patch
@@ -0,0 +1,33 @@
+From d4ede2b0a4727c1f5236dd9308f09cbf7a39761a Mon Sep 17 00:00:00 2001
+From: Timo Teräs <timo.teras@iki.fi>
+Date: Tue, 13 Apr 2010 06:38:59 +0000
+Subject: linuxthreads.new: initialize stdio locking
+
+uClibc requires the threading library to enable locking for
+stdio, or the locking is not done at all.
+
+Signed-off-by: Timo Teräs <timo.teras@iki.fi>
+Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
+---
+diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
+index 6ae9a10..614cad1 100644
+--- a/libpthread/linuxthreads/pthread.c
++++ b/libpthread/linuxthreads/pthread.c
+@@ -613,6 +613,17 @@ static void pthread_initialize(void)
+ #ifdef USE_TLS
+ GL(dl_init_static_tls) = &__pthread_init_static_tls;
+ #endif
++
++ /* uClibc-specific stdio initialization for threads. */
++ {
++ FILE *fp;
++ _stdio_user_locking = 0; /* 2 if threading not initialized */
++ for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen) {
++ if (fp->__user_locking != 1) {
++ fp->__user_locking = 0;
++ }
++ }
++ }
+ }
+
+ void __pthread_initialize(void)
diff --git a/toolchain/uClibc/patches-0.9.31/000-upstream-attribute_optimize_fix.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-attribute_optimize_fix.patch
new file mode 100644
index 0000000000..841b5b7d6f
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-attribute_optimize_fix.patch
@@ -0,0 +1,25 @@
+From a115ee502fca8b1eb8ce327d764562d3ae669954 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Mon, 12 Apr 2010 13:09:25 +0000
+Subject: attribute_optimize: fix typo with args
+
+curious how 308f5c6e5fd56ea3d1a5512e34388aad788f1180 ever worked.. :P
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/include/libc-symbols.h b/include/libc-symbols.h
+index 2729d30..4615a6a 100644
+--- a/include/libc-symbols.h
++++ b/include/libc-symbols.h
+@@ -86,9 +86,9 @@
+ #endif
+
+ #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+-# define attribute_optimize(lvl) __attribute__ ((optimize(x)))
++# define attribute_optimize(x) __attribute__ ((optimize(x)))
+ #else
+-# define attribute_optimize(lvl)
++# define attribute_optimize(x)
+ #endif
+
+ #define attribute_unused __attribute__ ((unused))
diff --git a/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch
new file mode 100644
index 0000000000..b0715058da
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch
@@ -0,0 +1,33 @@
+From afd7606ca42a2586b8823c7bd1a4a7cfd2476e3b Mon Sep 17 00:00:00 2001
+From: Steven J. Magnani <steve@digidescorp.com>
+Date: Wed, 09 Jun 2010 14:02:21 +0000
+Subject: malloc-simple: Make calloc() return zeroed memory
+
+The 0.9.31 release included a change to malloc-simple to request
+uninitialized memory from noMMU kernels. Unfortunately, the corresponding
+calloc() code assumed that memory returned by malloc() was already zeroed,
+which leads to all kinds of nastiness.
+
+Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
+index 51da14a..914c89d 100644
+--- a/libc/stdlib/malloc-simple/alloc.c
++++ b/libc/stdlib/malloc-simple/alloc.c
+@@ -60,11 +60,10 @@ void * calloc(size_t nmemb, size_t lsize)
+ __set_errno(ENOMEM);
+ return NULL;
+ }
+- result=malloc(size);
+-#if 0
+- /* Standard unix mmap using /dev/zero clears memory so calloc
+- * doesn't need to actually zero anything....
+- */
++ result = malloc(size);
++
++#ifndef __ARCH_USE_MMU__
++ /* mmap'd with MAP_UNINITIALIZE, we have to blank memory ourselves */
+ if (result != NULL) {
+ memset(result, 0, size);
+ }
diff --git a/toolchain/uClibc/patches-0.9.31/000-upstream-ctime_fix.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-ctime_fix.patch
new file mode 100644
index 0000000000..668662c347
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-ctime_fix.patch
@@ -0,0 +1,86 @@
+From f6651fa449e1d4bbbb466b091f34e6752f6506f9 Mon Sep 17 00:00:00 2001
+From: David A Ramos <daramos@gustav.stanford.edu>
+Date: Tue, 27 Jul 2010 11:10:15 +0000
+Subject: Fix ctime() standard compliance bug
+
+fixes issue2209:
+ctime() was updated in 0.9.31 to call localtime_r() instead of
+localtime() to
+avoid using a static buffer. Unfortunately, this change replaces the
+static
+buffer (which is zeroed out on initialization) with an uninitialized
+local
+buffer.
+
+In the common case, this has no effect. However, with a sufficiently
+large
+time_t value, the value returned differs from that returned by
+asctime(localtime(t)), and thus violates the ANSI/ISO standard.
+
+An example input is (on a 64-bit machine):
+time_t t = 0x7ffffffffff6c600;
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
+index dfa8c0d..0d12bf3 100644
+--- a/libc/misc/time/time.c
++++ b/libc/misc/time/time.c
+@@ -479,6 +479,7 @@ char *ctime(const time_t *t)
+ * localtime's static buffer:
+ */
+ struct tm xtm;
++ memset(&xtm, 0, sizeof(xtm));
+
+ return asctime(localtime_r(t, &xtm));
+ }
+diff --git a/test/time/tst-ctime.c b/test/time/tst-ctime.c
+new file mode 100644
+index 0000000..91d827a
+--- a/dev/null
++++ b/test/time/tst-ctime.c
+@@ -0,0 +1,44 @@
++/* vi: set sw=4 ts=4: */
++/* testcase for ctime(3) with large time
++ * Copyright (C) 2010 David A Ramos <daramos@gustav.stanford.edu>
++ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <time.h>
++
++#define MAX_POSITIVE(type) (~0 & ~((type) 1 << (sizeof(type)*8 - 1)))
++
++int do_test(int argc, char **argv) {
++ char *correct = 0, *s;
++ int status;
++
++ /* need a very high positive number (e.g., max - 1024) */
++ time_t test = MAX_POSITIVE(time_t) - 1024;
++
++ s = asctime(localtime(&test));
++
++ if (s) {
++ // copy static buffer to heap
++ correct = malloc(strlen(s)+1);
++ strcpy(correct, s);
++ }
++
++ s = ctime(&test);
++
++ printf("ANSI:\t%suClibc:\t%s", correct, s);
++
++ if (s != correct && strcmp(correct, s))
++ status = EXIT_FAILURE;
++ else
++ status = EXIT_SUCCESS;
++
++ if (correct)
++ free(correct);
++
++ return status;
++}
++
++#include <test-skeleton.c>
diff --git a/toolchain/uClibc/patches-0.9.31/000-upstream-enum_fix.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-enum_fix.patch
new file mode 100644
index 0000000000..bac1a0d39e
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-enum_fix.patch
@@ -0,0 +1,20 @@
+From ac86be72f8b01ac3792737f4b67283541cf2c15b Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Tue, 27 Jul 2010 15:05:59 +0000
+Subject: remove trailing comma in enum
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/bits/confname.h b/libc/sysdeps/linux/common/bits/confname.h
+index ec4b72a..97ddd47 100644
+--- a/libc/sysdeps/linux/common/bits/confname.h
++++ b/libc/sysdeps/linux/common/bits/confname.h
+@@ -527,7 +527,7 @@ enum
+
+ _SC_THREAD_ROBUST_PRIO_INHERIT,
+ #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT
+- _SC_THREAD_ROBUST_PRIO_PROTECT,
++ _SC_THREAD_ROBUST_PRIO_PROTECT
+ #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT
+ };
+
diff --git a/toolchain/uClibc/patches-0.9.31/902-Fix-use-after-free-bug-in-__dns_lookup.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch
index c33614afd7..c33614afd7 100644
--- a/toolchain/uClibc/patches-0.9.31/902-Fix-use-after-free-bug-in-__dns_lookup.patch
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch