diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/uclibc/0001-avr32-add-varargs-handling-of-prctl-syscall.patch | 74 | ||||
-rw-r--r-- | main/uclibc/0002-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch | 87 | ||||
-rw-r--r-- | main/uclibc/0003-rpc-fix-typo-in-version-mismatch-msg.patch | 26 | ||||
-rw-r--r-- | main/uclibc/0004-fix-make-install_-host-utils.patch | 158 | ||||
-rw-r--r-- | main/uclibc/0005-host-utils-depend-on-headers.patch | 35 | ||||
-rw-r--r-- | main/uclibc/0006-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch (renamed from main/uclibc/fstatat-fix-32bit.patch) | 33 | ||||
-rw-r--r-- | main/uclibc/0007-Unbreak-build-for-sparc-on-some-config-s.patch | 42 | ||||
-rw-r--r-- | main/uclibc/0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch | 89 | ||||
-rw-r--r-- | main/uclibc/0009-libm-enable-log2f-and-exp2f.patch | 70 | ||||
-rw-r--r-- | main/uclibc/APKBUILD | 24 |
10 files changed, 624 insertions, 14 deletions
diff --git a/main/uclibc/0001-avr32-add-varargs-handling-of-prctl-syscall.patch b/main/uclibc/0001-avr32-add-varargs-handling-of-prctl-syscall.patch new file mode 100644 index 000000000..79676958c --- /dev/null +++ b/main/uclibc/0001-avr32-add-varargs-handling-of-prctl-syscall.patch @@ -0,0 +1,74 @@ +From 85bc04d5436ca6c8a30a1ad28862260a04b8b3d5 Mon Sep 17 00:00:00 2001 +From: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> +Date: Wed, 16 Dec 2009 13:16:08 +0100 +Subject: [PATCH 1/9] avr32: add varargs handling of prctl syscall + +prctl is defined to use varargs in the header file, hence it needs varargs +specific handling in the source. This patch properly handles the variodic +argument before the syscall is passed to the kernel for the AVR32 architecture. + +Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> +--- + libc/sysdeps/linux/avr32/Makefile.arch | 2 +- + libc/sysdeps/linux/avr32/prctl.c | 36 ++++++++++++++++++++++++++++++++ + 2 files changed, 37 insertions(+), 1 deletions(-) + create mode 100644 libc/sysdeps/linux/avr32/prctl.c + +diff --git a/libc/sysdeps/linux/avr32/Makefile.arch b/libc/sysdeps/linux/avr32/Makefile.arch +index bc5f625..98b85a7 100644 +--- a/libc/sysdeps/linux/avr32/Makefile.arch ++++ b/libc/sysdeps/linux/avr32/Makefile.arch +@@ -5,7 +5,7 @@ + # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + # + +-CSRC := brk.c clone.c mmap.c sigaction.c ++CSRC := brk.c clone.c mmap.c prctl.c sigaction.c + + SSRC := __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ + sigrestorer.S syscall.S vfork.S +diff --git a/libc/sysdeps/linux/avr32/prctl.c b/libc/sysdeps/linux/avr32/prctl.c +new file mode 100644 +index 0000000..4e146e3 +--- /dev/null ++++ b/libc/sysdeps/linux/avr32/prctl.c +@@ -0,0 +1,36 @@ ++/* ++ * prctl syscall for AVR32 Linux. ++ * ++ * Copyright (C) 2010 Atmel Corporation ++ * ++ * This file is subject to the terms and conditions of the GNU Lesser General ++ * Public License. See the file "COPYING.LIB" in the main directory of this ++ * archive for more details. ++ */ ++#include <sys/syscall.h> ++#include <sys/prctl.h> ++#include <stdarg.h> ++ ++#ifdef __NR_prctl ++#define __NR___syscall_prctl __NR_prctl ++static inline _syscall5(int, __syscall_prctl, int, option, long, arg2, ++ long, arg3, long, arg4, long, arg5); ++ ++int prctl(int __option, ...) ++{ ++ long arg2; ++ long arg3; ++ long arg4; ++ long arg5; ++ va_list ap; ++ ++ va_start(ap, __option); ++ arg2 = va_arg(ap, long); ++ arg3 = va_arg(ap, long); ++ arg4 = va_arg(ap, long); ++ arg5 = va_arg(ap, long); ++ va_end(ap); ++ ++ return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5); ++} ++#endif +-- +1.6.6.1 + diff --git a/main/uclibc/0002-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch b/main/uclibc/0002-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch new file mode 100644 index 000000000..9f04a3ae6 --- /dev/null +++ b/main/uclibc/0002-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch @@ -0,0 +1,87 @@ +From 2911103dd4a03bbd3aad11eddfce524a5c9ba9b3 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 22 Jan 2010 13:00:20 +0100 +Subject: [PATCH 2/9] Make use of macros from sys/asm.h in crt1.S + +Needed for mips nptl to boot once again. +(cherry picked from commit 9c343fd4030dcd7a52616f365893177dded50346) + +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +--- + libc/sysdeps/linux/mips/crt1.S | 46 +++++++++++---------------------------- + 1 files changed, 13 insertions(+), 33 deletions(-) + +diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S +index e851d52..6a80412 100644 +--- a/libc/sysdeps/linux/mips/crt1.S ++++ b/libc/sysdeps/linux/mips/crt1.S +@@ -85,29 +85,10 @@ + + __start: + #ifdef __PIC__ +-#if _MIPS_SIM == _MIPS_SIM_ABI32 +- .frame sp, 24, sp +- .set noreorder +- move $0, $31 /* Save old ra. */ +- bal 10f /* Find addr of cpload. */ +- nop +-10: +- .cpload $31 +- move $31, $0 +- .set reorder +- .cprestore 16 +-#else +- move $0, $31; /* Save old ra. */ +- .set noreorder +- bal 10f /* Find addr of .cpsetup. */ +- nop +-10: +- .set reorder +- .cpsetup $31, $25, 10b +- move $31, $0 +-#endif ++ SETUP_GPX($0) ++ SETUP_GPX64($25,$0) + #else +- la $28, _gp /* Setup GP correctly if we're non-PIC. */ ++ PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */ + move $31, $0 + #endif + +@@ -118,18 +99,18 @@ __start: + /* Allocate space on the stack for seven arguments and + * make sure the stack is aligned to double words (8 bytes) */ + ++ and $29, -2 * SZREG ++ + #if _MIPS_SIM == _MIPS_SIM_ABI32 +- and $29, -2 * 4 +- subu $29, 32 +- la $7, _init /* init */ +- la $8, _fini +- sw $8, 16($29) /* fini */ +- sw $2, 20($29) /* rtld_fini */ +- sw $29, 24($29) /* stack_end */ +-#else +- and $29, -2 * PTRSIZE ++ PTR_SUBIU $29, 32 ++#endif + PTR_LA $7, _init /* init */ +- PTR_LA $8, _fini /* fini */ ++ PTR_LA $8, _fini ++#if _MIPS_SIM == _MIPS_SIM_ABI32 ++ PTR_S $8, 16($29) /* fini */ ++ PTR_S $2, 20($29) /* rtld_fini */ ++ PTR_S $29, 24($29) /* stack_end */ ++#else + move $9, $2 /* rtld_fini */ + move $10, $29 /* stack_end */ + #endif +@@ -148,4 +129,3 @@ __data_start: + .weak data_start + data_start = __data_start + +- +-- +1.6.6.1 + diff --git a/main/uclibc/0003-rpc-fix-typo-in-version-mismatch-msg.patch b/main/uclibc/0003-rpc-fix-typo-in-version-mismatch-msg.patch new file mode 100644 index 000000000..cb0826c63 --- /dev/null +++ b/main/uclibc/0003-rpc-fix-typo-in-version-mismatch-msg.patch @@ -0,0 +1,26 @@ +From 83a09cd5c9ed9afd87a7d1d17319c2fd2203ad0f Mon Sep 17 00:00:00 2001 +From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +Date: Thu, 21 Jan 2010 10:36:13 +0100 +Subject: [PATCH 3/9] rpc: fix typo in version mismatch msg + +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +--- + libc/inet/rpc/rpc_prot.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c +index 74658e6..229f988 100644 +--- a/libc/inet/rpc/rpc_prot.c ++++ b/libc/inet/rpc/rpc_prot.c +@@ -229,7 +229,7 @@ rejected (enum reject_stat rjct_stat, + { + switch (rjct_stat) + { +- case RPC_VERSMISMATCH: ++ case RPC_MISMATCH: + error->re_status = RPC_VERSMISMATCH; + return; + case AUTH_ERROR: +-- +1.6.6.1 + diff --git a/main/uclibc/0004-fix-make-install_-host-utils.patch b/main/uclibc/0004-fix-make-install_-host-utils.patch new file mode 100644 index 000000000..f5a5a9587 --- /dev/null +++ b/main/uclibc/0004-fix-make-install_-host-utils.patch @@ -0,0 +1,158 @@ +From d75ad2e129b3f22296cead3db53c784527deab60 Mon Sep 17 00:00:00 2001 +From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +Date: Fri, 18 Sep 2009 16:07:31 +0200 +Subject: [PATCH 4/9] fix make {,install_}{,host}utils + +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +--- + extra/locale/programs/locale.c | 3 +- + libc/misc/wchar/wchar.c | 88 +++++++++++++++++++++------------------- + 2 files changed, 47 insertions(+), 44 deletions(-) + +diff --git a/extra/locale/programs/locale.c b/extra/locale/programs/locale.c +index 462a579..dfd2029 100644 +--- a/extra/locale/programs/locale.c ++++ b/extra/locale/programs/locale.c +@@ -10,10 +10,9 @@ + * + */ + +- ++#include <string.h> + #include <stdio.h> + #include <stdlib.h> +-#include <string.h> + #include <langinfo.h> + #include <unistd.h> + #ifdef __UCLIBC_HAS_GETOPT_LONG__ +diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c +index 290e680..3ce884d 100644 +--- a/libc/misc/wchar/wchar.c ++++ b/libc/misc/wchar/wchar.c +@@ -171,7 +171,6 @@ extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn, + + extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n, + const wchar_t **__restrict src, size_t wn) attribute_hidden; +- + #endif /* _LIBC */ + /**********************************************************************/ + #ifdef L_btowc +@@ -1201,45 +1200,6 @@ typedef struct { + int skip_invalid_input; /* To support iconv -c option. */ + } _UC_iconv_t; + +- +- +-#ifdef L_iconv +- +-#include <iconv.h> +-#include <string.h> +-#include <endian.h> +-#include <byteswap.h> +- +-#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN) +-#error unsupported endianness for iconv +-#endif +- +-#ifndef __CTYPE_HAS_8_BIT_LOCALES +-#error currently iconv requires 8 bit locales +-#endif +-#ifndef __CTYPE_HAS_UTF_8_LOCALES +-#error currently iconv requires UTF-8 locales +-#endif +- +- +-enum { +- IC_WCHAR_T = 0xe0, +- IC_MULTIBYTE = 0xe0, +-#if __BYTE_ORDER == __BIG_ENDIAN +- IC_UCS_4 = 0xec, +- IC_UTF_32 = 0xe4, +- IC_UCS_2 = 0xe2, +- IC_UTF_16 = 0xea, +-#else +- IC_UCS_4 = 0xed, +- IC_UTF_32 = 0xe5, +- IC_UCS_2 = 0xe3, +- IC_UTF_16 = 0xeb, +-#endif +- IC_UTF_8 = 2, +- IC_ASCII = 1 +-}; +- + /* For the multibyte + * bit 0 means swap endian + * bit 1 means 2 byte +@@ -1247,8 +1207,13 @@ enum { + * + */ + ++#if defined L_iconv && defined _LIBC ++/* Used externally only by iconv utility */ + extern const unsigned char __iconv_codesets[]; + libc_hidden_proto(__iconv_codesets) ++#endif ++ ++#if defined L_iconv || defined L_iconv_main + const unsigned char __iconv_codesets[] = + "\x0a\xe0""WCHAR_T\x00" /* superset of UCS-4 but platform-endian */ + #if __BYTE_ORDER == __BIG_ENDIAN +@@ -1281,7 +1246,48 @@ const unsigned char __iconv_codesets[] = + "\x08\x02""UTF-8\x00" + "\x0b\x01""US-ASCII\x00" + "\x07\x01""ASCII"; /* Must be last! (special case to save a nul) */ ++#endif ++#if defined L_iconv && defined _LIBC + libc_hidden_data_def(__iconv_codesets) ++#endif ++ ++ ++#ifdef L_iconv ++ ++#include <iconv.h> ++#include <string.h> ++#include <endian.h> ++#include <byteswap.h> ++ ++#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN) ++#error unsupported endianness for iconv ++#endif ++ ++#ifndef __CTYPE_HAS_8_BIT_LOCALES ++#error currently iconv requires 8 bit locales ++#endif ++#ifndef __CTYPE_HAS_UTF_8_LOCALES ++#error currently iconv requires UTF-8 locales ++#endif ++ ++ ++enum { ++ IC_WCHAR_T = 0xe0, ++ IC_MULTIBYTE = 0xe0, ++#if __BYTE_ORDER == __BIG_ENDIAN ++ IC_UCS_4 = 0xec, ++ IC_UTF_32 = 0xe4, ++ IC_UCS_2 = 0xe2, ++ IC_UTF_16 = 0xea, ++#else ++ IC_UCS_4 = 0xed, ++ IC_UTF_32 = 0xe5, ++ IC_UCS_2 = 0xe3, ++ IC_UTF_16 = 0xeb, ++#endif ++ IC_UTF_8 = 2, ++ IC_ASCII = 1 ++}; + + /* Experimentally off - libc_hidden_proto(strcasecmp) */ + +@@ -1575,6 +1581,4 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf, + } + return nrcount; + } +- + #endif +- +-- +1.6.6.1 + diff --git a/main/uclibc/0005-host-utils-depend-on-headers.patch b/main/uclibc/0005-host-utils-depend-on-headers.patch new file mode 100644 index 000000000..3a3689267 --- /dev/null +++ b/main/uclibc/0005-host-utils-depend-on-headers.patch @@ -0,0 +1,35 @@ +From 47e88c04e01299f975ff23f33035d0f34a8f6787 Mon Sep 17 00:00:00 2001 +From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +Date: Fri, 22 Jan 2010 13:32:44 +0100 +Subject: [PATCH 5/9] {,host}utils depend on headers + +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +--- + Makefile.in | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 4c5aecb..ec4c28e 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -436,7 +436,7 @@ ifeq ($(HAVE_SHARED),y) + fi + endif + +-utils: ++utils: headers + $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils $@ + + # Installs helper applications, such as 'ldd' and 'ldconfig' +@@ -445,7 +445,7 @@ install_utils: utils + + endif # ifeq ($(HAVE_DOT_CONFIG),y) + +-hostutils: ++hostutils: headers + $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@ + + install_hostutils: hostutils +-- +1.6.6.1 + diff --git a/main/uclibc/fstatat-fix-32bit.patch b/main/uclibc/0006-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch index 536cd8b62..51564405a 100644 --- a/main/uclibc/fstatat-fix-32bit.patch +++ b/main/uclibc/0006-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch @@ -1,7 +1,10 @@ -From 656167d89112171b2b7672676dc413c676a186f5 Mon Sep 17 00:00:00 2001 +From d43f068e84513ed88392df4ca27d49ad01145fd2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger <vapier@gentoo.org> -Date: Sun, 06 Sep 2009 16:12:12 +0000 -Subject: fstatat: fix up behavior on 32/64 bit hosts +Date: Sun, 6 Sep 2009 12:12:12 -0400 +Subject: [PATCH 6/9] fstatat: fix up behavior on 32/64 bit hosts +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit The fstatat() syscall is a little funky in that it sometimes changes name between 32 and 64 bit hosts, but it should always operate on a 64bit stat @@ -12,7 +15,14 @@ Along these lines, we need to restore the __xstat32_conv() function. Reported-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> --- + libc/sysdeps/linux/common/fstatat.c | 9 +++++++-- + libc/sysdeps/linux/common/fstatat64.c | 5 +++++ + libc/sysdeps/linux/common/xstatconv.c | 19 +++++++++++++++++++ + libc/sysdeps/linux/common/xstatconv.h | 1 + + 4 files changed, 32 insertions(+), 2 deletions(-) + diff --git a/libc/sysdeps/linux/common/fstatat.c b/libc/sysdeps/linux/common/fstatat.c index 149c189..33daa7c 100644 --- a/libc/sysdeps/linux/common/fstatat.c @@ -57,10 +67,10 @@ index 5ae1fad..95627af 100644 int fstatat64(int fd, const char *file, struct stat64 *buf, int flag) { diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c -index 2a82458..deef392 100644 +index e575b26..50455c6 100644 --- a/libc/sysdeps/linux/common/xstatconv.c +++ b/libc/sysdeps/linux/common/xstatconv.c -@@ -44,6 +44,25 @@ void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) +@@ -46,6 +46,25 @@ void attribute_hidden __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) buf->st_ctim = kbuf->st_ctim; } @@ -78,14 +88,14 @@ index 2a82458..deef392 100644 + buf->st_size = kbuf->st_size; + buf->st_blksize = kbuf->st_blksize; + buf->st_blocks = kbuf->st_blocks; -+ buf->st_atime = kbuf->st_atime; -+ buf->st_mtime = kbuf->st_mtime; -+ buf->st_ctime = kbuf->st_ctime; ++ buf->st_atim = kbuf->st_atim; ++ buf->st_mtim = kbuf->st_mtim; ++ buf->st_ctim = kbuf->st_ctim; +} + #ifdef __UCLIBC_HAS_LFS__ - void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) + void attribute_hidden __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) diff --git a/libc/sysdeps/linux/common/xstatconv.h b/libc/sysdeps/linux/common/xstatconv.h index 57c8bcb..7568da8 100644 --- a/libc/sysdeps/linux/common/xstatconv.h @@ -98,5 +108,6 @@ index 57c8bcb..7568da8 100644 #if defined __UCLIBC_HAS_LFS__ extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) attribute_hidden; #endif --- -cgit v0.8.2.1 +-- +1.6.6.1 + diff --git a/main/uclibc/0007-Unbreak-build-for-sparc-on-some-config-s.patch b/main/uclibc/0007-Unbreak-build-for-sparc-on-some-config-s.patch new file mode 100644 index 000000000..1d86d585c --- /dev/null +++ b/main/uclibc/0007-Unbreak-build-for-sparc-on-some-config-s.patch @@ -0,0 +1,42 @@ +From 7b964170536951a260f7d552db99b428d1ea5026 Mon Sep 17 00:00:00 2001 +From: Austin Foxley <austinf@cetoncorp.com> +Date: Wed, 3 Feb 2010 12:12:10 -0800 +Subject: [PATCH 7/9] Unbreak build for sparc on some config's + +Thanks to rob@landley.net + +Signed-off-by: Austin Foxley <austinf@cetoncorp.com> +--- + libc/sysdeps/linux/sparc/sigaction.c | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/libc/sysdeps/linux/sparc/sigaction.c b/libc/sysdeps/linux/sparc/sigaction.c +index a22ac40..7140fd3 100644 +--- a/libc/sysdeps/linux/sparc/sigaction.c ++++ b/libc/sysdeps/linux/sparc/sigaction.c +@@ -34,7 +34,8 @@ _syscall5(int, rt_sigaction, int, a, int, b, int, c, int, d, int, e); + static void __rt_sigreturn_stub(void); + static void __sigreturn_stub(void); + +-int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact) ++libc_hidden_proto(sigaction) ++int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) + { + int ret; + struct sigaction kact, koact; +@@ -65,10 +66,8 @@ int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oac + return ret; + } + +-#ifndef LIBC_SIGACTION +-weak_alias(__libc_sigaction,sigaction) +-libc_hidden_weak(sigaction) +-#endif ++libc_hidden_def(sigaction) ++weak_alias(sigaction,__libc_sigaction) + + static void + __rt_sigreturn_stub(void) +-- +1.6.6.1 + diff --git a/main/uclibc/0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch b/main/uclibc/0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch new file mode 100644 index 000000000..48e8427d2 --- /dev/null +++ b/main/uclibc/0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch @@ -0,0 +1,89 @@ +From fa476d01f1c1990a92ee49d1f1c557b83805d0e9 Mon Sep 17 00:00:00 2001 +From: Freeman Wang <xwang@ubicom.com> +Date: Sat, 19 Dec 2009 13:43:00 -0800 +Subject: [PATCH 8/9] malloc: fix race condition and other bugs in the no-mmu malloc + +Fixes multiple race conditions on mmb list. This was done by +making the mmb_heap_lock into a recursive lock and making the +regular heap_lock extend to cover the mmb heap handling. + +Also move the new_mmb allocation up to before the mmb list is +iterated through to find the insertion point. When the mmb_heap +also runs out and needs to be extended when the regular heap is +just extended, the mmb list could be messed up. + +Signed-off-by: Freeman Wang <xwang@ubicom.com> +Signed-off-by: Austin Foxley <austinf@cetoncorp.com> +--- + libc/stdlib/malloc/free.c | 6 +++--- + libc/stdlib/malloc/malloc.c | 7 ++++--- + 2 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/libc/stdlib/malloc/free.c b/libc/stdlib/malloc/free.c +index 90e18f4..741248a 100644 +--- a/libc/stdlib/malloc/free.c ++++ b/libc/stdlib/malloc/free.c +@@ -179,14 +179,14 @@ __free_to_heap (void *mem, struct heap_free_area **heap + /* Start searching again from the end of this block. */ + start = mmb_end; + ++ /* Release the descriptor block we used. */ ++ free_to_heap (mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock); ++ + /* We have to unlock the heap before we recurse to free the mmb + descriptor, because we might be unmapping from the mmb + heap. */ + __heap_unlock (heap_lock); + +- /* Release the descriptor block we used. */ +- free_to_heap (mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock); +- + /* Do the actual munmap. */ + munmap ((void *)mmb_start, mmb_end - mmb_start); + +diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c +index 71f9e58..84a6acd 100644 +--- a/libc/stdlib/malloc/malloc.c ++++ b/libc/stdlib/malloc/malloc.c +@@ -48,7 +48,7 @@ struct malloc_mmb *__malloc_mmapped_blocks = 0; + HEAP_DECLARE_STATIC_FREE_AREA (initial_mmb_fa, 48); /* enough for 3 mmbs */ + struct heap_free_area *__malloc_mmb_heap = HEAP_INIT_WITH_FA (initial_mmb_fa); + #ifdef HEAP_USE_LOCKING +-pthread_mutex_t __malloc_mmb_heap_lock = PTHREAD_MUTEX_INITIALIZER; ++pthread_mutex_t __malloc_mmb_heap_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; + #endif + #endif /* __UCLIBC_UCLINUX_BROKEN_MUNMAP__ */ + +@@ -151,19 +151,19 @@ __malloc_from_heap (size_t size, struct heap_free_area **heap + /* Try again to allocate. */ + mem = __heap_alloc (heap, &size); + +- __heap_unlock (heap_lock); + + #if !defined(MALLOC_USE_SBRK) && defined(__UCLIBC_UCLINUX_BROKEN_MUNMAP__) + /* Insert a record of BLOCK in sorted order into the + __malloc_mmapped_blocks list. */ + ++ new_mmb = malloc_from_heap (sizeof *new_mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock); ++ + for (prev_mmb = 0, mmb = __malloc_mmapped_blocks; + mmb; + prev_mmb = mmb, mmb = mmb->next) + if (block < mmb->mem) + break; + +- new_mmb = malloc_from_heap (sizeof *new_mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock); + new_mmb->next = mmb; + new_mmb->mem = block; + new_mmb->size = block_size; +@@ -177,6 +177,7 @@ __malloc_from_heap (size_t size, struct heap_free_area **heap + (unsigned)new_mmb, + (unsigned)new_mmb->mem, block_size); + #endif /* !MALLOC_USE_SBRK && __UCLIBC_UCLINUX_BROKEN_MUNMAP__ */ ++ __heap_unlock (heap_lock); + } + } + +-- +1.6.6.1 + diff --git a/main/uclibc/0009-libm-enable-log2f-and-exp2f.patch b/main/uclibc/0009-libm-enable-log2f-and-exp2f.patch new file mode 100644 index 000000000..88e13e328 --- /dev/null +++ b/main/uclibc/0009-libm-enable-log2f-and-exp2f.patch @@ -0,0 +1,70 @@ +From 956a0087e282e53ba9c085dbbc469391f7234944 Mon Sep 17 00:00:00 2001 +From: Aurelien Jacobs <aurel@gnuage.org> +Date: Thu, 4 Feb 2010 09:31:40 -0800 +Subject: [PATCH 9/9] libm: enable log2f and exp2f + +Signed-off-by: Aurelien Jacobs <aurel@gnuage.org> +Signed-off-by: Austin Foxley <austinf@cetoncorp.com> +--- + libm/float_wrappers.c | 4 ++-- + test/math/compile_test.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libm/float_wrappers.c b/libm/float_wrappers.c +index dc315e7..b7317a1 100644 +--- a/libm/float_wrappers.c ++++ b/libm/float_wrappers.c +@@ -15,12 +15,10 @@ + + /* For the time being, do _NOT_ implement these functions + * that are defined by SuSv3 */ +-#undef L_exp2f /*float exp2f(float);*/ + #undef L_fdimf /*float fdimf(float, float);*/ + #undef L_fmaf /*float fmaf(float, float, float);*/ + #undef L_fmaxf /*float fmaxf(float, float);*/ + #undef L_fminf /*float fminf(float, float);*/ +-#undef L_log2f /*float log2f(float);*/ + #undef L_nearbyintf /*float nearbyintf(float);*/ + #undef L_nexttowardf /*float nexttowardf(float, long double);*/ + #undef L_remquof /*float remquof(float, float, int *);*/ +@@ -43,6 +41,7 @@ float cosf(float); + float coshf(float); + float erfcf(float); + float erff(float); ++float exp2f(float); + float expf(float); + float expm1f(float); + float fabsf(float); +@@ -56,6 +55,7 @@ float lgammaf(float); + long long llroundf(float); + float log10f(float); + float log1pf(float); ++float log2f(float); + float logbf(float); + float logf(float); + long lroundf(float); +diff --git a/test/math/compile_test.c b/test/math/compile_test.c +index 9990520..ee5e2e3 100644 +--- a/test/math/compile_test.c ++++ b/test/math/compile_test.c +@@ -18,7 +18,7 @@ r += cosf(float_x); + r += coshf(float_x); + r += erfcf(float_x); + r += erff(float_x); +-/*r += exp2f(float_x); - uclibc does not have it (yet?) */ ++r += exp2f(float_x); + r += expf(float_x); + r += expm1f(float_x); + r += fabsf(float_x); +@@ -38,7 +38,7 @@ r += llrintf(float_x); + r += llroundf(float_x); + r += log10f(float_x); + r += log1pf(float_x); +-/*r += log2f(float_x); - uclibc does not have it (yet?) */ ++r += log2f(float_x); + r += logbf(float_x); + r += logf(float_x); + r += lrintf(float_x); +-- +1.6.6.1 + diff --git a/main/uclibc/APKBUILD b/main/uclibc/APKBUILD index b1931a248..40d9ca2d9 100644 --- a/main/uclibc/APKBUILD +++ b/main/uclibc/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=uclibc pkgver=0.9.30.2 -pkgrel=0 +pkgrel=1 pkgdesc="C library for developing embedded Linux systems" url=http://uclibc.org license="LGPL-2" @@ -15,7 +15,17 @@ source="http://uclibc.org/downloads/$_mynamever.tar.bz2 uclibc-0.9.30.1-pthread_getattr_np.patch 0001-Add-dn_skipname-from-OpenBSD.patch 0001-ldd-segfault-fix.patch - fstatat-fix-32bit.patch + + 0001-avr32-add-varargs-handling-of-prctl-syscall.patch + 0002-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch + 0003-rpc-fix-typo-in-version-mismatch-msg.patch + 0004-fix-make-install_-host-utils.patch + 0005-host-utils-depend-on-headers.patch + 0006-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch + 0007-Unbreak-build-for-sparc-on-some-config-s.patch + 0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch + 0009-libm-enable-log2f-and-exp2f.patch + pthread-new-aliasing-fix.diff uclibc-resolv-cname-fix.diff uclibc-i386-floating-stacks.diff @@ -59,7 +69,15 @@ ea91460617601b6e084ead66bc3948f5 uclibc-0.9.30.1-resolv.patch cf80c0d44a41e02f389be427ee615d61 uclibc-0.9.30.1-pthread_getattr_np.patch c9e3df01e854db4b1118266acd9bcfbd 0001-Add-dn_skipname-from-OpenBSD.patch 4079b20c763727863bc53408e4988434 0001-ldd-segfault-fix.patch -14d9fa172f67fee0257f0441b3b3bc13 fstatat-fix-32bit.patch +fe69ee3a487605b40cd7e6edadedbc45 0001-avr32-add-varargs-handling-of-prctl-syscall.patch +045d4e110e512493fbc2040fd6a6d5c4 0002-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch +e23edaf402ae29650205b3337b2f9ec2 0003-rpc-fix-typo-in-version-mismatch-msg.patch +afbeb89d1fd086cec5cfbc10cc011b7a 0004-fix-make-install_-host-utils.patch +41796dd355bc56526991410647d854f4 0005-host-utils-depend-on-headers.patch +c78e19855a8a83f07855fe82ceaf9d21 0006-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch +d20abc16e2ce8579f77e42271008ff07 0007-Unbreak-build-for-sparc-on-some-config-s.patch +2438e999b21cfaf823139df05d06dd33 0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch +0b2ed68cbd2e4bb2941155bdb1f0f9b0 0009-libm-enable-log2f-and-exp2f.patch 969187e1da84d0a0a5957b392a3d5a2b pthread-new-aliasing-fix.diff bbb8475963e791f596c34c81ef5583d7 uclibc-resolv-cname-fix.diff ccf15714e089306c09d74a1a5c3cc670 uclibc-i386-floating-stacks.diff |