aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-08-06 09:04:49 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-08-06 11:37:20 +0000
commit6456133f3fb46ce389b47db2718dd50f5ec1ed60 (patch)
treefa12d8d1366aec85e2e59a88d0139e95538d22bc
parent3a138c7fc3c38433f75cf3d44a4a78d80a6da705 (diff)
downloadalpine_aports-6456133f3fb46ce389b47db2718dd50f5ec1ed60.tar.bz2
alpine_aports-6456133f3fb46ce389b47db2718dd50f5ec1ed60.tar.xz
alpine_aports-6456133f3fb46ce389b47db2718dd50f5ec1ed60.zip
main/libc0.9.32: new snapshot
has most of our fixes and fixes for new bugs
-rw-r--r--main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch45
-rw-r--r--main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch73
-rw-r--r--main/libc0.9.32/APKBUILD16
-rw-r--r--main/libc0.9.32/no-posix-spawn.patch24
-rw-r--r--main/libc0.9.32/uclibc-gcc-workaround.patch58
-rw-r--r--main/libc0.9.32/uclibc-lutimes.patch105
6 files changed, 125 insertions, 196 deletions
diff --git a/main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch b/main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch
new file mode 100644
index 0000000000..58acfb4234
--- /dev/null
+++ b/main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch
@@ -0,0 +1,45 @@
1From 80bcb7a4806b27397629cf2e6bcbb7e8a0c5db5b Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
3Date: Fri, 6 Aug 2010 11:29:38 +0300
4Subject: [PATCH] config parser: fix memory corruption
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9fgets will happily write over allocated area limits. Adjusted the
10buffer size according to how much is already read.
11
12Also increase the maximum default line length, as 80 is slightly
13small. It might be better if bb_get_chunk_with_continuation would
14reallocate the line buffer if it was not user given.
15
16Signed-off-by: Timo Teräs <timo.teras@iki.fi>
17---
18 libc/misc/internals/parse_config.c | 4 ++--
19 1 files changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/libc/misc/internals/parse_config.c b/libc/misc/internals/parse_config.c
22index cbb6ef7..8404d80 100644
23--- a/libc/misc/internals/parse_config.c
24+++ b/libc/misc/internals/parse_config.c
25@@ -60,7 +60,7 @@ static off_t bb_get_chunk_with_continuation(parser_t* parsr)
26 char *chp;
27
28 while (1) {
29- if (fgets(parsr->line + pos, parsr->line_len, parsr->fp) == NULL) {
30+ if (fgets(parsr->line + pos, parsr->line_len - pos, parsr->fp) == NULL) {
31 memset(parsr->line, 0, parsr->line_len);
32 pos = -1;
33 break;
34@@ -179,7 +179,7 @@ int attribute_hidden FAST_FUNC config_read(parser_t *parser, char ***tokens,
35 again:
36 if (parser->data == NULL) {
37 if (parser->line_len == 0)
38- parser->line_len = 81;
39+ parser->line_len = 161;
40 if (parser->data_len == 0)
41 parser->data_len += 1 + ntokens * sizeof(char *);
42 parser->data = realloc(parser->data,
43--
441.7.0.4
45
diff --git a/main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch b/main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch
new file mode 100644
index 0000000000..55edc51c9a
--- /dev/null
+++ b/main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch
@@ -0,0 +1,73 @@
1From ed8017b08bee868eb5ea11c0b57074875267a3f1 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
3Date: Fri, 6 Aug 2010 13:26:25 +0300
4Subject: [PATCH] nptl: fix calling convention for __pthread_mutex_cond_lock
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The assembly versions of pthread_cond_wait calls
10__pthread_mutex_cond_lock and __pthread_mutex_cond_lock_adjust
11using internal calling convention (which differs from default
12calling convention at least on x86). Thus these two functions
13must be defined with internal_function or the call sequence goes
14wrong.
15
16__pthread_mutex_cond_lock resides in
17sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c, but it does
18evil macro definitions and includes pthread_mutex_lock.c, so
19we need to add some extra kludge to pthread_mutex_lock.c to get
20the prototypes correctly.
21
22Signed-off-by: Timo Teräs <timo.teras@iki.fi>
23---
24 libpthread/nptl/pthreadP.h | 6 ++++--
25 libpthread/nptl/pthread_mutex_lock.c | 7 ++++++-
26 2 files changed, 10 insertions(+), 3 deletions(-)
27
28diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h
29index 85601d4..c45bd11 100644
30--- a/libpthread/nptl/pthreadP.h
31+++ b/libpthread/nptl/pthreadP.h
32@@ -414,8 +414,10 @@ extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex);
33 extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
34 extern int __pthread_mutex_lock_internal (pthread_mutex_t *__mutex)
35 attribute_hidden;
36-extern int __pthread_mutex_cond_lock (pthread_mutex_t *__mutex);
37-extern void __pthread_mutex_cond_lock_adjust (pthread_mutex_t *__mutex);
38+extern int __pthread_mutex_cond_lock (pthread_mutex_t *__mutex)
39+ attribute_hidden internal_function;
40+extern void __pthread_mutex_cond_lock_adjust (pthread_mutex_t *__mutex)
41+ attribute_hidden internal_function;
42 extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
43 extern int __pthread_mutex_unlock_internal (pthread_mutex_t *__mutex)
44 attribute_hidden;
45diff --git a/libpthread/nptl/pthread_mutex_lock.c b/libpthread/nptl/pthread_mutex_lock.c
46index 78b6671..77147db 100644
47--- a/libpthread/nptl/pthread_mutex_lock.c
48+++ b/libpthread/nptl/pthread_mutex_lock.c
49@@ -42,7 +42,11 @@ static int __pthread_mutex_lock_full (pthread_mutex_t *mutex)
50
51
52 int
53+#ifdef NO_INCR
54+attribute_hidden internal_function
55+#else
56 attribute_protected
57+#endif
58 __pthread_mutex_lock (
59 pthread_mutex_t *mutex)
60 {
61@@ -477,7 +481,8 @@ strong_alias (__pthread_mutex_lock, __pthread_mutex_lock_internal)
62
63
64 #ifdef NO_INCR
65-void attribute_protected
66+void
67+attribute_hidden internal_function
68 __pthread_mutex_cond_lock_adjust (
69 pthread_mutex_t *mutex)
70 {
71--
721.7.0.4
73
diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD
index bb3643117d..d594deeb06 100644
--- a/main/libc0.9.32/APKBUILD
+++ b/main/libc0.9.32/APKBUILD
@@ -1,9 +1,9 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2_abiver=0.9.32 2_abiver=0.9.32
3pkgname=libc$_abiver 3pkgname=libc$_abiver
4_gitver=1006300816 4_gitver=1008060645
5pkgver=${_abiver}_alpha0_git$_gitver 5pkgver=${_abiver}_alpha0_git$_gitver
6pkgrel=2 6pkgrel=0
7pkgdesc="C library for developing embedded Linux systems" 7pkgdesc="C library for developing embedded Linux systems"
8url=http://uclibc.org 8url=http://uclibc.org
9license="LGPL-2" 9license="LGPL-2"
@@ -18,10 +18,9 @@ _snapfile="$pkgname-$pkgver.tar.bz2"
18source="http://build.alpinelinux.org:8010/distfiles/$_snapfile 18source="http://build.alpinelinux.org:8010/distfiles/$_snapfile
19 compat-stack-guard.patch 19 compat-stack-guard.patch
20 uclibc-libm-pic.patch 20 uclibc-libm-pic.patch
21 uclibc-lutimes.patch
22 uclibc-resolv-tls.patch 21 uclibc-resolv-tls.patch
23 uclibc-gcc-workaround.patch 22 0001-config-parser-fix-memory-corruption.patch
24 no-posix-spawn.patch 23 0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch
25 uclibcconfig.x86 24 uclibcconfig.x86
26 uclibcconfig.i486 25 uclibcconfig.i486
27 " 26 "
@@ -98,12 +97,11 @@ utils() {
98 mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ 97 mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/
99} 98}
100 99
101md5sums="b7af86c013378888fbd345c47ad21c3a libc0.9.32-0.9.32_alpha0_git1006300816.tar.bz2 100md5sums="2b3935c370307b806320e78883f9b07c libc0.9.32-0.9.32_alpha0_git1008060645.tar.bz2
1024d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch 1014d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch
1032f9739a980be24a842c57516155c7885 uclibc-libm-pic.patch 1022f9739a980be24a842c57516155c7885 uclibc-libm-pic.patch
1044d0b8170e6580b47bf5775e65a6f081e uclibc-lutimes.patch
105d08831b452acdeaa3037525ee617edab uclibc-resolv-tls.patch 103d08831b452acdeaa3037525ee617edab uclibc-resolv-tls.patch
106a88b7f394c86dc7aa606c9e338e35515 uclibc-gcc-workaround.patch 104d351ca4e5c33f4a7a60d4f1d754db5c4 0001-config-parser-fix-memory-corruption.patch
107cb3bfda1619a04218282cd02e3cdb4da no-posix-spawn.patch 105653b046611f98c990f1b52a28968ece3 0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch
108e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.x86 106e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.x86
109e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.i486" 107e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.i486"
diff --git a/main/libc0.9.32/no-posix-spawn.patch b/main/libc0.9.32/no-posix-spawn.patch
deleted file mode 100644
index c87e564916..0000000000
--- a/main/libc0.9.32/no-posix-spawn.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1commit 177538eb191c297ac146c843ff68d80ecfe9a87b
2Author: Natanael Copa <ncopa@alpinelinux.org>
3Date: Fri Jul 30 07:51:45 2010 +0000
4
5 nptl: do not define _POSIX_SPAWN since its not implemented
6
7 Building things like vlc checks if _POSIX_SPAWN is defined. Since
8 posix_spawn is not implemented we dont define it.
9
10diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h b/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
11index 2550355..6fbdbb7 100644
12--- a/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
13+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
14@@ -143,8 +143,10 @@
15 /* We support spinlocks. */
16 #define _POSIX_SPIN_LOCKS 200809L
17
18+#if 0
19 /* The `spawn' function family is supported. */
20 #define _POSIX_SPAWN 200809L
21+#endif
22
23 /* We have POSIX timers. */
24 #define _POSIX_TIMERS 200809L
diff --git a/main/libc0.9.32/uclibc-gcc-workaround.patch b/main/libc0.9.32/uclibc-gcc-workaround.patch
deleted file mode 100644
index f698ecb79e..0000000000
--- a/main/libc0.9.32/uclibc-gcc-workaround.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
2To: uclibc@uclibc.org
3Subject: [PATCH] more workarounds for GCC PR32219
4Date: Wed, 30 Jun 2010 14:46:37 +0300
5Message-Id: <1277898397-10643-1-git-send-email-timo.teras@iki.fi>
6X-Mailer: git-send-email 1.7.0.4
7MIME-Version: 1.0
8X-BeenThere: uclibc@uclibc.org
9X-Mailman-Version: 2.1.12
10Precedence: list
11List-Id: "Discussion and development of uClibc \(the embedded C library\)"
12 <uclibc.uclibc.org>
13List-Unsubscribe: <http://lists.busybox.net/mailman/options/uclibc>,
14 <mailto:uclibc-request@uclibc.org?subject=unsubscribe>
15List-Archive: <http://lists.busybox.net/pipermail/uclibc>
16List-Post: <mailto:uclibc@uclibc.org>
17List-Help: <mailto:uclibc-request@uclibc.org?subject=help>
18List-Subscribe: <http://lists.busybox.net/mailman/listinfo/uclibc>,
19 <mailto:uclibc-request@uclibc.org?subject=subscribe>
20Content-Type: text/plain; charset="utf-8"
21Sender: uclibc-bounces@uclibc.org
22Errors-To: uclibc-bounces@uclibc.org
23
24Commit 2e53dd645d5348f207cec7f8595969dc566c5a55 workarounds GCC
25bug when accessing _locale_init and _stdio_init. We need the same
26fix for __errno_location and __h_errno_location otherwise we crash
27calling null with static and non-threaded builds.
28
29Signed-off-by: Timo Teräs <timo.teras@iki.fi>
30---
31 libc/misc/internals/__uClibc_main.c | 4 ++--
32 1 files changed, 2 insertions(+), 2 deletions(-)
33
34diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
35index 44d1620..e8c470b 100644
36--- a/libc/misc/internals/__uClibc_main.c
37+++ b/libc/misc/internals/__uClibc_main.c
38@@ -447,11 +447,11 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
39 * have resulted in errno being set nonzero, so set it to 0 before
40 * we call main.
41 */
42- if (likely(__errno_location!=NULL))
43+ if (likely(not_null_ptr(__errno_location)))
44 *(__errno_location()) = 0;
45
46 /* Set h_errno to 0 as well */
47- if (likely(__h_errno_location!=NULL))
48+ if (likely(not_null_ptr(__h_errno_location)))
49 *(__h_errno_location()) = 0;
50
51 #if defined HAVE_CLEANUP_JMP_BUF && defined __UCLIBC_HAS_THREADS_NATIVE__
52--
531.7.0.4
54
55_______________________________________________
56uClibc mailing list
57uClibc@uclibc.org
58http://lists.busybox.net/mailman/listinfo/uclibc
diff --git a/main/libc0.9.32/uclibc-lutimes.patch b/main/libc0.9.32/uclibc-lutimes.patch
deleted file mode 100644
index c9ec2aa475..0000000000
--- a/main/libc0.9.32/uclibc-lutimes.patch
+++ /dev/null
@@ -1,105 +0,0 @@
1From: Vladimir Zapolskiy <vzapolskiy@gmail.com>
2To: uclibc@uclibc.org
3Subject: [PATCH v2] lutimes: add lutimes support
4Date: Wed, 2 Jun 2010 10:27:16 +0400
5Message-Id: <1275460036-3289-1-git-send-email-vzapolskiy@gmail.com>
6X-Mailer: git-send-email 1.7.0.3
7In-Reply-To: <1275420197-32262-1-git-send-email-vzapolskiy@gmail.com>
8References: <1275420197-32262-1-git-send-email-vzapolskiy@gmail.com>
9Cc: Vladimir Zapolskiy <vzapolskiy@gmail.com>
10X-BeenThere: uclibc@uclibc.org
11X-Mailman-Version: 2.1.12
12Precedence: list
13List-Id: "Discussion and development of uClibc \(the embedded C library\)"
14 <uclibc.uclibc.org>
15List-Unsubscribe: <http://lists.busybox.net/mailman/options/uclibc>,
16 <mailto:uclibc-request@uclibc.org?subject=unsubscribe>
17List-Archive: <http://lists.busybox.net/pipermail/uclibc>
18List-Post: <mailto:uclibc@uclibc.org>
19List-Help: <mailto:uclibc-request@uclibc.org?subject=help>
20List-Subscribe: <http://lists.busybox.net/mailman/listinfo/uclibc>,
21 <mailto:uclibc-request@uclibc.org?subject=subscribe>
22MIME-Version: 1.0
23Content-Type: text/plain; charset="us-ascii"
24Content-Transfer-Encoding: 7bit
25Sender: uclibc-bounces@uclibc.org
26Errors-To: uclibc-bounces@uclibc.org
27
28This patch adds lutimes library call support.
29
30Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
31---
32 include/sys/time.h | 4 ++-
33 libc/sysdeps/linux/common/lutimes.c | 38 +++++++++++++++++++++++++++++++++++
34 2 files changed, 41 insertions(+), 1 deletions(-)
35 create mode 100644 libc/sysdeps/linux/common/lutimes.c
36
37diff --git a/include/sys/time.h b/include/sys/time.h
38index 33f5873..952e95a 100644
39--- a/include/sys/time.h
40+++ b/include/sys/time.h
41@@ -144,14 +144,16 @@ extern int utimes (__const char *__file, __const struct timeval __tvp[2])
42 __THROW __nonnull ((1));
43 libc_hidden_proto(utimes)
44
45-#if 0 /*def __USE_BSD*/
46+#ifdef __USE_BSD
47 /* Same as `utimes', but does not follow symbolic links. */
48 extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
49 __THROW __nonnull ((1));
50
51+#if 0
52 /* Same as `utimes', but takes an open file descriptor instead of a name. */
53 extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
54 #endif
55+#endif
56
57 #ifdef __USE_GNU
58 /* Change the access time of FILE relative to FD to TVP[0] and the
59diff --git a/libc/sysdeps/linux/common/lutimes.c b/libc/sysdeps/linux/common/lutimes.c
60new file mode 100644
61index 0000000..0b4a8ea
62--- /dev/null
63+++ b/libc/sysdeps/linux/common/lutimes.c
64@@ -0,0 +1,38 @@
65+/* vi: set sw=4 ts=4: */
66+/*
67+ * lutimes() implementation for uClibc
68+ *
69+ * Copyright (C) 2010 Vladimir Zapolskiy <vzapolskiy@gmail.com>
70+ *
71+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
72+ */
73+
74+#include <sys/syscall.h>
75+#include <time.h>
76+
77+#ifdef __NR_lutimes
78+_syscall2(int, lutimes, const char *, file, const struct timeval *, tvp)
79+#else
80+#include <sys/time.h>
81+#include <fcntl.h>
82+
83+int lutimes(const char *file, const struct timeval tvp[2])
84+{
85+ struct timespec ts[2];
86+
87+ if (tvp != NULL)
88+ {
89+ if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000
90+ || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000)
91+ {
92+ __set_errno(EINVAL);
93+ return -1;
94+ }
95+
96+ TIMEVAL_TO_TIMESPEC(&tvp[0], &ts[0]);
97+ TIMEVAL_TO_TIMESPEC(&tvp[1], &ts[1]);
98+ }
99+
100+ return utimensat(AT_FDCWD, file, tvp ? ts : NULL, AT_SYMLINK_NOFOLLOW);
101+}
102+#endif
103--
1041.7.0.3
105