diff mbox

[uclibc-ng-devel] uClibc-ng - small C library for embedded systems branch master updated. v1.0.19-25-gd9f4c6b

Message ID 20161127213022.A72B410050@helium.openadk.org
State Not Applicable
Headers show

Commit Message

wbx Nov. 27, 2016, 9:30 p.m. UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".

The branch, master has been updated
       via  d9f4c6bb0568da6d80f60a0040354f45478f84a3 (commit)
       via  52b50c15fa3b319bb162f0d47fbeb6582842c020 (commit)
       via  3506b44a80d3e38904d5c6cd76085c16ad3a165c (commit)
       via  11cf4e80748af05dd6c8f1d30609a5485bf28372 (commit)
       via  8ccf7c3e8c725e9fc29ad0f5accebb127c9ea246 (commit)
       via  cee0b058fa0b4501b289a2da365182d60314d746 (commit)
       via  031d4eef8d055fbdae8d2fe4f59047e83601a15d (commit)
       via  8dd85e041bdccf630c90e12ea044f55d28da9396 (commit)
       via  dd2a3636048740688f6139ada4c8958bcb3cb854 (commit)
       via  a9309ae2dbb63d35c5df9bc8666db30b5cc18b7c (commit)
      from  05fca4593c3f54a6750f3cd2dd1eff61a2f5ee93 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d9f4c6bb0568da6d80f60a0040354f45478f84a3
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sun Nov 27 16:35:11 2016 +0100

    remove libnsl stub

commit 52b50c15fa3b319bb162f0d47fbeb6582842c020
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sat Nov 26 19:47:41 2016 +0100

    do not define madvise related macros for noMMU targets

commit 3506b44a80d3e38904d5c6cd76085c16ad3a165c
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sat Nov 26 19:47:38 2016 +0100

    microblaze: fixup gcc warnings

commit 11cf4e80748af05dd6c8f1d30609a5485bf28372
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sat Nov 26 19:26:23 2016 +0100

    fixup gcc warnings
    
    Remove following warning from common code:
    warning: ISO C90 forbids mixed declarations and code

commit 8ccf7c3e8c725e9fc29ad0f5accebb127c9ea246
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sat Nov 26 10:12:58 2016 +0100

    microblaze: sync sysdep-cancel.h/sydep.h with GNU libc

commit cee0b058fa0b4501b289a2da365182d60314d746
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Fri Nov 25 23:04:25 2016 +0100

    add aligned_alloc required for latest gcc libstdc++

commit 031d4eef8d055fbdae8d2fe4f59047e83601a15d
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Fri Nov 25 20:55:22 2016 +0100

    Fix handling of unterminated [ expression in fnmatch.
    
    Originally fixed in GNU libc by:
    
    commit 794c3ad3a405697e2663b00f616e319383b9bb7d
    Author: Ulrich Drepper <drepper@gmail.com>
    Date:   Fri Jan 14 08:06:22 2011 -0500
    
    Reported-by: Denys Vlasenko <vda.linux@googlemail.com>
    
    via busybox mailinglist.

commit 8dd85e041bdccf630c90e12ea044f55d28da9396
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Fri Nov 25 20:51:56 2016 +0100

    arm: use common ret_ERRVAL
    
    Fixes mq_send return value and errno issue.
    
    Reported-by: Frank Liu <fliu@universalbiosensors.com>
    Tested-by: Frank Liu <fliu@universalbiosensors.com>

commit dd2a3636048740688f6139ada4c8958bcb3cb854
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Tue Nov 22 16:04:49 2016 +0100

    sh: remove duplicate code

commit a9309ae2dbb63d35c5df9bc8666db30b5cc18b7c
Author: Waldemar Brodkorb <wbx@uclibc-ng.org>
Date:   Sun Nov 20 19:59:57 2016 +0100

    Revert "sh: fix static linking issue"
    
    This reverts commit c13f823941b103cf744929e5afcb3e2bc1342354.

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in                                        |  6 +--
 Makerules                                          |  7 ++--
 extra/Configs/Config.in                            |  5 ---
 include/cancel.h                                   |  6 ++-
 include/libc-symbols.h                             | 18 --------
 include/stdlib.h                                   |  6 +++
 libc/Makefile.in                                   |  2 -
 libc/misc/fnmatch/fnmatch_loop.c                   | 11 ++++-
 libc/stdlib/malloc-standard/memalign.c             |  1 +
 libc/stdlib/malloc/memalign.c                      |  1 +
 libc/sysdeps/linux/arm/sysdep.h                    |  3 --
 libc/sysdeps/linux/common/__rt_sigtimedwait.c      |  5 ++-
 libc/sysdeps/linux/common/__syscall_fcntl.c        |  9 ++--
 libc/sysdeps/linux/common/__syscall_fcntl64.c      |  7 +++-
 libc/sysdeps/linux/common/bits/mman-common.h       | 41 +++++++++---------
 libc/sysdeps/linux/common/bits/syscalls-common.h   |  6 ++-
 libc/sysdeps/linux/common/ioctl.c                  |  7 +++-
 libc/sysdeps/linux/common/open.c                   |  9 ++--
 libc/sysdeps/linux/common/posix_fadvise64.c        |  7 ++--
 libc/sysdeps/linux/common/pselect.c                |  9 ++--
 libc/sysdeps/linux/common/sched_setaffinity.c      |  9 ++--
 libc/sysdeps/linux/microblaze/sysdep.h             | 29 +++++++++++++
 libnsl/Makefile                                    | 13 ------
 libnsl/Makefile.in                                 | 28 -------------
 libnsl/nsl.c                                       | 15 -------
 .../unix/sysv/linux/microblaze/lowlevellock.h      |  8 ++--
 .../unix/sysv/linux/microblaze/sysdep-cancel.h     | 48 ++++++++++++++--------
 .../nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch  |  2 +-
 .../sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S | 18 --------
 .../nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S |  6 ---
 30 files changed, 155 insertions(+), 187 deletions(-)
 delete mode 100644 libnsl/Makefile
 delete mode 100644 libnsl/Makefile.in
 delete mode 100644 libnsl/nsl.c
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S



hooks/post-receive
diff mbox

Patch

diff --git a/Makefile.in b/Makefile.in
index 98c6d6d..b79314f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -34,7 +34,6 @@  include $(top_srcdir)ldso/Makefile.in
 include $(top_srcdir)libcrypt/Makefile.in
 include $(top_srcdir)libintl/Makefile.in
 include $(top_srcdir)libm/Makefile.in
-include $(top_srcdir)libnsl/Makefile.in
 include $(top_srcdir)libresolv/Makefile.in
 include $(top_srcdir)libutil/Makefile.in
 include $(top_srcdir)libpthread/Makefile.in
@@ -363,7 +362,7 @@  else
 	$(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -f wchar-stub.h
 endif
 
-EMPTY_LIB_NAMES = dl
+EMPTY_LIB_NAMES = dl nsl
 ifeq ($(DO_C99_MATH),y)
 EMPTY_LIB_NAMES += m
 endif
@@ -382,9 +381,6 @@  endif
 ifeq ($(UCLIBC_HAS_LIBRESOLV_STUB),y)
 EMPTY_LIB_NAMES += resolv
 endif
-ifeq ($(UCLIBC_HAS_LIBNSL_STUB),y)
-EMPTY_LIB_NAMES += nsl
-endif
 ifeq ($(UCLIBC_HAS_GETTEXT_AWARENESS),y)
 EMPTY_LIB_NAMES += intl
 endif
diff --git a/Makerules b/Makerules
index e0784e1..b169439 100644
--- a/Makerules
+++ b/Makerules
@@ -41,7 +41,6 @@  $(eval $(call add_IS_IN_lib,libcrypt,$(libcrypt-a-y) $(libcrypt-so-y)))
 $(eval $(call add_IS_IN_lib,libdl,$(libdl-a-y) $(libdl-so-y)))
 $(eval $(call add_IS_IN_lib,libintl,$(libintl-a-y) $(libintl-so-y)))
 $(eval $(call add_IS_IN_lib,libm,$(libm-a-y) $(libm-so-y)))
-$(eval $(call add_IS_IN_lib,libnsl,$(libnsl-a-y) $(libnsl-so-y)))
 $(eval $(call add_IS_IN_lib,libpthread/$(PTNAME),$(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y)))
 $(eval $(call add_IS_IN_lib,libpthread/$(PTNAME)_db,$(libthread_db-a-y) $(libthread_db-so-y)))
 $(eval $(call add_IS_IN_lib,libresolv,$(libresolv-a-y) $(libresolv-so-y)))
@@ -52,14 +51,14 @@  $(eval $(call add_IS_IN_lib,libuargp,$(libuargp-a-y) $(libuargp-so-y)))
 
 shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \
 	$(libcrypt-so-y) $(libdl-so-y) \
-	$(libintl-so-y) $(libm-so-y) $(libnsl-so-y) \
+	$(libintl-so-y) $(libm-so-y) \
 	$(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \
 	$(libresolv-so-y) $(librt-so-y) \
 	$(ldso-y) \
 	$(libutil-so-y) $(libubacktrace-so-y) $(libuargp-so-y)
 
 ar_objs =  $(libc-y) $(libc-static-y) $(libcrypt-a-y) \
-	$(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \
+	$(libdl-a-y) $(libintl-a-y) $(libm-a-y) \
 	$(libpthread-a-y) $(libthread_db-a-y) \
 	$(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) $(libuargp-a-y)
 ifeq ($(DOPIC),y)
@@ -480,7 +479,7 @@  files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \
 	$(PTHREAD_INITFINI:.c=.s) \
 	$(librt-a-y) $(librt-so-y)  $(libresolv-a-y) $(libresolv-so-y) \
 	$(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \
-	$(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y) \
+	$(ldso-y) $(libdl-a-y) $(libdl-so-y) \
 	$(libubacktrace-a-y) $(libubacktrace-so-y) $(libuargp-so-y) $(libuargp-a-y)
 .depends.dep := \
 	$(patsubst %.s,%.s.dep,$(filter %.s,$(files.dep))) \
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 719218f..3315c7d 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -1381,11 +1381,6 @@  config UCLIBC_HAS_LIBRESOLV_STUB
 	help
 	  Provide a dummy resolv library.
 
-config UCLIBC_HAS_LIBNSL_STUB
-	bool "Provide libnsl stub"
-	help
-	  Provide a dummy nsl library.
-
 endif
 
 
diff --git a/include/cancel.h b/include/cancel.h
index b60d218..629df55 100644
--- a/include/cancel.h
+++ b/include/cancel.h
@@ -60,10 +60,12 @@ 
 # define CANCELLABLE_SYSCALL(res_type, name, param_list, params)	\
 res_type weak_function name param_list					\
 {									\
+	int oldtype;							\
+	res_type result;						\
 	if (SINGLE_THREAD_P)						\
 		return __NC(name) params;				\
-	int oldtype = LIBC_CANCEL_ASYNC();				\
-	res_type result = __NC(name) params;				\
+	oldtype = LIBC_CANCEL_ASYNC();					\
+	result = __NC(name) params;					\
 	LIBC_CANCEL_RESET(oldtype);					\
 	return result;							\
 }
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index fc129db..21c4ee0 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -618,24 +618,6 @@  FIXME! - ?
 # define libintl_hidden_data_ver(local, name)
 #endif
 
-#if defined NOT_IN_libc && defined IS_IN_libnsl
-# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-# define libnsl_hidden_def(name) hidden_def (name)
-# define libnsl_hidden_weak(name) hidden_weak (name)
-# define libnsl_hidden_ver(local, name) hidden_ver (local, name)
-# define libnsl_hidden_data_def(name) hidden_data_def (name)
-# define libnsl_hidden_data_weak(name) hidden_data_weak (name)
-# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
-#else
-# define libnsl_hidden_proto(name, attrs...)
-# define libnsl_hidden_def(name)
-# define libnsl_hidden_weak(name)
-# define libnsl_hidden_ver(local, name)
-# define libnsl_hidden_data_def(name)
-# define libnsl_hidden_data_weak(name)
-# define libnsl_hidden_data_ver(local, name)
-#endif
-
 #if defined NOT_IN_libc && defined IS_IN_libutil
 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libutil_hidden_def(name) hidden_def (name)
diff --git a/include/stdlib.h b/include/stdlib.h
index ba8849e..a108c84 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -529,6 +529,12 @@  extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
      __THROW __nonnull ((1)) __wur;
 #endif
 
+#ifdef __USE_ISOC11
+/* ISO C variant of aligned allocation.  */
+extern void *aligned_alloc (size_t __alignment, size_t __size)
+     __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
+#endif
+
 __BEGIN_NAMESPACE_STD
 /* Abort execution and generate a core-dump.  */
 extern void abort (void) __THROW __attribute__ ((__noreturn__));
diff --git a/libc/Makefile.in b/libc/Makefile.in
index 3d6ef13..ef7bade 100644
--- a/libc/Makefile.in
+++ b/libc/Makefile.in
@@ -44,7 +44,6 @@  endif
 
 libc-a-$(HAVE_SHARED) += $(libdl-a-y)
 libc-a-$(DO_C99_MATH) += $(libm-a-y)
-libc-a-$(UCLIBC_HAS_LIBNSL_STUB) += $(libnsl-a-y)
 libc-a-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(libresolv-a-y)
 libc-a-$(UCLIBC_HAS_LIBUTIL) += $(libutil-a-y)
 libc-a-$(UCLIBC_HAS_CRYPT) += $(libcrypt-a-y)
@@ -58,7 +57,6 @@  libc-so-y = $(libc-y:.o=.os) $(libc-shared-y)
 
 libc-so-y += $(libdl-so-y)
 libc-so-$(DO_C99_MATH) += $(libm-so-y)
-libc-so-$(UCLIBC_HAS_LIBNSL_STUB) += $(libnsl-so-y)
 libc-so-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(libresolv-so-y)
 libc-so-$(UCLIBC_HAS_LIBUTIL) += $(libutil-so-y)
 libc-so-$(UCLIBC_HAS_CRYPT) += $(libcrypt-so-y)
diff --git a/libc/misc/fnmatch/fnmatch_loop.c b/libc/misc/fnmatch/fnmatch_loop.c
index 6d037f8..a09cfbb 100644
--- a/libc/misc/fnmatch/fnmatch_loop.c
+++ b/libc/misc/fnmatch/fnmatch_loop.c
@@ -204,6 +204,8 @@  FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 	case L('['):
 	  {
 	    /* Nonzero if the sense of the character class is inverted.  */
+	    CHAR *p_init = p;
+	    CHAR *n_init = n;
 	    register int not;
 	    CHAR cold;
 	    UCHAR fn;
@@ -409,8 +411,13 @@  FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 		  }
 #endif
 		else if (c == L('\0'))
-		  /* [ (unterminated) loses.  */
-		  return FNM_NOMATCH;
+		  {
+		    /* [ unterminated, treat as normal character.  */
+		    p = p_init;
+		    n = n_init;
+		    c = L('[');
+		    goto normal_match;
+		  }
 		else
 		  {
 		    int is_range = 0;
diff --git a/libc/stdlib/malloc-standard/memalign.c b/libc/stdlib/malloc-standard/memalign.c
index e9ae5a7..8cd6f58 100644
--- a/libc/stdlib/malloc-standard/memalign.c
+++ b/libc/stdlib/malloc-standard/memalign.c
@@ -127,4 +127,5 @@  void* memalign(size_t alignment, size_t bytes)
     __MALLOC_UNLOCK;
 	return retval;
 }
+weak_alias(memalign, aligned_alloc)
 libc_hidden_def(memalign)
diff --git a/libc/stdlib/malloc/memalign.c b/libc/stdlib/malloc/memalign.c
index 74d5dbd..6943279 100644
--- a/libc/stdlib/malloc/memalign.c
+++ b/libc/stdlib/malloc/memalign.c
@@ -93,4 +93,5 @@  memalign (size_t alignment, size_t size)
 
   return MALLOC_SETUP (base, end_addr - (unsigned long)base);
 }
+weak_alias(memalign, aligned_alloc)
 libc_hidden_def(memalign)
diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
index 80bf9ec..8813f8e 100644
--- a/libc/sysdeps/linux/arm/sysdep.h
+++ b/libc/sysdeps/linux/arm/sysdep.h
@@ -137,9 +137,6 @@ 
 #define	PSEUDO_END_ERRVAL(name) \
   END (name)
 
-#undef ret_ERRVAL
-#define ret_ERRVAL PSEUDO_RET_NOERRNO
-
 #if defined NOT_IN_libc
 # define SYSCALL_ERROR __local_syscall_error
 #  define SYSCALL_ERROR_HANDLER					\
diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c
index 422a952..9c74322 100644
--- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c
+++ b/libc/sysdeps/linux/common/__rt_sigtimedwait.c
@@ -25,6 +25,9 @@ 
 int __NC(sigtimedwait)(const sigset_t *set, siginfo_t *info,
 		       const struct timespec *timeout)
 {
+# if defined SI_TKILL && defined SI_USER
+	int result;
+# endif
 # ifdef SIGCANCEL
 	sigset_t tmpset;
 
@@ -50,7 +53,7 @@  int __NC(sigtimedwait)(const sigset_t *set, siginfo_t *info,
 	/* XXX The size argument hopefully will have to be changed to the
 	   real size of the user-level sigset_t.  */
 	/* on uClibc we use the kernel sigset_t size */
-	int result = INLINE_SYSCALL(rt_sigtimedwait, 4, set, info,
+	result = INLINE_SYSCALL(rt_sigtimedwait, 4, set, info,
 				    timeout, __SYSCALL_SIGSET_T_SIZE);
 
 	/* The kernel generates a SI_TKILL code in si_code in case tkill is
diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c
index 17c6718..86cc60d 100644
--- a/libc/sysdeps/linux/common/__syscall_fcntl.c
+++ b/libc/sysdeps/linux/common/__syscall_fcntl.c
@@ -39,6 +39,9 @@  int fcntl(int fd, int cmd, ...)
 {
 	va_list ap;
 	long arg;
+#ifdef __NEW_THREADS
+	int oldtype, result;
+#endif
 
 	va_start (ap, cmd);
 	arg = va_arg (ap, long);
@@ -51,11 +54,11 @@  int fcntl(int fd, int cmd, ...)
 		return INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg);
 #endif
 #ifdef __NEW_THREADS
-	int oldtype = LIBC_CANCEL_ASYNC ();
+	oldtype = LIBC_CANCEL_ASYNC ();
 #if defined __NR_fcntl
-	int result = __NC(fcntl)(fd, cmd, arg);
+	result = __NC(fcntl)(fd, cmd, arg);
 #else
-	int result = INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg);
+	result = INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg);
 #endif
 	LIBC_CANCEL_RESET (oldtype);
 	return result;
diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c
index eaef22b..88b2b14 100644
--- a/libc/sysdeps/linux/common/__syscall_fcntl64.c
+++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c
@@ -23,6 +23,9 @@  int fcntl64(int fd, int cmd, ...)
 {
 	long arg;
 	va_list list;
+# ifdef __NEW_THREADS
+	int oldtype, result;
+# endif
 
 	va_start(list, cmd);
 	arg = va_arg(list, long);
@@ -31,8 +34,8 @@  int fcntl64(int fd, int cmd, ...)
 	if (SINGLE_THREAD_P || (cmd != F_SETLKW64))
 		return __NC(fcntl64)(fd, cmd, arg);
 # ifdef __NEW_THREADS
-	int oldtype = LIBC_CANCEL_ASYNC();
-	int result = __NC(fcntl64)(fd, cmd, arg);
+	oldtype = LIBC_CANCEL_ASYNC();
+	result = __NC(fcntl64)(fd, cmd, arg);
 	LIBC_CANCEL_RESET(oldtype);
 	return result;
 # endif
diff --git a/libc/sysdeps/linux/common/bits/mman-common.h b/libc/sysdeps/linux/common/bits/mman-common.h
index 6cde5da..5b20da4 100644
--- a/libc/sysdeps/linux/common/bits/mman-common.h
+++ b/libc/sysdeps/linux/common/bits/mman-common.h
@@ -83,26 +83,29 @@ 
 # define MREMAP_FIXED	2
 #endif
 
+/* only define for MMU targets, no-MMU does not support madvise.  */
+#ifdef __ARCH_USE_MMU__
 /* Advice to `madvise'.  */
-#ifdef __USE_BSD
-# define MADV_NORMAL	  0	/* No further special treatment.  */
-# define MADV_RANDOM	  1	/* Expect random page references.  */
-# define MADV_SEQUENTIAL  2	/* Expect sequential page references.  */
-# define MADV_WILLNEED	  3	/* Will need these pages.  */
-# define MADV_DONTNEED	  4	/* Don't need these pages.  */
-# define MADV_REMOVE	  9	/* Remove these pages and resources.  */
-# define MADV_DONTFORK	  10	/* Do not inherit across fork.  */
-# define MADV_DOFORK	  11	/* Do inherit across fork.  */
-# define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
-# define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
-# define MADV_HWPOISON	  100	/* Poison a page for testing.  */
-#endif
+# ifdef __USE_BSD
+#  define MADV_NORMAL	  0	/* No further special treatment.  */
+#  define MADV_RANDOM	  1	/* Expect random page references.  */
+#  define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+#  define MADV_WILLNEED	  3	/* Will need these pages.  */
+#  define MADV_DONTNEED	  4	/* Don't need these pages.  */
+#  define MADV_REMOVE	  9	/* Remove these pages and resources.  */
+#  define MADV_DONTFORK	  10	/* Do not inherit across fork.  */
+#  define MADV_DOFORK	  11	/* Do inherit across fork.  */
+#  define MADV_MERGEABLE  12	/* KSM may merge identical pages.  */
+#  define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
+#  define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+# endif
 
 /* The POSIX people had to invent similar names for the same things.  */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
-# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
-# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
-# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
-# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+# ifdef __USE_XOPEN2K
+#  define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+#  define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+#  define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+#  define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+#  define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+# endif
 #endif
diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h
index 86fe26c..3665345 100644
--- a/libc/sysdeps/linux/common/bits/syscalls-common.h
+++ b/libc/sysdeps/linux/common/bits/syscalls-common.h
@@ -42,10 +42,11 @@ 
 # define INLINE_SYSCALL_NCS(num, nr, args...)				\
 (__extension__								\
  ({									\
+	long __res;							\
 	INTERNAL_SYSCALL_DECL(__err);					\
 	(__extension__							\
 	 ({								\
-	   long __res = INTERNAL_SYSCALL_NCS(num, __err, nr, args);	\
+	   __res = INTERNAL_SYSCALL_NCS(num, __err, nr, args);		\
 	   if (unlikely(INTERNAL_SYSCALL_ERROR_P(__res, __err))) {	\
 		__set_errno(INTERNAL_SYSCALL_ERRNO(__res, __err));	\
 		__res = -1L;						\
@@ -59,8 +60,9 @@ 
 #ifndef INLINE_SYSCALL_NOERR_NCS
 # define INLINE_SYSCALL_NOERR_NCS(num, nr, args...)			\
 ({									\
+	long __res;							\
 	INTERNAL_SYSCALL_DECL(__err);					\
-	long __res = INTERNAL_SYSCALL_NCS(num, __err, nr, args);	\
+	__res = INTERNAL_SYSCALL_NCS(num, __err, nr, args);		\
 	__res;								\
 })
 #endif
diff --git a/libc/sysdeps/linux/common/ioctl.c b/libc/sysdeps/linux/common/ioctl.c
index 9a00e61..374b624 100644
--- a/libc/sysdeps/linux/common/ioctl.c
+++ b/libc/sysdeps/linux/common/ioctl.c
@@ -20,6 +20,9 @@  int ioctl(int fd, unsigned long int request, ...)
 {
 	void *arg;
 	va_list list;
+#ifdef __NEW_THREADS
+	int oldtype, result;
+#endif
 
 	va_start(list, request);
 	arg = va_arg(list, void *);
@@ -28,8 +31,8 @@  int ioctl(int fd, unsigned long int request, ...)
 	if (SINGLE_THREAD_P)
 		return __syscall_ioctl(fd, request, arg);
 #ifdef __NEW_THREADS
-	int oldtype = LIBC_CANCEL_ASYNC ();
-	int result = __syscall_ioctl(fd, request, arg);
+	oldtype = LIBC_CANCEL_ASYNC ();
+	result = __syscall_ioctl(fd, request, arg);
 	LIBC_CANCEL_RESET (oldtype);
 	return result;
 #endif
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index fd37ea0..bfcb341 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -28,6 +28,9 @@  int __open_nocancel(const char *, int, mode_t) __nonnull ((1)) attribute_hidden;
 int open(const char *file, int oflag, ...)
 {
 	mode_t mode = 0;
+#ifdef __NEW_THREADS
+	int oldtype, result;
+#endif
 
 	if (oflag & O_CREAT) {
 		va_list arg;
@@ -44,11 +47,11 @@  int open(const char *file, int oflag, ...)
 #endif
 
 #ifdef __NEW_THREADS
-	int oldtype = LIBC_CANCEL_ASYNC ();
+	oldtype = LIBC_CANCEL_ASYNC ();
 # if defined(__NR_open)
-	int result = __NC(open)(file, oflag, mode);
+	result = __NC(open)(file, oflag, mode);
 # else
-	int result = openat(AT_FDCWD, file, oflag, mode);
+	result = openat(AT_FDCWD, file, oflag, mode);
 # endif
 	LIBC_CANCEL_RESET (oldtype);
 	return result;
diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c
index 37fb269..eb722ec 100644
--- a/libc/sysdeps/linux/common/posix_fadvise64.c
+++ b/libc/sysdeps/linux/common/posix_fadvise64.c
@@ -22,22 +22,23 @@ 
 
 int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice)
 {
+	int ret;
 	INTERNAL_SYSCALL_DECL (err);
 	/* ARM has always been funky. */
 #if defined (__arm__) || \
     (defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) && (defined(__powerpc__) || defined(__xtensa__)))
 	/* arch with 64-bit data in even reg alignment #1: [powerpc/xtensa]
 	 * custom syscall handler (rearranges @advice to avoid register hole punch) */
-	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advice,
+	ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advice,
 			OFF64_HI_LO (offset), OFF64_HI_LO (len));
 #elif defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
 	/* arch with 64-bit data in even reg alignment #2: [arcv2/others-in-future]
 	 * stock syscall handler in kernel (reg hole punched) */
-	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 7, fd, 0,
+	ret = INTERNAL_SYSCALL (fadvise64_64, err, 7, fd, 0,
 			OFF64_HI_LO (offset), OFF64_HI_LO (len),
 			advice);
 # else
-	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
+	ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
 			OFF64_HI_LO (offset), OFF64_HI_LO (len),
 			advice);
 # endif
diff --git a/libc/sysdeps/linux/common/pselect.c b/libc/sysdeps/linux/common/pselect.c
index fbe85b7..bf2c083 100644
--- a/libc/sysdeps/linux/common/pselect.c
+++ b/libc/sysdeps/linux/common/pselect.c
@@ -36,10 +36,6 @@  static int __NC(pselect)(int nfds, fd_set *readfds, fd_set *writefds,
 	 */
 	struct timespec _ts;
 
-	if (timeout != NULL) {
-		_ts = *timeout;
-		timeout = &_ts;
-	}
 	/* Note: the system call expects 7 values but on most architectures
 	   we can only pass in 6 directly.  If there is an architecture with
 	   support for more parameters a new version of this file needs to
@@ -49,6 +45,11 @@  static int __NC(pselect)(int nfds, fd_set *readfds, fd_set *writefds,
 		__kernel_size_t  ss_len;
 	} data;
 
+	if (timeout != NULL) {
+		_ts = *timeout;
+		timeout = &_ts;
+	}
+
 	if (sigmask != NULL) {
 		data.ss = (__kernel_ulong_t) sigmask;
 		data.ss_len = __SYSCALL_SIGSET_T_SIZE;
diff --git a/libc/sysdeps/linux/common/sched_setaffinity.c b/libc/sysdeps/linux/common/sched_setaffinity.c
index 927744e..3d513ef 100644
--- a/libc/sysdeps/linux/common/sched_setaffinity.c
+++ b/libc/sysdeps/linux/common/sched_setaffinity.c
@@ -32,12 +32,13 @@  static size_t __kernel_cpumask_size;
 int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
 {
 	size_t cnt;
+	int res;
+	size_t psize = 128;
+	void *p = alloca (psize);
+
 	if (unlikely (__kernel_cpumask_size == 0)) {
-		INTERNAL_SYSCALL_DECL (err);
-		int res;
-		size_t psize = 128;
-		void *p = alloca (psize);
 
+		INTERNAL_SYSCALL_DECL (err);
 		while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (),
 					       psize, p),
 		       INTERNAL_SYSCALL_ERROR_P (res, err)
diff --git a/libc/sysdeps/linux/microblaze/sysdep.h b/libc/sysdeps/linux/microblaze/sysdep.h
index a463d33..d4b4e90 100644
--- a/libc/sysdeps/linux/microblaze/sysdep.h
+++ b/libc/sysdeps/linux/microblaze/sysdep.h
@@ -65,6 +65,35 @@ 
   SYSCALL_ERROR_HANDLER;                            \
   END (name)
 
+# undef PSEUDO_NOERRNO
+# define PSEUDO_NOERRNO(name, syscall_name, args)   \
+  .text;                                            \
+  ENTRY (name)                                      \
+    DO_CALL (syscall_name, args);
+
+# undef PSEUDO_END_NOERRNO
+# define PSEUDO_END_NOERRNO(name)                   \
+  END (name)
+
+/* The function has to return the error code.  */
+# undef  PSEUDO_ERRVAL
+# define PSEUDO_ERRVAL(name, syscall_name, args)    \
+  .text;                                            \
+  ENTRY (name)                                      \
+    DO_CALL (syscall_name, args);                   \
+
+# undef  PSEUDO_END_ERRVAL
+# define PSEUDO_END_ERRVAL(name)                    \
+  END (name)
+
+# undef ret_NOERRNO
+# define ret_NOERRNO                                \
+  rtsd r15,8; addk r0,r0,r0;
+
+# undef ret_ERRVAL
+# define ret_ERRVAL                                 \
+  rtsd r15,8; rsubk r3,r3,r0;
+
 #ifdef __PIC__
 # define SYSCALL_ERROR_LABEL_DCL 0
 # if defined _LIBC_REENTRANT
diff --git a/libnsl/Makefile b/libnsl/Makefile
deleted file mode 100644
index c8dc9b4..0000000
--- a/libnsl/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@ 
-# Makefile for uClibc
-#
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
-#
-# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#
-
-top_srcdir=../
-top_builddir=../
-include $(top_builddir)Rules.mak
-all: libs
-include Makefile.in
-include $(top_srcdir)Makerules
diff --git a/libnsl/Makefile.in b/libnsl/Makefile.in
deleted file mode 100644
index d6ee956..0000000
--- a/libnsl/Makefile.in
+++ /dev/null
@@ -1,28 +0,0 @@ 
-# Makefile for uClibc
-#
-# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
-#
-# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#
-
-subdirs += libnsl
-
-CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl $(SSP_ALL_CFLAGS)
-
-libnsl_DIR := $(top_srcdir)libnsl
-libnsl_OUT := $(top_builddir)libnsl
-
-libnsl_SRC := $(libnsl_DIR)/nsl.c
-libnsl_OBJ := $(patsubst $(libnsl_DIR)/%.c,$(libnsl_OUT)/%.o,$(libnsl_SRC))
-
-ifeq ($(DOPIC),y)
-libnsl-a-y := $(libnsl_OBJ:.o=.os)
-else
-libnsl-a-y := $(libnsl_OBJ)
-endif
-libnsl-so-y := $(libnsl_OBJ:.o=.os)
-
-objclean-y += CLEAN_libnsl
-
-CLEAN_libnsl:
-	$(do_rm) $(addprefix $(libnsl_OUT)/*., o os a)
diff --git a/libnsl/nsl.c b/libnsl/nsl.c
deleted file mode 100644
index a91ec93..0000000
--- a/libnsl/nsl.c
+++ /dev/null
@@ -1,15 +0,0 @@ 
-/* vi: set sw=4 ts=4: */
-/*
- * libnsl for uClibc
- *
- * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-void __stub2(void);
-void __stub2(void)
-{
-	return;
-}
-link_warning (__stub2, "the `libnsl' library is a stub.  Do you really need it?")
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h b/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
index e8dce9d..5b06e6f 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
@@ -78,8 +78,8 @@ 
 
 #define lll_futex_timed_wait(futexp, val, timespec, private) \
   ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
     long int __sysret;							      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
     __sysret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		      \
 			      __lll_private_flag (FUTEX_WAIT, private),	      \
 			      (val), (timespec));			      \
@@ -88,8 +88,8 @@ 
 
 #define lll_futex_wake(futexp, nr, private) \
   ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
     long int __sysret;							      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
     __sysret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		      \
 			      __lll_private_flag (FUTEX_WAKE, private),	      \
 			      (nr), 0);					      \
@@ -108,8 +108,8 @@ 
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
     long int __sysret;							      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
     __sysret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
 			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
 			      (nr_wake), (nr_move), (mutex), (val));	      \
@@ -120,8 +120,8 @@ 
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
   ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
     long int __sysret;							      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
     __sysret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
 			      __lll_private_flag (FUTEX_WAKE_OP, private),    \
 			      (nr_wake), (nr_wake2), (futexp2),		      \
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
index 2af79ca..a03e42a 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
@@ -23,12 +23,7 @@ 
 
 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
 
-#ifdef __ASSEMBLER__
-
-#undef ret
-#define ret
-
-# if !IS_IN_librt || !defined(PIC)
+# if !defined IS_IN_librt || !defined(PIC)
 #  define AC_STACK_SIZE  16  /* space for r15, async_cancel arg and 2 temp words */
 #  define AC_SET_GOT /* empty */
 #  define AC_RESTORE_GOT /* empty */
@@ -54,9 +49,7 @@  __##syscall_name##_nocancel:                                         \
     DO_CALL (syscall_name, args);                                    \
     addik r4, r0, -4095;                                             \
     cmpu  r4, r4, r3;                                                \
-    rsubk   r3,r3,r0;						     \
-    rtsd    r15,8;						     \
-    addik   r3,r0,-1;						     \
+    bgei  r4, SYSCALL_ERROR_LABEL;                                   \
     rtsd  r15, 8;                                                    \
     nop;                                                             \
   .size __##syscall_name##_nocancel, .-__##syscall_name##_nocancel;  \
@@ -78,9 +71,7 @@  L(pseudo_cancel):                                                    \
     addik r1, r1, AC_STACK_SIZE;                                     \
     addik r4, r0, -4095;                                             \
     cmpu  r4, r4, r3;                                                \
-    rsubk   r3,r3,r0;						     \
-    rtsd    r15,8;						     \
-    addik   r3,r0,-1;						     \
+    bgei  r4, SYSCALL_ERROR_LABEL;                                   \
     rtsd  r15, 8;                                                    \
     nop;
 
@@ -126,14 +117,35 @@  L(pseudo_cancel):                                                    \
 #  error Unsupported library
 # endif
 
-#define SINGLE_THREAD_P(reg)                                         \
-     lwi reg, r0, MULTIPLE_THREADS_OFFSET(reg)
-
-#else /* !__ASSEMBLER__ */
-# define SINGLE_THREAD_P                                             \
+#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#  ifndef __ASSEMBLER__
+extern int __local_multiple_threads attribute_hidden;
+#   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
+#  else
+#   if !defined PIC
+#    define SINGLE_THREAD_P(reg) lwi reg, r0, __local_multiple_threads;
+#   else
+#    define SINGLE_THREAD_P(reg)                                     \
+      mfs   reg, rpc;                                                \
+      addik reg, reg, _GLOBAL_OFFSET_TABLE_+8;                       \
+      lwi   reg, reg, __local_multiple_threads@GOT;                  \
+      lwi   reg, reg, 0;
+#   endif
+#  endif
+# else
+#  ifndef __ASSEMBLER__
+#   define SINGLE_THREAD_P                                           \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,                      \
                                    header.multiple_threads) == 0, 1)
+#  else
+#   define SINGLE_THREAD_P(reg)                                      \
+     lwi reg, r0, MULTIPLE_THREADS_OFFSET(reg)
+#  endif
+# endif
+
+#elif !defined __ASSEMBLER__
 
-#endif /* __ASSEMBLER__ */
+# define SINGLE_THREAD_P (1)
+# define NO_CANCELLATION (1)
 
 #endif
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
index 908d9e1..c07498f 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
@@ -13,7 +13,7 @@  libpthread_linux_arch_SSRC = pthread_once.S pthread_rwlock_wrlock.S \
 			sem_post.S sem_timedwait.S sem_trywait.S sem_wait.S
 
 libc_linux_arch_CSRC = fork.c
-libc_linux_arch_SSRC = libc-lowlevellock.S clone.S vfork.S
+libc_linux_arch_SSRC = clone.S vfork.S
 
 ASFLAGS += -DUSE___THREAD
 
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S
deleted file mode 100644
index 3214c29..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S
+++ /dev/null
@@ -1,18 +0,0 @@ 
-/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include "lowlevellock.S"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
index 9af4ea4..bac9dd4 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
@@ -138,9 +138,6 @@ 
 	.globl	__lll_lock_wait_private
 	.type	__lll_lock_wait_private,@function
 	.hidden	__lll_lock_wait_private
-#ifndef IS_IN_libpthread
-	.weak	__lll_lock_wait_private
-#endif
 	.align	5
 	cfi_startproc
 __lll_lock_wait_private:
@@ -412,9 +409,6 @@  __lll_timedlock_wait:
 	.globl	__lll_unlock_wake_private
 	.type	__lll_unlock_wake_private,@function
 	.hidden	__lll_unlock_wake_private
-#ifndef IS_IN_libpthread
-	.weak	__lll_unlock_wake_private
-#endif
 	.align	5
 	cfi_startproc
 __lll_unlock_wake_private: