This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, origin/master, created. db8de50ec57eb6dc39e88826882b06cf5a133063


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 "GNU C Library master sources".

The branch, origin/master has been created
        at  db8de50ec57eb6dc39e88826882b06cf5a133063 (commit)

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=db8de50ec57eb6dc39e88826882b06cf5a133063

commit db8de50ec57eb6dc39e88826882b06cf5a133063
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Mon Sep 7 17:22:18 2009 -0400

        Implement new NPTL POSIX Threads ABI for HPPA.
    
        This version of the NPTL POSIX thread ABI for hppa does
        not break backwards compatibility with the the old
        Linuxthreads ABI, and is therefore suitable for release
        by distributions.
    
    	sysdeps/unix/sysv/linux/hppa/
    	* internaltypes.h: New file.
    
    	sysdeps/unix/sysv/linux/hppa/nptl/
    	* pthreadP.h: New file.
    	* pthread.h: New file.
    	* pthread_cond_broadcast.c: New file.
    	* pthread_cond_destroy.c: New file.
    	* pthread_cond_init.c: New file.
    	* pthread_cond_signal.c: New file.
    	* pthread_cond_timedwait.c: New file.
    	* pthread_cond_wait.c: New file.
    	* bits/pthreadtypes.h: Make pthread_mutex_t,
    	pthread_rwlock_t, and pthread_cond_t backwards
    	compatible.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 60480d1..bb06461 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,21 @@
+2009-04-01  Carlos O'Donell  <carlos@codesourcery.com>
+ 
+	sysdeps/unix/sysv/linux/hppa/
+	* internaltypes.h: New file.
+ 
+	sysdeps/unix/sysv/linux/hppa/nptl/
+	* pthreadP.h: New file.
+	* pthread.h: New file.
+	* pthread_cond_broadcast.c: New file.
+	* pthread_cond_destroy.c: New file.
+	* pthread_cond_init.c: New file.
+	* pthread_cond_signal.c: New file.
+	* pthread_cond_timedwait.c: New file.
+	* pthread_cond_wait.c: New file.
+	* bits/pthreadtypes.h: Make pthread_mutex_t,
+	pthread_rwlock_t, and pthread_cond_t backwards
+	compatible.
+
 2009-04-24  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/hppa/hppa1.1/s_signbit.c: New file.
diff --git a/sysdeps/unix/sysv/linux/hppa/internaltypes.h b/sysdeps/unix/sysv/linux/hppa/internaltypes.h
new file mode 100644
index 0000000..6eee0b3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/internaltypes.h
@@ -0,0 +1,79 @@
+#include_next <internaltypes.h>
+#ifndef _INTERNAL_TYPES_H_HPPA_ 
+#define _INTERNAL_TYPES_H_HPPA_ 1
+#include <atomic.h>
+
+/* In GLIBC 2.10 HPPA switched from Linuxthreads to NPTL, and in order 
+to maintain ABI compatibility with pthread_cond_t, some care had to be
+taken.
+
+The NPTL pthread_cond_t grew in size. When HPPA switched to NPTL, we
+dropped the use of ldcw, and switched to the kernel helper routine for
+compare-and-swap.  This allowed HPPA to use the 4-word 16-byte aligned
+lock words, and alignment words to store the additional pthread_cond_t
+data. Once organized properly the new NPTL pthread_cond_t was 1 word
+smaller than the Linuxthreads version.
+
+However, we were faced with the case that users may have initialized the
+pthread_cond_t with PTHREAD_COND_INITIALIZER. In this case, the first
+four words were set to one, and must be cleared before any NPTL code
+used these words.
+
+We didn't want to use LDCW, because it continues to be a source of bugs
+when applications memset pthread_cond_t to all zeroes by accident. This
+works on all other architectures where lock words are unlocked at zero.
+Remember that because of the semantics of LDCW, a locked word is set to
+zero, and an unlocked word is set to 1.
+
+Instead we used atomic_compare_and_exchange_val_acq, but we couldn't use
+this on any of the pthread_cond_t words, otherwise it might interfere
+with the current operation of the structure. To solve this problem we
+used the left over word.
+
+If the stucture was initialized by a legacy Linuxthread
+PTHREAD_COND_INITIALIZER it contained a 1, and this indicates that the
+structure requires zeroing for NPTL. The first thread to come upon a
+pthread_cond_t with a 1 in the __initializer field, will
+compare-and-swap the value, placing a 2 there which will cause all other
+threads using the same pthread_cond_t to wait for the completion of the
+initialization. Lastly, we use a store (with memory barrier) to change
+__initializer from 2 to 0. Note that the store is strongly ordered, but
+we use the PA 1.1 compatible form which is ",ma" with zero offset.
+
+In the future, when the application is recompiled with NPTL
+PTHREAD_COND_INITIALIZER it will be a quick compare-and-swap, which
+fails because __initializer is zero, and the structure will be used as
+is correctly.  */
+
+#define cond_compat_clear(var) \
+({											\
+  int tmp = 0;										\
+  var->__data.__lock = 0;								\
+  var->__data.__futex = 0;								\
+  var->__data.__mutex = NULL;								\
+  /* Clear __initializer last, to indicate initialization is done.  */			\
+  __asm__ __volatile__ ("stw,ma %1,0(%0)"						\
+			: : "r" (&var->__data.__initializer), "r" (tmp) : "memory");	\
+})
+
+#define cond_compat_check_and_clear(var) \
+({								\
+  int ret;							\
+  volatile int *value = &var->__data.__initializer;		\
+  if ((ret = atomic_compare_and_exchange_val_acq(value, 2, 1)))	\
+    {								\
+      if (ret == 1)						\
+	{							\
+	  /* Initialize structure.  */				\
+	  cond_compat_clear (var);				\
+	}							\
+      else							\
+        {							\
+	  /* Yield until structure is initialized.  */		\
+	  while (*value == 2) sched_yield ();			\
+        }							\
+    }								\
+})
+
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
index d6eb975..72823a0 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
@@ -34,7 +34,7 @@
 #define __SIZEOF_PTHREAD_ATTR_T 36
 #define __SIZEOF_PTHREAD_BARRIER_T 48
 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 64
+#define __SIZEOF_PTHREAD_COND_T 48 
 #define __SIZEOF_PTHREAD_CONDATTR_T 4
 #define __SIZEOF_PTHREAD_MUTEX_T 48 
 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4
@@ -70,12 +70,22 @@ typedef union
     /* KIND must stay at this position in the structure to maintain
        binary compatibility.  */
     int __kind;
+    /* The old 4-word 16-byte aligned lock. This is initalized
+       to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER. 
+       Unused in NPTL.  */
+    int __compat_padding[4];
+    /* In the old structure there are 4 words left due to alignment.
+       In NPTL two words are used.  */
     unsigned int __nusers;
     __extension__ union
     {
       int __spins;
       __pthread_slist_t __list;
     };
+    /* Two more words are left before the NPTL
+       pthread_mutex_t is larger than Linuxthreads.  */
+    int __reserved1;
+    int __reserved2;
   } __data;
   char __size[__SIZEOF_PTHREAD_MUTEX_T];
   long int __align;
@@ -89,19 +99,37 @@ typedef union
 
 
 /* Data structure for conditional variable handling.  The structure of
-   the attribute type is not exposed on purpose.  */
+   the attribute type is not exposed on purpose. However, this structure
+   is exposed via PTHREAD_COND_INITIALIZER, and because of this, the
+   Linuxthreads version sets the first four ints to one. In the NPTL
+   version we must check, in every function using pthread_cond_t, 
+   for the static Linuxthreads initializer and clear the appropriate
+   words. */
 typedef union
 {
   struct
   {
+    /* In the old Linuxthreads pthread_cond_t, this is the
+       start of the 4-word lock structure, the next four words
+       are set all to 1 by the Linuxthreads 
+       PTHREAD_COND_INITIALIZER.  */
     int __lock;
+    /* Tracks the initialization of this structure:
+       0  initialized with NPTL PTHREAD_COND_INITIALIZER.
+       1  initialized with Linuxthreads PTHREAD_COND_INITIALIZER.
+       2  initialization in progress.  */
+    int __initializer;
     unsigned int __futex;
+    void *__mutex;
+    /* In the old Linuxthreads this would have been the start
+       of the pthread_fastlock status word.  */
     __extension__ unsigned long long int __total_seq;
     __extension__ unsigned long long int __wakeup_seq;
     __extension__ unsigned long long int __woken_seq;
-    void *__mutex;
     unsigned int __nwaiters;
     unsigned int __broadcast_seq;
+    /* The NPTL pthread_cond_t is exactly the same size as
+       the Linuxthreads version, there are no words to spare.  */
   } __data;
   char __size[__SIZEOF_PTHREAD_COND_T];
   __extension__ long long int __align;
@@ -129,19 +157,34 @@ typedef union
 {
   struct
   {
+    /* In the old Linuxthreads pthread_rwlock_t, this is the
+       start of the 4-word 16-byte algned lock structure. The
+       next four words are all set to 1 by the Linuxthreads
+       PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL.  */
+    int __compat_padding[4];
     int __lock;
     unsigned int __nr_readers;
     unsigned int __readers_wakeup;
     unsigned int __writer_wakeup;
     unsigned int __nr_readers_queued;
     unsigned int __nr_writers_queued;
+    int __writer;
+    /* An unused word, reserved for future use. It was added
+       to maintain the location of the flags from the Linuxthreads
+       layout of this structure.  */
+    int __reserved1;
     /* FLAGS must stay at this position in the structure to maintain
        binary compatibility.  */
     unsigned char __pad2;
     unsigned char __pad1;
     unsigned char __shared;
     unsigned char __flags;
-    int __writer;
+    /* The NPTL pthread_rwlock_t is 4 words smaller than the
+       Linuxthreads version. One word is in the middle of the
+       structure, the other three are at the end.  */
+    int __reserved2;
+    int __reserved3;
+    int __reserved4;
   } __data;
   char __size[__SIZEOF_PTHREAD_RWLOCK_T];
   long int __align;
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h b/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h
new file mode 100644
index 0000000..55a7b17
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h
@@ -0,0 +1,1180 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _PTHREAD_H
+#define _PTHREAD_H	1
+
+#include <features.h>
+#include <endian.h>
+#include <sched.h>
+#include <time.h>
+
+#define __need_sigset_t
+#include <signal.h>
+#include <bits/pthreadtypes.h>
+#include <bits/setjmp.h>
+#include <bits/wordsize.h>
+
+
+/* Detach state.  */
+enum
+{
+  PTHREAD_CREATE_JOINABLE,
+#define PTHREAD_CREATE_JOINABLE	PTHREAD_CREATE_JOINABLE
+  PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED	PTHREAD_CREATE_DETACHED
+};
+
+
+/* Mutex types.  */
+enum
+{
+  PTHREAD_MUTEX_TIMED_NP,
+  PTHREAD_MUTEX_RECURSIVE_NP,
+  PTHREAD_MUTEX_ERRORCHECK_NP,
+  PTHREAD_MUTEX_ADAPTIVE_NP
+#ifdef __USE_UNIX98
+  ,
+  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
+  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+#endif
+#ifdef __USE_GNU
+  /* For compatibility.  */
+  , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
+#endif
+};
+
+
+#ifdef __USE_XOPEN2K
+/* Robust mutex or not flags.  */
+enum
+{
+  PTHREAD_MUTEX_STALLED,
+  PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
+  PTHREAD_MUTEX_ROBUST,
+  PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
+};
+#endif
+
+
+#ifdef __USE_UNIX98
+/* Mutex protocols.  */
+enum
+{
+  PTHREAD_PRIO_NONE,
+  PTHREAD_PRIO_INHERIT,
+  PTHREAD_PRIO_PROTECT
+};
+#endif
+
+
+/* Mutex initializers.  */
+#if __WORDSIZE == 64
+# define PTHREAD_MUTEX_INITIALIZER \
+  { { 0, 0, 0, 0, 0, 0, { 0, 0 } } }
+# ifdef __USE_GNU
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0, 0 } } }
+#  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0, 0 } } }
+#  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0, 0 } } }
+# endif
+#else
+# define PTHREAD_MUTEX_INITIALIZER \
+  { { 0, 0, 0, 0, 0, { 0 } } }
+# ifdef __USE_GNU
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }
+#  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } }
+#  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } }
+# endif
+#endif
+
+
+/* Read-write lock types.  */
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+enum
+{
+  PTHREAD_RWLOCK_PREFER_READER_NP,
+  PTHREAD_RWLOCK_PREFER_WRITER_NP,
+  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
+};
+
+/* Read-write lock initializers.  */
+# define PTHREAD_RWLOCK_INITIALIZER \
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+# ifdef __USE_GNU
+#  if __WORDSIZE == 64
+#   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,					      \
+	PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
+#  else
+#   if __BYTE_ORDER == __LITTLE_ENDIAN
+#    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+  { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
+      0, 0, 0, 0 } }
+#   else
+#    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
+      0 } }
+#   endif
+#  endif
+# endif
+#endif  /* Unix98 or XOpen2K */
+
+
+/* Scheduler inheritance.  */
+enum
+{
+  PTHREAD_INHERIT_SCHED,
+#define PTHREAD_INHERIT_SCHED   PTHREAD_INHERIT_SCHED
+  PTHREAD_EXPLICIT_SCHED
+#define PTHREAD_EXPLICIT_SCHED  PTHREAD_EXPLICIT_SCHED
+};
+
+
+/* Scope handling.  */
+enum
+{
+  PTHREAD_SCOPE_SYSTEM,
+#define PTHREAD_SCOPE_SYSTEM    PTHREAD_SCOPE_SYSTEM
+  PTHREAD_SCOPE_PROCESS
+#define PTHREAD_SCOPE_PROCESS   PTHREAD_SCOPE_PROCESS
+};
+
+
+/* Process shared or private flag.  */
+enum
+{
+  PTHREAD_PROCESS_PRIVATE,
+#define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
+  PTHREAD_PROCESS_SHARED
+#define PTHREAD_PROCESS_SHARED  PTHREAD_PROCESS_SHARED
+};
+
+
+
+/* Conditional variable handling.  */
+#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
+
+
+/* Cleanup buffers */
+struct _pthread_cleanup_buffer
+{
+  void (*__routine) (void *);             /* Function to call.  */
+  void *__arg;                            /* Its argument.  */
+  int __canceltype;                       /* Saved cancellation type. */
+  struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions.  */
+};
+
+/* Cancellation */
+enum
+{
+  PTHREAD_CANCEL_ENABLE,
+#define PTHREAD_CANCEL_ENABLE   PTHREAD_CANCEL_ENABLE
+  PTHREAD_CANCEL_DISABLE
+#define PTHREAD_CANCEL_DISABLE  PTHREAD_CANCEL_DISABLE
+};
+enum
+{
+  PTHREAD_CANCEL_DEFERRED,
+#define PTHREAD_CANCEL_DEFERRED	PTHREAD_CANCEL_DEFERRED
+  PTHREAD_CANCEL_ASYNCHRONOUS
+#define PTHREAD_CANCEL_ASYNCHRONOUS	PTHREAD_CANCEL_ASYNCHRONOUS
+};
+#define PTHREAD_CANCELED ((void *) -1)
+
+
+/* Single execution handling.  */
+#define PTHREAD_ONCE_INIT 0
+
+
+#ifdef __USE_XOPEN2K
+/* Value returned by 'pthread_barrier_wait' for one of the threads after
+   the required number of threads have called this function.
+   -1 is distinct from 0 and all errno constants */
+# define PTHREAD_BARRIER_SERIAL_THREAD -1
+#endif
+
+
+__BEGIN_DECLS
+
+/* Create a new thread, starting with execution of START-ROUTINE
+   getting passed ARG.  Creation attributed come from ATTR.  The new
+   handle is stored in *NEWTHREAD.  */
+extern int pthread_create (pthread_t *__restrict __newthread,
+			   __const pthread_attr_t *__restrict __attr,
+			   void *(*__start_routine) (void *),
+			   void *__restrict __arg) __THROW __nonnull ((1, 3));
+
+/* Terminate calling thread.
+
+   The registered cleanup handlers are called via exception handling
+   so we cannot mark this function with __THROW.*/
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+
+/* Make calling thread wait for termination of the thread TH.  The
+   exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
+   is not NULL.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int pthread_join (pthread_t __th, void **__thread_return);
+
+#ifdef __USE_GNU
+/* Check whether thread TH has terminated.  If yes return the status of
+   the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL.  */
+extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
+
+/* Make calling thread wait for termination of the thread TH, but only
+   until TIMEOUT.  The exit status of the thread is stored in
+   *THREAD_RETURN, if THREAD_RETURN is not NULL.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
+				 __const struct timespec *__abstime);
+#endif
+
+/* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
+   The resources of TH will therefore be freed immediately when it
+   terminates, instead of waiting for another thread to perform PTHREAD_JOIN
+   on it.  */
+extern int pthread_detach (pthread_t __th) __THROW;
+
+
+/* Obtain the identifier of the current thread.  */
+extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));
+
+/* Compare two thread identifiers.  */
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
+
+
+/* Thread attribute handling.  */
+
+/* Initialize thread attribute *ATTR with default attributes
+   (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER,
+    no user-provided stack).  */
+extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
+
+/* Destroy thread attribute *ATTR.  */
+extern int pthread_attr_destroy (pthread_attr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Get detach state attribute.  */
+extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
+					int *__detachstate)
+     __THROW __nonnull ((1, 2));
+
+/* Set detach state attribute.  */
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+					int __detachstate)
+     __THROW __nonnull ((1));
+
+
+/* Get the size of the guard area created for stack overflow protection.  */
+extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
+				      size_t *__guardsize)
+     __THROW __nonnull ((1, 2));
+
+/* Set the size of the guard area created for stack overflow protection.  */
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+				      size_t __guardsize)
+     __THROW __nonnull ((1));
+
+
+/* Return in *PARAM the scheduling parameters of *ATTR.  */
+extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
+				       __attr,
+				       struct sched_param *__restrict __param)
+     __THROW __nonnull ((1, 2));
+
+/* Set scheduling parameters (priority, etc) in *ATTR according to PARAM.  */
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+				       __const struct sched_param *__restrict
+				       __param) __THROW __nonnull ((1, 2));
+
+/* Return in *POLICY the scheduling policy of *ATTR.  */
+extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
+					__attr, int *__restrict __policy)
+     __THROW __nonnull ((1, 2));
+
+/* Set scheduling policy in *ATTR according to POLICY.  */
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
+     __THROW __nonnull ((1));
+
+/* Return in *INHERIT the scheduling inheritance mode of *ATTR.  */
+extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
+					 __attr, int *__restrict __inherit)
+     __THROW __nonnull ((1, 2));
+
+/* Set scheduling inheritance mode in *ATTR according to INHERIT.  */
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+					 int __inherit)
+     __THROW __nonnull ((1));
+
+
+/* Return in *SCOPE the scheduling contention scope of *ATTR.  */
+extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
+				  int *__restrict __scope)
+     __THROW __nonnull ((1, 2));
+
+/* Set scheduling contention scope in *ATTR according to SCOPE.  */
+extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
+     __THROW __nonnull ((1));
+
+/* Return the previously set address for the stack.  */
+extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
+				      __attr, void **__restrict __stackaddr)
+     __THROW __nonnull ((1, 2)) __attribute_deprecated__;
+
+/* Set the starting address of the stack of the thread to be created.
+   Depending on whether the stack grows up or down the value must either
+   be higher or lower than all the address in the memory block.  The
+   minimal size of the block must be PTHREAD_STACK_MIN.  */
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+				      void *__stackaddr)
+     __THROW __nonnull ((1)) __attribute_deprecated__;
+
+/* Return the currently used minimal stack size.  */
+extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
+				      __attr, size_t *__restrict __stacksize)
+     __THROW __nonnull ((1, 2));
+
+/* Add information about the minimum stack size needed for the thread
+   to be started.  This size must never be less than PTHREAD_STACK_MIN
+   and must also not exceed the system limits.  */
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+				      size_t __stacksize)
+     __THROW __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Return the previously set address for the stack.  */
+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
+				  void **__restrict __stackaddr,
+				  size_t *__restrict __stacksize)
+     __THROW __nonnull ((1, 2, 3));
+
+/* The following two interfaces are intended to replace the last two.  They
+   require setting the address as well as the size since only setting the
+   address will make the implementation on some architectures impossible.  */
+extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+				  size_t __stacksize) __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_GNU
+/* Thread created with attribute ATTR will be limited to run only on
+   the processors represented in CPUSET.  */
+extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
+					size_t __cpusetsize,
+					__const cpu_set_t *__cpuset)
+     __THROW __nonnull ((1, 3));
+
+/* Get bit set in CPUSET representing the processors threads created with
+   ATTR can run on.  */
+extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
+					size_t __cpusetsize,
+					cpu_set_t *__cpuset)
+     __THROW __nonnull ((1, 3));
+
+
+/* Initialize thread attribute *ATTR with attributes corresponding to the
+   already running thread TH.  It shall be called on uninitialized ATTR
+   and destroyed with pthread_attr_destroy when no longer needed.  */
+extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
+     __THROW __nonnull ((2));
+#endif
+
+
+/* Functions for scheduling control.  */
+
+/* Set the scheduling parameters for TARGET_THREAD according to POLICY
+   and *PARAM.  */
+extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
+				  __const struct sched_param *__param)
+     __THROW __nonnull ((3));
+
+/* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */
+extern int pthread_getschedparam (pthread_t __target_thread,
+				  int *__restrict __policy,
+				  struct sched_param *__restrict __param)
+     __THROW __nonnull ((2, 3));
+
+/* Set the scheduling priority for TARGET_THREAD.  */
+extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
+     __THROW;
+
+
+#ifdef __USE_UNIX98
+/* Determine level of concurrency.  */
+extern int pthread_getconcurrency (void) __THROW;
+
+/* Set new concurrency level to LEVEL.  */
+extern int pthread_setconcurrency (int __level) __THROW;
+#endif
+
+#ifdef __USE_GNU
+/* Yield the processor to another thread or process.
+   This function is similar to the POSIX `sched_yield' function but
+   might be differently implemented in the case of a m-on-n thread
+   implementation.  */
+extern int pthread_yield (void) __THROW;
+
+
+/* Limit specified thread TH to run only on the processors represented
+   in CPUSET.  */
+extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
+				   __const cpu_set_t *__cpuset)
+     __THROW __nonnull ((3));
+
+/* Get bit set in CPUSET representing the processors TH can run on.  */
+extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
+				   cpu_set_t *__cpuset)
+     __THROW __nonnull ((3));
+#endif
+
+
+/* Functions for handling initialization.  */
+
+/* Guarantee that the initialization function INIT_ROUTINE will be called
+   only once, even if pthread_once is executed several times with the
+   same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
+   extern variable initialized to PTHREAD_ONCE_INIT.
+
+   The initialization functions might throw exception which is why
+   this function is not marked with __THROW.  */
+extern int pthread_once (pthread_once_t *__once_control,
+			 void (*__init_routine) (void)) __nonnull ((1, 2));
+
+
+/* Functions for handling cancellation.
+
+   Note that these functions are explicitly not marked to not throw an
+   exception in C++ code.  If cancellation is implemented by unwinding
+   this is necessary to have the compiler generate the unwind information.  */
+
+/* Set cancelability state of current thread to STATE, returning old
+   state in *OLDSTATE if OLDSTATE is not NULL.  */
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+
+/* Set cancellation state of current thread to TYPE, returning the old
+   type in *OLDTYPE if OLDTYPE is not NULL.  */
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+
+/* Cancel THREAD immediately or at the next possibility.  */
+extern int pthread_cancel (pthread_t __th);
+
+/* Test for pending cancellation for the current thread and terminate
+   the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
+   cancelled.  */
+extern void pthread_testcancel (void);
+
+
+/* Cancellation handling with integration into exception handling.  */
+
+typedef struct
+{
+  struct
+  {
+    __jmp_buf __cancel_jmp_buf;
+    int __mask_was_saved;
+  } __cancel_jmp_buf[1];
+  void *__pad[4];
+} __pthread_unwind_buf_t __attribute__ ((__aligned__));
+
+/* No special attributes by default.  */
+#ifndef __cleanup_fct_attribute
+# define __cleanup_fct_attribute
+#endif
+
+
+/* Structure to hold the cleanup handler information.  */
+struct __pthread_cleanup_frame
+{
+  void (*__cancel_routine) (void *);
+  void *__cancel_arg;
+  int __do_it;
+  int __cancel_type;
+};
+
+#if defined __GNUC__ && defined __EXCEPTIONS
+# ifdef __cplusplus
+/* Class to handle cancellation handler invocation.  */
+class __pthread_cleanup_class
+{
+  void (*__cancel_routine) (void *);
+  void *__cancel_arg;
+  int __do_it;
+  int __cancel_type;
+
+ public:
+  __pthread_cleanup_class (void (*__fct) (void *), void *__arg)
+    : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }
+  ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }
+  void __setdoit (int __newval) { __do_it = __newval; }
+  void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,
+					   &__cancel_type); }
+  void __restore () const { pthread_setcanceltype (__cancel_type, 0); }
+};
+
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+   when the thread is canceled or calls pthread_exit.  ROUTINE will also
+   be called with arguments ARG when the matching pthread_cleanup_pop
+   is executed with non-zero EXECUTE argument.
+
+   pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+   be used in matching pairs at the same nesting level of braces.  */
+#  define pthread_cleanup_push(routine, arg) \
+  do {									      \
+    __pthread_cleanup_class __clframe (routine, arg)
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+   If EXECUTE is non-zero, the handler function is called. */
+#  define pthread_cleanup_pop(execute) \
+    __clframe.__setdoit (execute);					      \
+  } while (0)
+
+#  ifdef __USE_GNU
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+   saves the current cancellation type and sets it to deferred
+   cancellation.  */
+#   define pthread_cleanup_push_defer_np(routine, arg) \
+  do {									      \
+    __pthread_cleanup_class __clframe (routine, arg);			      \
+    __clframe.__defer ()
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+   restores the cancellation type that was in effect when the matching
+   pthread_cleanup_push_defer was called.  */
+#   define pthread_cleanup_pop_restore_np(execute) \
+    __clframe.__restore ();						      \
+    __clframe.__setdoit (execute);					      \
+  } while (0)
+#  endif
+# else
+/* Function called to call the cleanup handler.  As an extern inline
+   function the compiler is free to decide inlining the change when
+   needed or fall back on the copy which must exist somewhere
+   else.  */
+__extern_inline void
+__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
+{
+  if (__frame->__do_it)
+    __frame->__cancel_routine (__frame->__cancel_arg);
+}
+
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+   when the thread is canceled or calls pthread_exit.  ROUTINE will also
+   be called with arguments ARG when the matching pthread_cleanup_pop
+   is executed with non-zero EXECUTE argument.
+
+   pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+   be used in matching pairs at the same nesting level of braces.  */
+#  define pthread_cleanup_push(routine, arg) \
+  do {									      \
+    struct __pthread_cleanup_frame __clframe				      \
+      __attribute__ ((__cleanup__ (__pthread_cleanup_routine)))		      \
+      = { .__cancel_routine = (routine), .__cancel_arg = (arg),	 	      \
+	  .__do_it = 1 };
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+   If EXECUTE is non-zero, the handler function is called. */
+#  define pthread_cleanup_pop(execute) \
+    __clframe.__do_it = (execute);					      \
+  } while (0)
+
+#  ifdef __USE_GNU
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+   saves the current cancellation type and sets it to deferred
+   cancellation.  */
+#   define pthread_cleanup_push_defer_np(routine, arg) \
+  do {									      \
+    struct __pthread_cleanup_frame __clframe				      \
+      __attribute__ ((__cleanup__ (__pthread_cleanup_routine)))		      \
+      = { .__cancel_routine = (routine), .__cancel_arg = (arg),		      \
+	  .__do_it = 1 };						      \
+    (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,		      \
+				  &__clframe.__cancel_type)
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+   restores the cancellation type that was in effect when the matching
+   pthread_cleanup_push_defer was called.  */
+#   define pthread_cleanup_pop_restore_np(execute) \
+    (void) pthread_setcanceltype (__clframe.__cancel_type, NULL);	      \
+    __clframe.__do_it = (execute);					      \
+  } while (0)
+#  endif
+# endif
+#else
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+   when the thread is canceled or calls pthread_exit.  ROUTINE will also
+   be called with arguments ARG when the matching pthread_cleanup_pop
+   is executed with non-zero EXECUTE argument.
+
+   pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+   be used in matching pairs at the same nesting level of braces.  */
+# define pthread_cleanup_push(routine, arg) \
+  do {									      \
+    __pthread_unwind_buf_t __cancel_buf;				      \
+    void (*__cancel_routine) (void *) = (routine);			      \
+    void *__cancel_arg = (arg);						      \
+    int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *)	      \
+				      __cancel_buf.__cancel_jmp_buf, 0);      \
+    if (__builtin_expect (not_first_call, 0))				      \
+      {									      \
+	__cancel_routine (__cancel_arg);				      \
+	__pthread_unwind_next (&__cancel_buf);				      \
+	/* NOTREACHED */						      \
+      }									      \
+									      \
+    __pthread_register_cancel (&__cancel_buf);				      \
+    do {
+extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
+     __cleanup_fct_attribute;
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+   If EXECUTE is non-zero, the handler function is called. */
+# define pthread_cleanup_pop(execute) \
+      do { } while (0);/* Empty to allow label before pthread_cleanup_pop.  */\
+    } while (0);							      \
+    __pthread_unregister_cancel (&__cancel_buf);			      \
+    if (execute)							      \
+      __cancel_routine (__cancel_arg);					      \
+  } while (0)
+extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
+  __cleanup_fct_attribute;
+
+# ifdef __USE_GNU
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+   saves the current cancellation type and sets it to deferred
+   cancellation.  */
+#  define pthread_cleanup_push_defer_np(routine, arg) \
+  do {									      \
+    __pthread_unwind_buf_t __cancel_buf;				      \
+    void (*__cancel_routine) (void *) = (routine);			      \
+    void *__cancel_arg = (arg);						      \
+    int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *)	      \
+				      __cancel_buf.__cancel_jmp_buf, 0);      \
+    if (__builtin_expect (not_first_call, 0))				      \
+      {									      \
+	__cancel_routine (__cancel_arg);				      \
+	__pthread_unwind_next (&__cancel_buf);				      \
+	/* NOTREACHED */						      \
+      }									      \
+									      \
+    __pthread_register_cancel_defer (&__cancel_buf);			      \
+    do {
+extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf)
+     __cleanup_fct_attribute;
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+   restores the cancellation type that was in effect when the matching
+   pthread_cleanup_push_defer was called.  */
+#  define pthread_cleanup_pop_restore_np(execute) \
+      do { } while (0);/* Empty to allow label before pthread_cleanup_pop.  */\
+    } while (0);							      \
+    __pthread_unregister_cancel_restore (&__cancel_buf);		      \
+    if (execute)							      \
+      __cancel_routine (__cancel_arg);					      \
+  } while (0)
+extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
+  __cleanup_fct_attribute;
+# endif
+
+/* Internal interface to initiate cleanup.  */
+extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
+     __cleanup_fct_attribute __attribute__ ((__noreturn__))
+# ifndef SHARED
+     __attribute__ ((__weak__))
+# endif
+     ;
+#endif
+
+/* Function used in the macros.  */
+struct __jmp_buf_tag;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
+
+
+/* Mutex handling.  */
+
+/* Initialize a mutex.  */
+extern int pthread_mutex_init (pthread_mutex_t *__mutex,
+			       __const pthread_mutexattr_t *__mutexattr)
+     __THROW __nonnull ((1));
+
+/* Destroy a mutex.  */
+extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
+     __THROW __nonnull ((1));
+
+/* Try locking a mutex.  */
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
+     __THROW __nonnull ((1));
+
+/* Lock a mutex.  */
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
+     __THROW __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Wait until lock becomes available, or specified time passes. */
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+                                    __const struct timespec *__restrict
+                                    __abstime) __THROW __nonnull ((1, 2));
+#endif
+
+/* Unlock a mutex.  */
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
+     __THROW __nonnull ((1));
+
+
+#ifdef __USE_UNIX98
+/* Get the priority ceiling of MUTEX.  */
+extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
+					 __restrict __mutex,
+					 int *__restrict __prioceiling)
+     __THROW __nonnull ((1, 2));
+
+/* Set the priority ceiling of MUTEX to PRIOCEILING, return old
+   priority ceiling value in *OLD_CEILING.  */
+extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
+					 int __prioceiling,
+					 int *__restrict __old_ceiling)
+     __THROW __nonnull ((1, 3));
+#endif
+
+
+#ifdef __USE_XOPEN2K8
+/* Declare the state protected by MUTEX as consistent.  */
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
+     __THROW __nonnull ((1));
+# ifdef __USE_GNU
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
+     __THROW __nonnull ((1));
+# endif
+#endif
+
+
+/* Functions for handling mutex attributes.  */
+
+/* Initialize mutex attribute object ATTR with default attributes
+   (kind is PTHREAD_MUTEX_TIMED_NP).  */
+extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Destroy mutex attribute object ATTR.  */
+extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Get the process-shared flag of the mutex attribute ATTR.  */
+extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
+					 __restrict __attr,
+					 int *__restrict __pshared)
+     __THROW __nonnull ((1, 2));
+
+/* Set the process-shared flag of the mutex attribute ATTR.  */
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+					 int __pshared)
+     __THROW __nonnull ((1));
+
+#ifdef __USE_UNIX98
+/* Return in *KIND the mutex kind attribute in *ATTR.  */
+extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
+				      __attr, int *__restrict __kind)
+     __THROW __nonnull ((1, 2));
+
+/* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL,
+   PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or
+   PTHREAD_MUTEX_DEFAULT).  */
+extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
+     __THROW __nonnull ((1));
+
+/* Return in *PROTOCOL the mutex protocol attribute in *ATTR.  */
+extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
+					  __restrict __attr,
+					  int *__restrict __protocol)
+     __THROW __nonnull ((1, 2));
+
+/* Set the mutex protocol attribute in *ATTR to PROTOCOL (either
+   PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT).  */
+extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
+					  int __protocol)
+     __THROW __nonnull ((1));
+
+/* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR.  */
+extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
+					     __restrict __attr,
+					     int *__restrict __prioceiling)
+     __THROW __nonnull ((1, 2));
+
+/* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING.  */
+extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
+					     int __prioceiling)
+     __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_XOPEN2K
+/* Get the robustness flag of the mutex attribute ATTR.  */
+extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
+					int *__robustness)
+     __THROW __nonnull ((1, 2));
+# ifdef __USE_GNU
+extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
+					   int *__robustness)
+     __THROW __nonnull ((1, 2));
+# endif
+
+/* Set the robustness flag of the mutex attribute ATTR.  */
+extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
+					int __robustness)
+     __THROW __nonnull ((1));
+# ifdef __USE_GNU
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+					   int __robustness)
+     __THROW __nonnull ((1));
+# endif
+#endif
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Functions for handling read-write locks.  */
+
+/* Initialize read-write lock RWLOCK using attributes ATTR, or use
+   the default values if later is NULL.  */
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+				__const pthread_rwlockattr_t *__restrict
+				__attr) __THROW __nonnull ((1));
+
+/* Destroy read-write lock RWLOCK.  */
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
+     __THROW __nonnull ((1));
+
+/* Acquire read lock for RWLOCK.  */
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
+     __THROW __nonnull ((1));
+
+/* Try to acquire read lock for RWLOCK.  */
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
+  __THROW __nonnull ((1));
+
+# ifdef __USE_XOPEN2K
+/* Try to acquire read lock for RWLOCK or return after specfied time.  */
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+				       __const struct timespec *__restrict
+				       __abstime) __THROW __nonnull ((1, 2));
+# endif
+
+/* Acquire write lock for RWLOCK.  */
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
+     __THROW __nonnull ((1));
+
+/* Try to acquire write lock for RWLOCK.  */
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
+     __THROW __nonnull ((1));
+
+# ifdef __USE_XOPEN2K
+/* Try to acquire write lock for RWLOCK or return after specfied time.  */
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+				       __const struct timespec *__restrict
+				       __abstime) __THROW __nonnull ((1, 2));
+# endif
+
+/* Unlock RWLOCK.  */
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
+     __THROW __nonnull ((1));
+
+
+/* Functions for handling read-write lock attributes.  */
+
+/* Initialize attribute object ATTR with default values.  */
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Destroy attribute object ATTR.  */
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Return current setting of process-shared attribute of ATTR in PSHARED.  */
+extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
+					  __restrict __attr,
+					  int *__restrict __pshared)
+     __THROW __nonnull ((1, 2));
+
+/* Set process-shared attribute of ATTR to PSHARED.  */
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+					  int __pshared)
+     __THROW __nonnull ((1));
+
+/* Return current setting of reader/writer preference.  */
+extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
+					  __restrict __attr,
+					  int *__restrict __pref)
+     __THROW __nonnull ((1, 2));
+
+/* Set reader/write preference.  */
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+					  int __pref) __THROW __nonnull ((1));
+#endif
+
+
+/* Functions for handling conditional variables.  */
+
+/* Initialize condition variable COND using attributes ATTR, or use
+   the default values if later is NULL.  */
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+			      __const pthread_condattr_t *__restrict
+			      __cond_attr) __THROW __nonnull ((1));
+
+/* Destroy condition variable COND.  */
+extern int pthread_cond_destroy (pthread_cond_t *__cond)
+     __THROW __nonnull ((1));
+
+/* Wake up one thread waiting for condition variable COND.  */
+extern int pthread_cond_signal (pthread_cond_t *__cond)
+     __THROW __nonnull ((1));
+
+/* Wake up all threads waiting for condition variables COND.  */
+extern int pthread_cond_broadcast (pthread_cond_t *__cond)
+     __THROW __nonnull ((1));
+
+/* Wait for condition variable COND to be signaled or broadcast.
+   MUTEX is assumed to be locked before.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+			      pthread_mutex_t *__restrict __mutex)
+     __nonnull ((1, 2));
+
+/* Wait for condition variable COND to be signaled or broadcast until
+   ABSTIME.  MUTEX is assumed to be locked before.  ABSTIME is an
+   absolute time specification; zero is the beginning of the epoch
+   (00:00:00 GMT, January 1, 1970).
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+				   pthread_mutex_t *__restrict __mutex,
+				   __const struct timespec *__restrict
+				   __abstime) __nonnull ((1, 2, 3));
+
+/* Functions for handling condition variable attributes.  */
+
+/* Initialize condition variable attribute ATTR.  */
+extern int pthread_condattr_init (pthread_condattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Destroy condition variable attribute ATTR.  */
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Get the process-shared flag of the condition variable attribute ATTR.  */
+extern int pthread_condattr_getpshared (__const pthread_condattr_t *
+                                        __restrict __attr,
+                                        int *__restrict __pshared)
+     __THROW __nonnull ((1, 2));
+
+/* Set the process-shared flag of the condition variable attribute ATTR.  */
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+                                        int __pshared) __THROW __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Get the clock selected for the conditon variable attribute ATTR.  */
+extern int pthread_condattr_getclock (__const pthread_condattr_t *
+				      __restrict __attr,
+				      __clockid_t *__restrict __clock_id)
+     __THROW __nonnull ((1, 2));
+
+/* Set the clock selected for the conditon variable attribute ATTR.  */
+extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
+				      __clockid_t __clock_id)
+     __THROW __nonnull ((1));
+#endif
+
+
+#ifdef __USE_XOPEN2K
+/* Functions to handle spinlocks.  */
+
+/* Initialize the spinlock LOCK.  If PSHARED is nonzero the spinlock can
+   be shared between different processes.  */
+extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+     __THROW __nonnull ((1));
+
+/* Destroy the spinlock LOCK.  */
+extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
+     __THROW __nonnull ((1));
+
+/* Wait until spinlock LOCK is retrieved.  */
+extern int pthread_spin_lock (pthread_spinlock_t *__lock)
+     __THROW __nonnull ((1));
+
+/* Try to lock spinlock LOCK.  */
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
+     __THROW __nonnull ((1));
+
+/* Release spinlock LOCK.  */
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
+     __THROW __nonnull ((1));
+
+
+/* Functions to handle barriers.  */
+
+/* Initialize BARRIER with the attributes in ATTR.  The barrier is
+   opened when COUNT waiters arrived.  */
+extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+				 __const pthread_barrierattr_t *__restrict
+				 __attr, unsigned int __count)
+     __THROW __nonnull ((1));
+
+/* Destroy a previously dynamically initialized barrier BARRIER.  */
+extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
+     __THROW __nonnull ((1));
+
+/* Wait on barrier BARRIER.  */
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
+     __THROW __nonnull ((1));
+
+
+/* Initialize barrier attribute ATTR.  */
+extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Destroy previously dynamically initialized barrier attribute ATTR.  */
+extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Get the process-shared flag of the barrier attribute ATTR.  */
+extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
+					   __restrict __attr,
+					   int *__restrict __pshared)
+     __THROW __nonnull ((1, 2));
+
+/* Set the process-shared flag of the barrier attribute ATTR.  */
+extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
+                                           int __pshared)
+     __THROW __nonnull ((1));
+#endif
+
+
+/* Functions for handling thread-specific data.  */
+
+/* Create a key value identifying a location in the thread-specific
+   data area.  Each thread maintains a distinct thread-specific data
+   area.  DESTR_FUNCTION, if non-NULL, is called with the value
+   associated to that key when the key is destroyed.
+   DESTR_FUNCTION is not called if the value associated is NULL when
+   the key is destroyed.  */
+extern int pthread_key_create (pthread_key_t *__key,
+			       void (*__destr_function) (void *))
+     __THROW __nonnull ((1));
+
+/* Destroy KEY.  */
+extern int pthread_key_delete (pthread_key_t __key) __THROW;
+
+/* Return current value of the thread-specific data slot identified by KEY.  */
+extern void *pthread_getspecific (pthread_key_t __key) __THROW;
+
+/* Store POINTER in the thread-specific data slot identified by KEY. */
+extern int pthread_setspecific (pthread_key_t __key,
+				__const void *__pointer) __THROW ;
+
+
+#ifdef __USE_XOPEN2K
+/* Get ID of CPU-time clock for thread THREAD_ID.  */
+extern int pthread_getcpuclockid (pthread_t __thread_id,
+				  __clockid_t *__clock_id)
+     __THROW __nonnull ((2));
+#endif
+
+
+/* Install handlers to be called when a new process is created with FORK.
+   The PREPARE handler is called in the parent process just before performing
+   FORK. The PARENT handler is called in the parent process just after FORK.
+   The CHILD handler is called in the child process.  Each of the three
+   handlers can be NULL, meaning that no handler needs to be called at that
+   point.
+   PTHREAD_ATFORK can be called several times, in which case the PREPARE
+   handlers are called in LIFO order (last added with PTHREAD_ATFORK,
+   first called before FORK), and the PARENT and CHILD handlers are called
+   in FIFO (first added, first called).  */
+
+extern int pthread_atfork (void (*__prepare) (void),
+			   void (*__parent) (void),
+			   void (*__child) (void)) __THROW;
+
+
+#ifdef __USE_EXTERN_INLINES
+/* Optimizations.  */
+__extern_inline int
+__NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
+{
+  return __thread1 == __thread2;
+}
+#endif
+
+__END_DECLS
+
+#endif	/* pthread.h */
+
+#ifndef _PTHREAD_H_HPPA_ 
+#define _PTHREAD_H_HPPA_ 1
+
+/* The pthread_cond_t initializer is compatible only with NPTL. We do not
+   want to be forwards compatible, we eventually want to drop the code 
+   that has to clear the old LT initializer.  */
+#undef PTHREAD_COND_INITIALIZER
+#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, (void *) 0, 0, 0, 0, 0, 0 } }
+
+/* The pthread_mutex_t and pthread_rwlock_t initializers are compatible
+   only with NPTL. NPTL ignores the old lock words. We do not want to be
+   forwards compatible, glibc has some code that assumes pthread_rwlock_t
+   is all zero (see nptl/tst-initializers.c).  */
+#undef PTHREAD_MUTEX_INITIALIZER
+#undef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#undef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#undef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+/* Mutex initializers.  */
+#define PTHREAD_MUTEX_INITIALIZER \
+  { { 0, 0, 0, 0, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
+#ifdef __USE_GNU
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
+#endif
+
+#undef PTHREAD_RWLOCK_INITIALIZER
+#undef PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+/* Read-write lock initializers.  */
+#define PTHREAD_RWLOCK_INITIALIZER \
+  { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+#ifdef __USE_GNU
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+  { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
+      0, 0, 0 } }
+#endif  /* Unix98 or XOpen2K */
+ 
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthreadP.h b/sysdeps/unix/sysv/linux/hppa/nptl/pthreadP.h
new file mode 100644
index 0000000..0e68ccf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthreadP.h
@@ -0,0 +1,17 @@
+#include_next <pthreadP.h>
+#ifndef _PTHREADP_H_HPPA_ 
+#define _PTHREADP_H_HPPA_ 1
+
+/* Internal cond functions.  */
+extern int __pthread_cond_broadcast_internal (pthread_cond_t *cond);
+extern int __pthread_cond_destroy_internal (pthread_cond_t *cond);
+extern int __pthread_cond_init_internal (pthread_cond_t *cond,
+                                        const pthread_condattr_t *cond_attr);
+extern int __pthread_cond_signal_internal (pthread_cond_t *cond);
+extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond,
+                                             pthread_mutex_t *mutex,
+                                             const struct timespec *abstime);
+extern int __pthread_cond_wait_internal (pthread_cond_t *cond,
+                                        pthread_mutex_t *mutex);
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_broadcast.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_broadcast.c
new file mode 100644
index 0000000..e43ce34
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_broadcast.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef INCLUDED_SELF
+# define INCLUDED_SELF
+# include <pthread_cond_broadcast.c>
+#else
+# include <pthread.h>
+# include <pthreadP.h>
+# include <internaltypes.h>
+# include <shlib-compat.h>
+int
+__pthread_cond_broadcast (cond)
+     pthread_cond_t *cond;
+{
+  cond_compat_check_and_clear (cond);
+  return __pthread_cond_broadcast_internal (cond);
+}
+versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
+                  GLIBC_2_3_2);
+# undef versioned_symbol
+# define versioned_symbol(lib, local, symbol, version)
+# undef __pthread_cond_broadcast
+# define __pthread_cond_broadcast __pthread_cond_broadcast_internal
+# include_next <pthread_cond_broadcast.c>
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_destroy.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_destroy.c
new file mode 100644
index 0000000..3b606d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_destroy.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef INCLUDED_SELF
+# define INCLUDED_SELF
+# include <pthread_cond_destroy.c>
+#else
+# include <pthread.h>
+# include <pthreadP.h>
+# include <internaltypes.h>
+# include <shlib-compat.h>
+int
+__pthread_cond_destroy (cond)
+     pthread_cond_t *cond;
+{
+  cond_compat_check_and_clear (cond);
+  return __pthread_cond_destroy_internal (cond);
+}
+versioned_symbol (libpthread, __pthread_cond_destroy, pthread_cond_destroy,
+                  GLIBC_2_3_2);
+# undef versioned_symbol
+# define versioned_symbol(lib, local, symbol, version)
+# undef __pthread_cond_destroy
+# define __pthread_cond_destroy __pthread_cond_destroy_internal
+# include_next <pthread_cond_destroy.c>
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_init.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_init.c
new file mode 100644
index 0000000..a55c285
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_init.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef INCLUDED_SELF
+# define INCLUDED_SELF
+# include <pthread_cond_init.c>
+#else
+# include <pthread.h>
+# include <pthreadP.h>
+# include <internaltypes.h>
+# include <shlib-compat.h>
+int
+__pthread_cond_init (cond, cond_attr)
+     pthread_cond_t *cond;
+     const pthread_condattr_t *cond_attr;
+{
+  cond_compat_clear (cond);
+  return __pthread_cond_init_internal (cond, cond_attr);
+}
+versioned_symbol (libpthread, __pthread_cond_init, pthread_cond_init,
+                  GLIBC_2_3_2);
+# undef versioned_symbol
+# define versioned_symbol(lib, local, symbol, version)
+# undef __pthread_cond_init
+# define __pthread_cond_init __pthread_cond_init_internal
+# include_next <pthread_cond_init.c>
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_signal.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_signal.c
new file mode 100644
index 0000000..34a9747
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_signal.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef INCLUDED_SELF
+# define INCLUDED_SELF
+# include <pthread_cond_signal.c>
+#else
+# include <pthread.h>
+# include <pthreadP.h>
+# include <internaltypes.h>
+# include <shlib-compat.h>
+int
+__pthread_cond_signal (cond)
+     pthread_cond_t *cond;
+{
+  cond_compat_check_and_clear (cond);
+  return __pthread_cond_signal_internal (cond);
+}
+versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
+                  GLIBC_2_3_2);
+# undef versioned_symbol
+# define versioned_symbol(lib, local, symbol, version)
+# undef __pthread_cond_signal
+# define __pthread_cond_signal __pthread_cond_signal_internal
+# include_next <pthread_cond_signal.c>
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_timedwait.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_timedwait.c
new file mode 100644
index 0000000..5e05621
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_timedwait.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef INCLUDED_SELF
+# define INCLUDED_SELF
+# include <pthread_cond_timedwait.c>
+#else
+# include <pthread.h>
+# include <pthreadP.h>
+# include <internaltypes.h>
+# include <shlib-compat.h>
+int
+__pthread_cond_timedwait (cond, mutex, abstime)
+     pthread_cond_t *cond;
+     pthread_mutex_t *mutex;
+     const struct timespec *abstime;
+{
+  cond_compat_check_and_clear (cond);
+  return __pthread_cond_timedwait_internal (cond, mutex, abstime);
+}
+versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
+                  GLIBC_2_3_2);
+# undef versioned_symbol
+# define versioned_symbol(lib, local, symbol, version)
+# undef __pthread_cond_timedwait
+# define __pthread_cond_timedwait __pthread_cond_timedwait_internal
+# include_next <pthread_cond_timedwait.c>
+#endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_wait.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_wait.c
new file mode 100644
index 0000000..80115ed
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_wait.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef INCLUDED_SELF
+# define INCLUDED_SELF
+# include <pthread_cond_wait.c>
+#else
+# include <pthread.h>
+# include <pthreadP.h>
+# include <internaltypes.h>
+# include <shlib-compat.h>
+int
+__pthread_cond_wait (cond, mutex)
+     pthread_cond_t *cond;
+     pthread_mutex_t *mutex;
+{
+  cond_compat_check_and_clear (cond);
+  return __pthread_cond_wait_internal (cond, mutex);
+}
+versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
+                  GLIBC_2_3_2);
+# undef versioned_symbol
+# define versioned_symbol(lib, local, symbol, version)
+# undef __pthread_cond_wait
+# define __pthread_cond_wait __pthread_cond_wait_internal
+# include_next <pthread_cond_wait.c>
+#endif
+

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f0e694490652893bd0957f8ded779133d883ebcd

commit f0e694490652893bd0957f8ded779133d883ebcd
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Sun Sep 6 21:20:26 2009 +0200

    Add ____longjmp_chk for m68k-linux

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index 3afc3da..41ede01 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,9 @@
+2009-09-06  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c: New file.
+
+	* sysdeps/m68k/__longjmp.c (__longjmp): Call CHECK_SP if defined.
+
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/Versions (libc): Add
diff --git a/sysdeps/m68k/__longjmp.c b/sysdeps/m68k/__longjmp.c
index 7d876a7..5ba2478 100644
--- a/sysdeps/m68k/__longjmp.c
+++ b/sysdeps/m68k/__longjmp.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1997, 2009
+   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
@@ -27,6 +28,10 @@ __longjmp (__jmp_buf env, int val)
   /* This restores the FP and SP that setjmp's caller had,
      and puts the return address into A0 and VAL into D0. */
 
+#ifdef CHECK_SP
+  CHECK_SP (env[0].__sp);
+#endif
+
 #if	defined(__HAVE_68881__) || defined(__HAVE_FPU__)
   /* Restore the floating-point registers.  */
   asm volatile("fmovem%.x %0, %/fp0-%/fp7" :
diff --git a/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c b/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c
new file mode 100644
index 0000000..8eaf591
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2009 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+#include <signal.h>
+#include <sysdep.h>
+#define __longjmp ____longjmp_chk
+#define CHECK_SP(sp)							      \
+  do {									      \
+    register unsigned long this_sp asm ("sp");				      \
+    if ((unsigned long) (sp) < this_sp)					      \
+      {									      \
+	struct sigaltstack oss;						      \
+	INTERNAL_SYSCALL_DECL (err);					      \
+	int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss);      \
+	if (!INTERNAL_SYSCALL_ERROR_P (result, err)			      \
+	    && ((oss.ss_flags & SS_ONSTACK) == 0			      \
+		|| ((unsigned long) oss.ss_sp + oss.ss_size		      \
+		    - (unsigned long) (sp)) < oss.ss_size))		      \
+	  __fortify_fail ("longjmp causes uninitialized stack frame");	      \
+      }									      \
+  } while (0)
+
+#include <__longjmp.c>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=53df8bcec0cc4a07dcb0d13f9105a9002d9183d8

commit 53df8bcec0cc4a07dcb0d13f9105a9002d9183d8
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Aug 6 16:53:09 2009 +0000

    Add alternate signal stack support to ARM ____longjmp_chk.
    
    	* sysdeps/arm/____longjmp_chk.S: Remove.  Replaced by....
    	* sysdeps/unix/sysv/linux/arm/____longjmp_chk.S,
    	sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S: This.  New
    	files.
    	* sysdeps/arm/__longjmp.S, sysdeps/arm/eabi/__longjmp.S: Use r4
    	for saved sp.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index fe87809..9df8b0f 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,12 @@
+2009-08-06  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/____longjmp_chk.S: Remove.  Replaced by....
+	* sysdeps/unix/sysv/linux/arm/____longjmp_chk.S,
+	sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S: This.  New
+	files.
+	* sysdeps/arm/__longjmp.S, sysdeps/arm/eabi/__longjmp.S: Use r4
+	for saved sp.
+
 2009-07-29  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/unix/sysv/linux/arm/kernel-features.h: Define
diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S
index c834e78..09e6386 100644
--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -30,8 +30,8 @@ ENTRY (__longjmp)
 	moveq	r0, #1		/* can't let setjmp() return zero! */
 
 #ifdef CHECK_SP
-	ldr	r1, [ip, #32]
-	CHECK_SP (r1)
+	ldr	r4, [ip, #32]
+	CHECK_SP (r4)
 #endif
 	LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
 END (__longjmp)
diff --git a/sysdeps/arm/eabi/__longjmp.S b/sysdeps/arm/eabi/__longjmp.S
index 1f3f791..f283297 100644
--- a/sysdeps/arm/eabi/__longjmp.S
+++ b/sysdeps/arm/eabi/__longjmp.S
@@ -31,8 +31,8 @@ ENTRY (__longjmp)
 	moveq	r0, #1		/* can't let setjmp() return zero! */
 
 #ifdef CHECK_SP
-	ldr	r1, [ip, #32]
-	CHECK_SP (r1)
+	ldr	r4, [ip, #32]
+	CHECK_SP (r4)
 #endif
 	LOADREGS(ia, ip!, {v1-v6, sl, fp, sp, lr})
 
diff --git a/sysdeps/arm/____longjmp_chk.S b/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
similarity index 79%
copy from sysdeps/arm/____longjmp_chk.S
copy to sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index 16fc4cd..2fa727d 100644
--- a/sysdeps/arm/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
@@ -16,6 +16,7 @@
    Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
+#include <sysdep.h>
 
 	.section .rodata.str1.1,"aMS",%progbits,1
 	.type	longjmp_msg,%object
@@ -47,9 +48,28 @@ longjmp_msg:
 #endif
 
 #define CHECK_SP(reg)				\
-	cmp	sp, reg;				\
+	cmp	sp, reg;			\
 	bls	.Lok;				\
+	mov	r5, r0;				\
+	mov	r0, #0;				\
+	sub	sp, sp, #16;			\
+	mov	r1, sp;				\
+	swi	#SYS_ify(sigaltstack);		\
+	cmp	r0, #0;				\
+	bne	.Lok2;				\
+	ldr	r1, [sp, #4];			\
+	tst	r1, #1;				\
+	beq	.Lfail;				\
+	ldr	r2, [sp, #0];			\
+	ldr	r3, [sp, #8];			\
+	add	r2, r2, r3;			\
+	sub	r2, r2, reg;			\
+	cmp	r2, r3;				\
+	bhi	.Lok2;				\
+.Lfail:						\
 	CALL_FAIL				\
+.Lok2:						\
+	mov	r0, r5;				\
 .Lok:
 
 #include <__longjmp.S>
diff --git a/sysdeps/arm/____longjmp_chk.S b/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
similarity index 78%
rename from sysdeps/arm/____longjmp_chk.S
rename to sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
index 16fc4cd..f92a382 100644
--- a/sysdeps/arm/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
@@ -16,6 +16,7 @@
    Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
+#include <sysdep.h>
 
 	.section .rodata.str1.1,"aMS",%progbits,1
 	.type	longjmp_msg,%object
@@ -47,9 +48,29 @@ longjmp_msg:
 #endif
 
 #define CHECK_SP(reg)				\
-	cmp	sp, reg;				\
+	cmp	sp, reg;			\
 	bls	.Lok;				\
+	mov	r5, r0;				\
+	mov	r7, #SYS_ify(sigaltstack);	\
+	mov	r0, #0;				\
+	sub	sp, sp, #16;			\
+	mov	r1, sp;				\
+	swi	#0;				\
+	cmp	r0, #0;				\
+	bne	.Lok2;				\
+	ldr	r1, [sp, #4];			\
+	tst	r1, #1;				\
+	beq	.Lfail;				\
+	ldr	r2, [sp, #0];			\
+	ldr	r3, [sp, #8];			\
+	add	r2, r2, r3;			\
+	sub	r2, r2, reg;			\
+	cmp	r2, r3;				\
+	bhi	.Lok2;				\
+.Lfail:						\
 	CALL_FAIL				\
+.Lok2:						\
+	mov	r0, r5;				\
 .Lok:
 
 #include <__longjmp.S>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c67273d5b28317c87d2e9ee636ead6d71635e0e5

commit c67273d5b28317c87d2e9ee636ead6d71635e0e5
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Aug 5 21:02:50 2009 +0000

    Signal stack support for MIPS ____longjmp_chk.
    
    	* sysdeps/mips/____longjmp_chk.c: Remove.  Replaced by....
    	* sysdeps/unix/sysv/linux/mips/____longjmp_chk.c: This.  New file.
    	* sysdeps/mips/__longjmp.c (__longjmp): Use explicit register
    	variable for env.  Use expansion of CHECK_SP macro for check.
    	* sysdeps/mips/mips64/__longjmp.c (__Longjmp): Likewise.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 9afd961..5ba4297 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,11 @@
+2009-08-05  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/____longjmp_chk.c: Remove.  Replaced by....
+	* sysdeps/unix/sysv/linux/mips/____longjmp_chk.c: This.  New file.
+	* sysdeps/mips/__longjmp.c (__longjmp): Use explicit register
+	variable for env.  Use expansion of CHECK_SP macro for check.
+	* sysdeps/mips/mips64/__longjmp.c (__Longjmp): Likewise.
+
 2009-08-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/mips32/accept4.c,
diff --git a/sysdeps/mips/____longjmp_chk.c b/sysdeps/mips/____longjmp_chk.c
deleted file mode 100644
index a46ed15..0000000
--- a/sysdeps/mips/____longjmp_chk.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright (C) 2009 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <stdio.h>
-#define __longjmp ____longjmp_chk
-#define CHECK_SP
-#include <__longjmp.c>
diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c
index 340485d..2a91771 100644
--- a/sysdeps/mips/__longjmp.c
+++ b/sysdeps/mips/__longjmp.c
@@ -25,19 +25,19 @@
 #endif
 
 void
-__longjmp (env, val_arg)
-     __jmp_buf env;
+__longjmp (env_arg, val_arg)
+     __jmp_buf env_arg;
      int val_arg;
 {
   /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before
      the hack around it); force it to use $a1 for the longjmp value.
      Without this it saves $a1 in a register which gets clobbered
      along the way.  */
+  register struct __jmp_buf_internal_tag *env asm ("a0");
   register int val asm ("a1");
 #ifdef CHECK_SP
   register long sp asm ("$29");
-  if ((long) (env[0].__sp) < sp)
-    __fortify_fail ("longjmp causes uninitialized stack frame");
+  CHECK_SP (env[0].__sp, sp, long);
 #endif
 
 #ifdef __mips_hard_float
diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c
index d7e36ff..99aac01 100644
--- a/sysdeps/mips/mips64/__longjmp.c
+++ b/sysdeps/mips/mips64/__longjmp.c
@@ -27,19 +27,19 @@
 #endif
 
 void
-__longjmp (env, val_arg)
-     __jmp_buf env;
+__longjmp (env_arg, val_arg)
+     __jmp_buf env_arg;
      int val_arg;
 {
   /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before
      the hack around it); force it to use $a1 for the longjmp value.
      Without this it saves $a1 in a register which gets clobbered
      along the way.  */
+  register struct __jmp_buf_internal_tag *env asm ("a0");
   register int val asm ("a1");
 #ifdef CHECK_SP
   register long long sp asm ("$29");
-  if ((long long) (env[0].__sp) < sp)
-    __fortify_fail ("longjmp causes uninitialized stack frame");
+  CHECK_SP (env[0].__sp, sp, long long);
 #endif
 
 #ifdef __mips_hard_float
diff --git a/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c b/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
new file mode 100644
index 0000000..9db339c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 2009 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <signal.h>
+#include <stdio.h>
+#define __longjmp ____longjmp_chk
+#define CHECK_SP(saved_sp, cur_sp, sp_type)				\
+  do {									\
+    sp_type sp_saved = (sp_type) (saved_sp);				\
+    if (sp_saved < (cur_sp))						\
+      {									\
+	struct __jmp_buf_internal_tag *env_save = env_arg;		\
+	int val_save = val_arg;						\
+	stack_t ss;							\
+	int ret = __sigaltstack (NULL, &ss);				\
+	if (ret == 0							\
+	    && (!(ss.ss_flags & SS_ONSTACK)				\
+		|| ((unsigned sp_type) ((sp_type) ss.ss_sp		\
+					+ (sp_type) ss.ss_size		\
+					- sp_saved)			\
+		    < ss.ss_size)))					\
+	  __fortify_fail ("longjmp causes uninitialized stack frame");	\
+	asm volatile ("move %0, %1" : "=r" (env) : "r" (env_save));	\
+	asm volatile ("move %0, %1" : "=r" (val) : "r" (val_save));	\
+      }									\
+  } while (0)
+#include <__longjmp.c>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9d84a81fe97400d669b5056ddcab9c59458d63e7

commit 9d84a81fe97400d669b5056ddcab9c59458d63e7
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Aug 3 16:48:38 2009 +0000

    Make accept4 for MIPS o32 avoid socketcall.
    
    sysdeps/unix/sysv/linux/internal_accept4.S expects socket.S to be
    present if __NR_socketcall is defined (which it is on MIPS o32, even
    though there are separate syscalls as well) and __NR_accept4 isn't.
    MIPS does not have socket.S, since it uses separate syscalls, but
    though the accept4 syscall should be added soon present kernel headers
    do not have it.  This patch creates a dummy internal_accept4.S for
    MIPS o32, and an accept4.c wrapper that undefines __NR_socketcall so
    that the main accept4.c falls back to the ENOSYS implementation if
    __NR_accept4 isn't defined; it doesn't seem worthwhile to have a
    special socketcall-based assembly implementation just for o32 on a few
    kernels in the range between accept4 being available via socketcall
    and the accept4 syscall being available.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 282c65d..9afd961 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-08-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/accept4.c,
+	sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S: New.
+
 2009-07-20  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/unix/sysv/linux/mips/kernel-features.h: Define
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/accept4.c b/sysdeps/unix/sysv/linux/mips/mips32/accept4.c
new file mode 100644
index 0000000..98a41f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/accept4.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2008, 2009 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Avoid accept4.c trying to use a definition based on the socketcall
+   syscall and internal_accept4.S.  */
+
+#include <errno.h>
+#include <signal.h>
+#include <sys/socket.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
+#undef __NR_socketcall
+
+#include <sysdeps/unix/sysv/linux/accept4.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S b/sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S
new file mode 100644
index 0000000..30434d7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S
@@ -0,0 +1,2 @@
+/* MIPS does not have socket.S and the socketcall syscall should
+   generally be avoided, though it exists.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=197aec2596ce699bc7b999ecf2dcd69bc5452c6e

commit 197aec2596ce699bc7b999ecf2dcd69bc5452c6e
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Wed Jul 29 15:27:35 2009 +0000

    Define __ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4 for MIPS.
    
    	* sysdeps/unix/sysv/linux/mips/kernel-features.h: Define
    	__ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 925e5e6..282c65d 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-07-20  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/mips/kernel-features.h: Define
+	__ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4.
+
 2009-07-17  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/do-lookup.h: Remove.
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index f479b60..6fe9b08 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -31,4 +31,10 @@
 # define __ASSUME_FCNTL64		1
 #endif
 
+/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061c
+# define __ASSUME_EVENTFD2	1
+# define __ASSUME_SIGNALFD4	1
+#endif
+
 #include_next <kernel-features.h>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0a6ab2a600be0ff3ff0db95d6d38c6cb321e4be3

commit 0a6ab2a600be0ff3ff0db95d6d38c6cb321e4be3
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Wed Jul 29 15:26:39 2009 +0000

    Define __ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4 for ARM.
    
    	* sysdeps/unix/sysv/linux/arm/kernel-features.h: Define
    	__ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 47aa61d..fe87809 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-07-29  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h: Define
+	__ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4.
+
 2009-06-30  Paul Brook  <paul@codesourcery.com>
 
 	* sysdeps/arm/eabi/Makefile (CFLAGS-initfini.s): Add
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index ea439d5..1b0ab63 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -51,6 +51,12 @@
 # define __ASSUME_SIGFRAME_V2	1
 #endif
 
+/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061b
+# define __ASSUME_EVENTFD2	1
+# define __ASSUME_SIGNALFD4	1
+#endif
+
 #include_next <kernel-features.h>
 
 /* These syscalls are not implemented yet for ARM.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6b4e363a79674065338c1078c009dabe65d9a0a6

commit 6b4e363a79674065338c1078c009dabe65d9a0a6
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Jul 14 00:04:33 2009 +0200

    asm/elf.h don't exist anymore since linux kernel 2.6.25
    
    	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h (ELF_NGREG,
    	ELF_NFPREG, elf_greg_t, elf_gregset_t, elf_fpreg_t,
    	elf_fpregset_t): Define. Don't include asm/elf.h.

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 4737a1a..eb23873 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -20,6 +20,11 @@
 	* sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c: Likewise.
 	* sysdeps/unix/sysv/linux/alpha/sysconf.c: Likewise.
 
+	[BZ #6507]
+	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h (ELF_NGREG,
+	ELF_NFPREG, elf_greg_t, elf_gregset_t, elf_fpreg_t,
+	elf_fpregset_t): Define. Don't include asm/elf.h.
+
 2008-11-26  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
index bee51f9..cf4fa9f 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
@@ -29,10 +29,23 @@
 #include <sys/types.h>
 #include <sys/ucontext.h>
 #include <sys/user.h>
-#include <asm/elf.h>
 
 __BEGIN_DECLS
 
+/*
+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
+ * I have no idea why that is so.  For now, we just leave it at 33
+ * (32 general regs + processor status word).
+ */
+#define ELF_NGREG       33
+#define ELF_NFPREG      32
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
 struct elf_siginfo
   {
     int si_signo;			/* Signal number.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=97d1e7c8e13eda1d57cb935cb20f91262c0db1ed

commit 97d1e7c8e13eda1d57cb935cb20f91262c0db1ed
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Jul 13 23:59:25 2009 +0200

    Update include paths following the move of alpha to ports
    
    	* sysdeps/unix/sysv/linux/alpha/getdents64.c: Adjust include path.
    	* sysdeps/unix/sysv/linux/alpha/nptl/fork.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c: Likewise.
    	* sysdeps/unix/sysv/linux/alpha/sysconf.c: Likewise.

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index d2cedc5..4737a1a 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -9,6 +9,17 @@
 	FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
 	FUTEX_BITSET_MATCH_ANY.
 
+	[BZ #10161]
+	* sysdeps/unix/sysv/linux/alpha/getdents64.c: Adjust include path.
+	* sysdeps/unix/sysv/linux/alpha/nptl/fork.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/sysconf.c: Likewise.
+
 2008-11-26  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main
diff --git a/sysdeps/unix/sysv/linux/alpha/getdents64.c b/sysdeps/unix/sysv/linux/alpha/getdents64.c
index e53570c..50f1368 100644
--- a/sysdeps/unix/sysv/linux/alpha/getdents64.c
+++ b/sysdeps/unix/sysv/linux/alpha/getdents64.c
@@ -1 +1 @@
-#include "../getdents64.c"
+#include <sysdeps/unix/sysv/linux/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/fork.c b/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
index ca85fc0..8cc99a2 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
@@ -27,4 +27,4 @@
 		  CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD,	\
 		  NULL, NULL, &THREAD_SELF->tid, NULL)
 
-#include "../fork.c"
+#include <sysdeps/unix/sysv/linux/fork.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c b/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
index 27fd817..befa497 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
@@ -2,4 +2,4 @@
    the acquire/release semantics of atomic_exchange_and_add.  And even if
    we don't do this, we should be using atomic_full_barrier or otherwise.  */
 #define __lll_rel_instr  "mb"
-#include "../sem_post.c"
+#include <nptl/sysdeps/unix/sysv/linux/sem_post.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c b/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
index 172223a..1ac4c6a 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
@@ -1 +1 @@
-#include "../x86_64/timer_create.c"
+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c b/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
index 537516e..9bffef3 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
@@ -1 +1 @@
-#include "../x86_64/timer_delete.c"
+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c b/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
index 3f21a73..24533a0 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
@@ -1 +1 @@
-#include "../x86_64/timer_getoverr.c"
+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c b/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
index a50143a..c110669 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
@@ -1 +1 @@
-#include "../x86_64/timer_gettime.c"
+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c b/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
index 37baeff..c110669 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
@@ -1 +1 @@
-#include "../x86_64/timer_settime.c"
+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/sysconf.c b/sysdeps/unix/sysv/linux/alpha/sysconf.c
index 3e5b4ee..51a2a47 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysconf.c
+++ b/sysdeps/unix/sysv/linux/alpha/sysconf.c
@@ -149,4 +149,4 @@ __sysconf (int name)
 /* Now the generic Linux version.  */
 #undef __sysconf
 #define __sysconf static linux_sysconf
-#include "../sysconf.c"
+#include <sysdeps/unix/sysv/linux/sysconf.c>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8cb716ea2c79bf98bef150961c999622fd83e208

commit 8cb716ea2c79bf98bef150961c999622fd83e208
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Jul 13 23:57:18 2009 +0200

    	* sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h: Define
    	FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
    	FUTEX_BITSET_MATCH_ANY.

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index cc7e059..d2cedc5 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -4,6 +4,11 @@
         * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
         Change parameters and use next_line.
 
+	[BZ #10160]
+	* sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h: Define
+	FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
+	FUTEX_BITSET_MATCH_ANY.
+
 2008-11-26  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 9318823..7903745 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -37,7 +37,12 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
+#define FUTEX_CLOCK_REALTIME	256
+
+#define FUTEX_BITSET_MATCH_ANY	0xffffffff
 
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c1592c256a9fa5039737a27ecbac537736f0b2b1

commit c1592c256a9fa5039737a27ecbac537736f0b2b1
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Jul 13 23:52:54 2009 +0200

    Adapt alpha version of getsysstats.c to the changes in the main Linux version
    
    	* sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
            Change parameters and use next_line.

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 6bb3b7c..cc7e059 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,3 +1,9 @@
+2009-07-13  Aurelien Jarno  <aurelien@aurel32.net>
+
+	[BZ #10158]
+        * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
+        Change parameters and use next_line.
+
 2008-11-26  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main
diff --git a/sysdeps/unix/sysv/linux/alpha/getsysstats.c b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
index 0e49a84..f667437 100644
--- a/sysdeps/unix/sysv/linux/alpha/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
@@ -20,15 +20,16 @@
 
 
 /* We need to define a special parser for /proc/cpuinfo.  */
-#define GET_NPROCS_PARSER(FP, BUFFER, RESULT)				   \
+#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT)	   \
   do									   \
     {									   \
       /* Find the line that contains the information about the number of   \
 	 active cpus.  We don't have to fear extremely long lines since	   \
 	 the kernel will not generate them.  8192 bytes are really enough. \
 	 If there is no "CPUs ..." line then we are on a UP system.  */	   \
+      char *l;								   \
       (RESULT) = 1;							   \
-      while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL)	   \
+      while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL)  \
 	if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1)	   \
 	    || (sscanf (BUFFER, "CPUs probed %*d active %d",		   \
 			&(RESULT)) == 1))  				   \

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cda50f828eda9ba114bea5e5a58afbde665760ea

commit cda50f828eda9ba114bea5e5a58afbde665760ea
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Jul 17 20:39:04 2009 +0000

    Update MIPS dl-lookup.c for changes to generic version.
    
    	* sysdeps/mips/do-lookup.h: Remove.
    	* sysdeps/mips/dl-lookup.c: Update from generic version, with
    	non-PIC handling integrated.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index fd858bd..925e5e6 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2009-07-17  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/do-lookup.h: Remove.
+	* sysdeps/mips/dl-lookup.c: Update from generic version, with
+	non-PIC handling integrated.
+
 2009-06-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define PF_IEEE802154
diff --git a/sysdeps/mips/dl-lookup.c b/sysdeps/mips/dl-lookup.c
index 015c153..b7516da 100644
--- a/sysdeps/mips/dl-lookup.c
+++ b/sysdeps/mips/dl-lookup.c
@@ -1,9 +1,6 @@
 /* Look up a symbol in the loaded objects.
-   MIPS/Linux version - this is identical to the common version, but
-   because it is in sysdeps/mips, it gets sysdeps/mips/do-lookup.h.
-   Using <do-lookup.h> instead of "do-lookup.h" would work too.
-
-   Copyright (C) 1995-2005, 2006, 2007 Free Software Foundation, Inc.
+   MIPS/Linux version - special handling of non-PIC undefined symbol rules.
+   Copyright (C) 1995-2005, 2006, 2007, 2009 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
@@ -73,8 +70,387 @@ struct sym_val
 #endif
 
 
-/* The actual lookup code.  */
-#include "do-lookup.h"
+/* Inner part of the lookup functions.  We return a value > 0 if we
+   found the symbol, the value 0 if nothing is found and < 0 if
+   something bad happened.  */
+static int
+__attribute_noinline__
+do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
+	     unsigned long int *old_hash, const ElfW(Sym) *ref,
+	     struct sym_val *result, struct r_scope_elem *scope, size_t i,
+	     const struct r_found_version *const version, int flags,
+	     struct link_map *skip, int type_class, struct link_map *undef_map)
+{
+  size_t n = scope->r_nlist;
+  /* Make sure we read the value before proceeding.  Otherwise we
+     might use r_list pointing to the initial scope and r_nlist being
+     the value after a resize.  That is the only path in dl-open.c not
+     protected by GSCOPE.  A read barrier here might be to expensive.  */
+  __asm volatile ("" : "+r" (n), "+m" (scope->r_list));
+  struct link_map **list = scope->r_list;
+
+  do
+    {
+      /* These variables are used in the nested function.  */
+      Elf_Symndx symidx;
+      int num_versions = 0;
+      const ElfW(Sym) *versioned_sym = NULL;
+
+      const struct link_map *map = list[i]->l_real;
+
+      /* Here come the extra test needed for `_dl_lookup_symbol_skip'.  */
+      if (map == skip)
+	continue;
+
+      /* Don't search the executable when resolving a copy reloc.  */
+      if ((type_class & ELF_RTYPE_CLASS_COPY) && map->l_type == lt_executable)
+	continue;
+
+      /* Do not look into objects which are going to be removed.  */
+      if (map->l_removed)
+	continue;
+
+      /* Print some debugging info if wanted.  */
+      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
+	_dl_debug_printf ("symbol=%s;  lookup in file=%s [%lu]\n",
+			  undef_name,
+			  map->l_name[0] ? map->l_name : rtld_progname,
+			  map->l_ns);
+
+      /* If the hash table is empty there is nothing to do here.  */
+      if (map->l_nbuckets == 0)
+	continue;
+
+      /* The tables for this map.  */
+      const ElfW(Sym) *symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
+      const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+
+
+      /* Nested routine to check whether the symbol matches.  */
+      const ElfW(Sym) *
+      __attribute_noinline__
+      check_match (const ElfW(Sym) *sym)
+      {
+	unsigned int stt = ELFW(ST_TYPE) (sym->st_info);
+	assert (ELF_RTYPE_CLASS_PLT == 1);
+	/* The semantics of zero/non-zero values of undefined symbols
+	   differs depending on whether the non-PIC ABI is in use.
+	   Under the non-PIC ABI, a non-zero value indicates that
+	   there is an address reference to the symbol and thus it
+	   must always be resolved (except when resolving a jump slot
+	   relocation) to the PLT entry whose address is provided as
+	   the symbol's value; a zero value indicates that this
+	   canonical-address behaviour is not required.  Yet under the
+	   classic MIPS psABI, a zero value indicates that there is an
+	   address reference to the function and the dynamic linker
+	   must resolve the symbol immediately upon loading.  To avoid
+	   conflict, symbols for which the dynamic linker must assume
+	   the non-PIC ABI semantics are marked with the STO_MIPS_PLT
+	   flag.  */
+	if (__builtin_expect ((sym->st_value == 0 /* No value.  */
+			       && stt != STT_TLS)
+			      || (sym->st_shndx == SHN_UNDEF
+				  && !(sym->st_other & STO_MIPS_PLT))
+			      || (type_class & (sym->st_shndx == SHN_UNDEF)),
+			      0))
+	  return NULL;
+
+	/* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC,
+	   STT_COMMON, STT_TLS, and STT_GNU_IFUNC since these are no
+	   code/data definitions.  */
+#define ALLOWED_STT \
+	((1 << STT_NOTYPE) | (1 << STT_OBJECT) | (1 << STT_FUNC) \
+	 | (1 << STT_COMMON) | (1 << STT_TLS) | (1 << STT_GNU_IFUNC))
+	if (__builtin_expect (((1 << stt) & ALLOWED_STT) == 0, 0))
+	  return NULL;
+
+	if (sym != ref && strcmp (strtab + sym->st_name, undef_name))
+	  /* Not the symbol we are looking for.  */
+	  return NULL;
+
+	const ElfW(Half) *verstab = map->l_versyms;
+	if (version != NULL)
+	  {
+	    if (__builtin_expect (verstab == NULL, 0))
+	      {
+		/* We need a versioned symbol but haven't found any.  If
+		   this is the object which is referenced in the verneed
+		   entry it is a bug in the library since a symbol must
+		   not simply disappear.
+
+		   It would also be a bug in the object since it means that
+		   the list of required versions is incomplete and so the
+		   tests in dl-version.c haven't found a problem.*/
+		assert (version->filename == NULL
+			|| ! _dl_name_match_p (version->filename, map));
+
+		/* Otherwise we accept the symbol.  */
+	      }
+	    else
+	      {
+		/* We can match the version information or use the
+		   default one if it is not hidden.  */
+		ElfW(Half) ndx = verstab[symidx] & 0x7fff;
+		if ((map->l_versions[ndx].hash != version->hash
+		     || strcmp (map->l_versions[ndx].name, version->name))
+		    && (version->hidden || map->l_versions[ndx].hash
+			|| (verstab[symidx] & 0x8000)))
+		  /* It's not the version we want.  */
+		  return NULL;
+	      }
+	  }
+	else
+	  {
+	    /* No specific version is selected.  There are two ways we
+	       can got here:
+
+	       - a binary which does not include versioning information
+	       is loaded
+
+	       - dlsym() instead of dlvsym() is used to get a symbol which
+	       might exist in more than one form
+
+	       If the library does not provide symbol version information
+	       there is no problem at at: we simply use the symbol if it
+	       is defined.
+
+	       These two lookups need to be handled differently if the
+	       library defines versions.  In the case of the old
+	       unversioned application the oldest (default) version
+	       should be used.  In case of a dlsym() call the latest and
+	       public interface should be returned.  */
+	    if (verstab != NULL)
+	      {
+		if ((verstab[symidx] & 0x7fff)
+		    >= ((flags & DL_LOOKUP_RETURN_NEWEST) ? 2 : 3))
+		  {
+		    /* Don't accept hidden symbols.  */
+		    if ((verstab[symidx] & 0x8000) == 0
+			&& num_versions++ == 0)
+		      /* No version so far.  */
+		      versioned_sym = sym;
+
+		    return NULL;
+		  }
+	      }
+	  }
+
+	/* There cannot be another entry for this symbol so stop here.  */
+	return sym;
+      }
+
+      const ElfW(Sym) *sym;
+      const ElfW(Addr) *bitmask = map->l_gnu_bitmask;
+      if (__builtin_expect (bitmask != NULL, 1))
+	{
+	  ElfW(Addr) bitmask_word
+	    = bitmask[(new_hash / __ELF_NATIVE_CLASS)
+		      & map->l_gnu_bitmask_idxbits];
+
+	  unsigned int hashbit1 = new_hash & (__ELF_NATIVE_CLASS - 1);
+	  unsigned int hashbit2 = ((new_hash >> map->l_gnu_shift)
+				   & (__ELF_NATIVE_CLASS - 1));
+
+	  if (__builtin_expect ((bitmask_word >> hashbit1)
+				& (bitmask_word >> hashbit2) & 1, 0))
+	    {
+	      Elf32_Word bucket = map->l_gnu_buckets[new_hash
+						     % map->l_nbuckets];
+	      if (bucket != 0)
+		{
+		  const Elf32_Word *hasharr = &map->l_gnu_chain_zero[bucket];
+
+		  do
+		    if (((*hasharr ^ new_hash) >> 1) == 0)
+		      {
+			symidx = hasharr - map->l_gnu_chain_zero;
+			sym = check_match (&symtab[symidx]);
+			if (sym != NULL)
+			  goto found_it;
+		      }
+		  while ((*hasharr++ & 1u) == 0);
+		}
+	    }
+	  /* No symbol found.  */
+	  symidx = SHN_UNDEF;
+	}
+      else
+	{
+	  if (*old_hash == 0xffffffff)
+	    *old_hash = _dl_elf_hash (undef_name);
+
+	  /* Use the old SysV-style hash table.  Search the appropriate
+	     hash bucket in this object's symbol table for a definition
+	     for the same symbol name.  */
+	  for (symidx = map->l_buckets[*old_hash % map->l_nbuckets];
+	       symidx != STN_UNDEF;
+	       symidx = map->l_chain[symidx])
+	    {
+	      sym = check_match (&symtab[symidx]);
+	      if (sym != NULL)
+		goto found_it;
+	    }
+	}
+
+      /* If we have seen exactly one versioned symbol while we are
+	 looking for an unversioned symbol and the version is not the
+	 default version we still accept this symbol since there are
+	 no possible ambiguities.  */
+      sym = num_versions == 1 ? versioned_sym : NULL;
+
+      if (sym != NULL)
+	{
+	found_it:
+	  switch (__builtin_expect (ELFW(ST_BIND) (sym->st_info), STB_GLOBAL))
+	    {
+	    case STB_WEAK:
+	      /* Weak definition.  Use this value if we don't find another.  */
+	      if (__builtin_expect (GLRO(dl_dynamic_weak), 0))
+		{
+		  if (! result->s)
+		    {
+		      result->s = sym;
+		      result->m = (struct link_map *) map;
+		    }
+		  break;
+		}
+	      /* FALLTHROUGH */
+	    case STB_GLOBAL:
+	    success:
+	      /* Global definition.  Just what we need.  */
+	      result->s = sym;
+	      result->m = (struct link_map *) map;
+	      return 1;
+
+	    case STB_GNU_UNIQUE:;
+	      /* We have to determine whether we already found a
+		 symbol with this name before.  If not then we have to
+		 add it to the search table.  If we already found a
+		 definition we have to use it.  */
+	      void enter (struct unique_sym *table, size_t size,
+			  unsigned int hash, const char *name,
+			  const ElfW(Sym) *sym, const struct link_map *map)
+	      {
+		size_t idx = hash % size;
+		size_t hash2 = 1 + hash % (size - 2);
+		while (1)
+		  {
+		    if (table[idx].hashval == 0)
+		      {
+			table[idx].hashval = hash;
+			table[idx].name = strtab + sym->st_name;
+			if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
+			  {
+			    table[idx].sym = ref;
+			    table[idx].map = undef_map;
+			  }
+			else
+			  {
+			    table[idx].sym = sym;
+			    table[idx].map = map;
+			  }
+			return;
+		      }
+
+		    idx += hash2;
+		    if (idx >= size)
+		      idx -= size;
+		  }
+	      }
+
+	      struct unique_sym_table *tab
+		= &GL(dl_ns)[map->l_ns]._ns_unique_sym_table;
+
+	      __rtld_lock_lock_recursive (tab->lock);
+
+	      struct unique_sym *entries = tab->entries;
+	      size_t size = tab->size;
+	      if (entries != NULL)
+		{
+		  size_t idx = new_hash % size;
+		  size_t hash2 = 1 + new_hash % (size - 2);
+		  while (1)
+		    {
+		      if (entries[idx].hashval == new_hash
+			  && strcmp (entries[idx].name, undef_name) == 0)
+			{
+			  result->s = entries[idx].sym;
+			  result->m = (struct link_map *) entries[idx].map;
+			  __rtld_lock_unlock_recursive (tab->lock);
+			  return 1;
+			}
+
+		      if (entries[idx].hashval == 0
+			  && entries[idx].name == NULL)
+			break;
+
+		      idx += hash2;
+		      if (idx >= size)
+			idx -= size;
+		    }
+
+		  if (size * 3 <= tab->n_elements)
+		    {
+		      /* Expand the table.  */
+		      size_t newsize = _dl_higher_prime_number (size);
+		      struct unique_sym *newentries
+			= calloc (sizeof (struct unique_sym), newsize);
+		      if (newentries == NULL)
+			{
+			nomem:
+			  __rtld_lock_unlock_recursive (tab->lock);
+			  _dl_fatal_printf ("out of memory\n");
+			}
+
+		      for (idx = 0; idx < size; ++idx)
+			if (entries[idx].hashval != 0)
+			  enter (newentries, newsize, entries[idx].hashval,
+				 entries[idx].name, entries[idx].sym,
+				 entries[idx].map);
+
+		      tab->free (entries);
+		      tab->size = newsize;
+		      entries = tab->entries = newentries;
+		      tab->free = free;
+		    }
+		}
+	      else
+		{
+#define INITIAL_NUNIQUE_SYM_TABLE 31
+		  size = INITIAL_NUNIQUE_SYM_TABLE;
+		  entries = calloc (sizeof (struct unique_sym), size);
+		  if (entries == NULL)
+		    goto nomem;
+
+		  tab->entries = entries;
+		  tab->size = size;
+		  tab->free = free;
+		}
+
+	      enter (entries, size, new_hash, strtab + sym->st_name, sym, map);
+	      ++tab->n_elements;
+
+	      __rtld_lock_unlock_recursive (tab->lock);
+
+	      goto success;
+
+	    default:
+	      /* Local symbols are ignored.  */
+	      break;
+	    }
+	}
+
+      /* If this current map is the one mentioned in the verneed entry
+	 and we have not found a weak entry, it is a bug.  */
+      if (symidx == STN_UNDEF && version != NULL && version->filename != NULL
+	  && __builtin_expect (_dl_name_match_p (version->filename, map), 0))
+	return -1;
+    }
+  while (++i < n);
+
+  /* We have not found anything until now.  */
+  return 0;
+}
 
 
 static uint_fast32_t
@@ -341,7 +717,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
     {
       int res = do_lookup_x (undef_name, new_hash, &old_hash, *ref,
 			     &current_value, *scope, start, version, flags,
-			     skip_map, type_class);
+			     skip_map, type_class, undef_map);
       if (res > 0)
 	break;
 
@@ -414,7 +790,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
 	  for (scope = symbol_scope; *scope != NULL; i = 0, ++scope)
 	    if (do_lookup_x (undef_name, new_hash, &old_hash, *ref,
 			     &protected_value, *scope, i, version, flags,
-			     skip_map, ELF_RTYPE_CLASS_PLT) != 0)
+			     skip_map, ELF_RTYPE_CLASS_PLT, NULL) != 0)
 	      break;
 
 	  if (protected_value.s != NULL && protected_value.m != undef_map)
@@ -540,21 +916,26 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
 
 	  do_lookup_x (undef_name, new_hash, &old_hash, *ref, &val,
 		       undef_map->l_local_scope[0], 0, version, 0, NULL,
-		       type_class);
+		       type_class, undef_map);
 
 	  if (val.s != value->s || val.m != value->m)
 	    conflict = 1;
 	}
 
-      if (value->s
-	  && (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
-				== STT_TLS, 0)))
-	type_class = 4;
+      if (value->s)
+	{
+	  if (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
+				== STT_TLS, 0))
+	    type_class = 4;
+	  else if (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
+				     == STT_GNU_IFUNC, 0))
+	    type_class |= 8;
+	}
 
       if (conflict
 	  || GLRO(dl_trace_prelink_map) == undef_map
 	  || GLRO(dl_trace_prelink_map) == NULL
-	  || type_class == 4)
+	  || type_class >= 4)
 	{
 	  _dl_printf ("%s 0x%0*Zx 0x%0*Zx -> 0x%0*Zx 0x%0*Zx ",
 		      conflict ? "conflict" : "lookup",
diff --git a/sysdeps/mips/do-lookup.h b/sysdeps/mips/do-lookup.h
deleted file mode 100644
index 0d92620..0000000
--- a/sysdeps/mips/do-lookup.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* MIPS-specific veneer to GLIBC's do-lookup.h.
-   Copyright (C) 2008 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* The semantics of zero/non-zero values of undefined symbols differs
-   depending on whether the non-PIC ABI is in use.  Under the non-PIC ABI,
-   a non-zero value indicates that there is an address reference to the
-   symbol and thus it must always be resolved (except when resolving a jump
-   slot relocation) to the PLT entry whose address is provided as the
-   symbol's value; a zero value indicates that this canonical-address
-   behaviour is not required.  Yet under the classic MIPS psABI, a zero value
-   indicates that there is an address reference to the function and the
-   dynamic linker must resolve the symbol immediately upon loading.  To
-   avoid conflict, symbols for which the dynamic linker must assume the
-   non-PIC ABI semantics are marked with the STO_MIPS_PLT flag.  The
-   following ugly hack causes the code in the platform-independent
-   do-lookup.h file to check this flag correctly.  */
-#define st_value st_shndx == SHN_UNDEF && !(sym->st_other & STO_MIPS_PLT)) \
-		 || (sym->st_value
-#include_next "do-lookup.h"
-#undef st_value
-

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f40617927c9aee865a56af32f38354ea99b63b36

commit f40617927c9aee865a56af32f38354ea99b63b36
Author: Paul Brook <paul@codesourcery.com>
Date:   Tue Jun 30 20:10:14 2009 +0000

    Avoid invalid unwind directives when building crti.o and crtn.o for ARM EABI.
    
    	* sysdeps/arm/eabi/Makefile (CFLAGS-initfini.s): Add
    	-fno-asynchronous-unwind-tables -fno-unwind-tables.
    	(CFLAGS-pt-initfini.s): Ditto.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index ebc4e30..47aa61d 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2009-06-30  Paul Brook  <paul@codesourcery.com>
+
+	* sysdeps/arm/eabi/Makefile (CFLAGS-initfini.s): Add
+	-fno-asynchronous-unwind-tables -fno-unwind-tables.
+	(CFLAGS-pt-initfini.s): Ditto.
+
 2009-06-25  Nathan Froyd  <froydnj@codesourcery.com>
 
 	* sysdeps/arm/eabi/aeabi_lcsts.c (__aeabi_stdin, __aeabi_stdout,
diff --git a/sysdeps/arm/eabi/Makefile b/sysdeps/arm/eabi/Makefile
index 890d1d9..05aede6 100644
--- a/sysdeps/arm/eabi/Makefile
+++ b/sysdeps/arm/eabi/Makefile
@@ -3,6 +3,7 @@ aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math
 aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \
 	aeabi_mb_cur_max aeabi_atexit aeabi_memclr aeabi_memcpy \
 	aeabi_memmove aeabi_memset
+CFLAGS-initfini.s += -fno-asynchronous-unwind-tables -fno-unwind-tables
 
 sysdep_routines += $(aeabi_constants) $(aeabi_routines)
 static-only-routines += $(aeabi_constants)
@@ -24,3 +25,7 @@ endif
 ifeq ($(subdir),math)
 $(objpfx)libm.so: $(elfobjdir)/ld.so
 endif
+
+ifeq ($(subdir),nptl)
+CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables -fno-unwind-tables
+endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5a6ba634c66e64aab5b070403d23fb22ab2bf6d9

commit 5a6ba634c66e64aab5b070403d23fb22ab2bf6d9
Author: Nathan Froyd <froydnj@codesourcery.com>
Date:   Thu Jun 25 13:27:59 2009 +0000

    Add missing CLIBABI variables __aeabi_stdin, __aeabi_stdout, __aeabi_stderr.
    
    	* sysdeps/arm/eabi/aeabi_lcsts.c (__aeabi_stdin, __aeabi_stdout,
    	__aeabi_stderr): New variables.
    	(setup_aeabi_stdio): New function.  Add it to .preinit_array.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index dbc00f6..ebc4e30 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2009-06-25  Nathan Froyd  <froydnj@codesourcery.com>
+
+	* sysdeps/arm/eabi/aeabi_lcsts.c (__aeabi_stdin, __aeabi_stdout,
+	__aeabi_stderr): New variables.
+	(setup_aeabi_stdio): New function.  Add it to .preinit_array.
+
 2009-06-24  Maxim Kuvyrkov  <maxim@codesourcery.com>
             Mark Mitchell  <mark@codesourcery.com>
             Joseph Myers  <joseph@codesourcery.com>
diff --git a/sysdeps/arm/eabi/aeabi_lcsts.c b/sysdeps/arm/eabi/aeabi_lcsts.c
index 99c7985..0c620d4 100644
--- a/sysdeps/arm/eabi/aeabi_lcsts.c
+++ b/sysdeps/arm/eabi/aeabi_lcsts.c
@@ -81,4 +81,19 @@ eabi_constant (TMP_MAX);
 eabi_constant (FILENAME_MAX);
 eabi_constant (L_tmpnam);
 
+FILE *__aeabi_stdin attribute_hidden;
+FILE *__aeabi_stdout attribute_hidden;
+FILE *__aeabi_stderr attribute_hidden;
+
+static void __attribute__ ((used))
+setup_aeabi_stdio (void)
+{
+  __aeabi_stdin = stdin;
+  __aeabi_stdout = stdout;
+  __aeabi_stderr = stderr;
+}
+
+static void (*fp) (void) __attribute__ ((used, section (".preinit_array")))
+  = setup_aeabi_stdio;
+
 eabi_constant (CLOCKS_PER_SEC);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b6dec1881f8d1dba619f6c08fdf50cb70dc1eff4

commit b6dec1881f8d1dba619f6c08fdf50cb70dc1eff4
Author: Maxim Kuvyrkov <maxim@codesourcery.com>
Date:   Wed Jun 24 15:55:04 2009 +0000

    ARM EABI backtrace using unwind information.
    
    2009-06-24  Maxim Kuvyrkov  <maxim@codesourcery.com>
                Mark Mitchell  <mark@codesourcery.com>
                Joseph Myers  <joseph@codesourcery.com>
                Kazu Hirata  <kazu@codesourcery.com>
    
    	* sysdeps/arm/eabi/backtrace.c: New.
    	* sysdeps/arm/eabi/Makefile (CFLAGS-backtrace.c): Add
    	-funwind-tables.
    	* sysdeps/arm/preconfigure: Add -fno-unwind-tables to CFLAGS.
    	* sysdeps/unix/sysv/linux/arm/eabi/configure.in: Remove
    	-fno-unwind-tables from CFLAGS.
    	* sysdeps/unix/sysv/linux/arm/eabi/configure: Regenerate.
    	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h (_Unwind_Trace_Fn):
    	Define.
    	(_Unwind_Backtrace): Declare.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 6750958..dbc00f6 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,19 @@
+2009-06-24  Maxim Kuvyrkov  <maxim@codesourcery.com>
+            Mark Mitchell  <mark@codesourcery.com>
+            Joseph Myers  <joseph@codesourcery.com>
+            Kazu Hirata  <kazu@codesourcery.com>
+
+	* sysdeps/arm/eabi/backtrace.c: New.
+	* sysdeps/arm/eabi/Makefile (CFLAGS-backtrace.c): Add
+	-funwind-tables.
+	* sysdeps/arm/preconfigure: Add -fno-unwind-tables to CFLAGS.
+	* sysdeps/unix/sysv/linux/arm/eabi/configure.in: Remove
+	-fno-unwind-tables from CFLAGS.
+	* sysdeps/unix/sysv/linux/arm/eabi/configure: Regenerate.
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h (_Unwind_Trace_Fn):
+	Define.
+	(_Unwind_Backtrace): Declare.
+
 2009-05-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/____longjmp_chk.S (CHECK_SP): Use unsigned
diff --git a/sysdeps/arm/eabi/Makefile b/sysdeps/arm/eabi/Makefile
index 0f92d7a..890d1d9 100644
--- a/sysdeps/arm/eabi/Makefile
+++ b/sysdeps/arm/eabi/Makefile
@@ -11,6 +11,10 @@ static-only-routines += $(aeabi_constants)
 gen-as-const-headers += rtld-global-offsets.sym
 endif
 
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
+
 ifeq ($(subdir),elf)
 sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx
 shared-only-routines += aeabi_unwind_cpp_pr1
diff --git a/sysdeps/arm/eabi/backtrace.c b/sysdeps/arm/eabi/backtrace.c
new file mode 100644
index 0000000..752a435
--- /dev/null
+++ b/sysdeps/arm/eabi/backtrace.c
@@ -0,0 +1,126 @@
+/* Return backtrace of current program state.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Kazu Hirata <kazu@codesourcery.com>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <bits/libc-lock.h>
+#include <dlfcn.h>
+#include <execinfo.h>
+#include <stdlib.h>
+#include <unwind.h>
+
+struct trace_arg
+{
+  void **array;
+  int cnt, size;
+};
+
+#ifdef SHARED
+static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
+static _Unwind_VRS_Result (*unwind_vrs_get) (_Unwind_Context *,
+					     _Unwind_VRS_RegClass,
+					     _uw,
+					     _Unwind_VRS_DataRepresentation,
+					     void *);
+
+static void *libgcc_handle;
+
+static void
+init (void)
+{
+  libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
+
+  if (libgcc_handle == NULL)
+    return;
+
+  unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
+  unwind_vrs_get = __libc_dlsym (libgcc_handle, "_Unwind_VRS_Get");
+  if (unwind_vrs_get == NULL)
+    unwind_backtrace = NULL;
+}
+
+/* This function is identical to "_Unwind_GetGR", except that it uses
+   "unwind_vrs_get" instead of "_Unwind_VRS_Get".  */
+static inline _Unwind_Word
+unwind_getgr (_Unwind_Context *context, int regno)
+{
+  _uw val;
+  unwind_vrs_get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
+  return val;
+}
+
+/* This macro is identical to the _Unwind_GetIP macro, except that it
+   uses "unwind_getgr" instead of "_Unwind_GetGR".  */
+# define unwind_getip(context) \
+  (unwind_getgr (context, 15) & ~(_Unwind_Word)1)
+#else
+# define unwind_backtrace _Unwind_Backtrace
+# define unwind_getip _Unwind_GetIP
+#endif
+
+static _Unwind_Reason_Code
+backtrace_helper (struct _Unwind_Context *ctx, void *a)
+{
+  struct trace_arg *arg = a;
+
+  /* We are first called with address in the __backtrace function.
+     Skip it.  */
+  if (arg->cnt != -1)
+    arg->array[arg->cnt] = (void *) unwind_getip (ctx);
+  if (++arg->cnt == arg->size)
+    return _URC_END_OF_STACK;
+  return _URC_NO_REASON;
+}
+
+int
+__backtrace (array, size)
+     void **array;
+     int size;
+{
+  struct trace_arg arg = { .array = array, .size = size, .cnt = -1 };
+#ifdef SHARED
+  __libc_once_define (static, once);
+
+  __libc_once (once, init);
+  if (unwind_backtrace == NULL)
+    return 0;
+#endif
+
+  if (size >= 1)
+    unwind_backtrace (backtrace_helper, &arg);
+
+  if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL)
+    --arg.cnt;
+  return arg.cnt != -1 ? arg.cnt : 0;
+}
+weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
+
+
+#ifdef SHARED
+/* Free all resources if necessary.  */
+libc_freeres_fn (free_mem)
+{
+  unwind_backtrace = NULL;
+  if (libgcc_handle != NULL)
+    {
+      __libc_dlclose (libgcc_handle);
+      libgcc_handle = NULL;
+    }
+}
+#endif
diff --git a/sysdeps/arm/preconfigure b/sysdeps/arm/preconfigure
index 337e84f..313da79 100644
--- a/sysdeps/arm/preconfigure
+++ b/sysdeps/arm/preconfigure
@@ -11,3 +11,7 @@ arm*)
 	esac
 	;;
 esac
+if [ "${CFLAGS+set}" != "set" ]; then
+  CFLAGS="-g -O2"
+fi
+CFLAGS="$CFLAGS -fno-unwind-tables"
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/configure b/sysdeps/unix/sysv/linux/arm/eabi/configure
index 28fb9ef..c7e20cf 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/configure
+++ b/sysdeps/unix/sysv/linux/arm/eabi/configure
@@ -3,3 +3,4 @@
 
 arch_minimum_kernel=2.6.16
 libc_cv_gcc_unwind_find_fde=no
+CFLAGS=${CFLAGS% -fno-unwind-tables}
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/configure.in b/sysdeps/unix/sysv/linux/arm/eabi/configure.in
index d1fb7f4..cc0e9b5 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/configure.in
+++ b/sysdeps/unix/sysv/linux/arm/eabi/configure.in
@@ -3,3 +3,4 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 
 arch_minimum_kernel=2.6.16
 libc_cv_gcc_unwind_find_fde=no
+CFLAGS=${CFLAGS% -fno-unwind-tables}
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h
index d625fb2..eeb9cf8 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h
@@ -1,5 +1,5 @@
 /* Header file for the ARM EABI unwinder
-   Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2009  Free Software Foundation, Inc.
    Contributed by Paul Brook
 
    This file is free software; you can redistribute it and/or modify it
@@ -267,6 +267,11 @@ extern "C" {
 #define _Unwind_SetIP(context, val) \
   _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
 
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+     (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
 #ifdef __cplusplus
 }   /* extern "C" */
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8200e168efbf54fe08a269fde8fcf986ad5360f0

commit 8200e168efbf54fe08a269fde8fcf986ad5360f0
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Jun 18 22:04:19 2009 +0000

    Define PF_IEEE802154 and AF_IEEE802154 for MIPS.
    
    	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define PF_IEEE802154
    	and AF_IEEE802154.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 9b0b7bd..fd858bd 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-06-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define PF_IEEE802154
+	and AF_IEEE802154.
+
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/____longjmp_chk.c: New file.
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 60db515..58a0409 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -1,6 +1,6 @@
 /* System-specific socket constants and types.  Linux/MIPS version.
-   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008,
+   2009 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
@@ -108,7 +108,8 @@ enum __socket_type
 #define PF_RXRPC	33	/* RxRPC sockets.  */
 #define PF_ISDN		34	/* mISDN sockets.  */
 #define PF_PHONET	35	/* Phonet sockets.  */
-#define	PF_MAX		36	/* For now..  */
+#define PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+#define	PF_MAX		37	/* For now..  */
 
 /* Address families.  */
 #define	AF_UNSPEC	PF_UNSPEC
@@ -148,6 +149,7 @@ enum __socket_type
 #define AF_RXRPC	PF_RXRPC
 #define AF_ISDN		PF_ISDN
 #define AF_PHONET	PF_PHONET
+#define AF_IEEE802154	PF_IEEE802154
 #define	AF_MAX		PF_MAX
 
 /* Socket level values.  Others are defined in the appropriate headers.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bf89c0e24509fe4817816c585f96329e3364303c

commit bf89c0e24509fe4817816c585f96329e3364303c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon May 18 19:48:54 2009 +0000

    Use unsigned comparison in ARM ____longjmp_chk.
    
    	* sysdeps/arm/____longjmp_chk.S (CHECK_SP): Use unsigned
    	comparison.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 1088fc0..6750958 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-05-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/____longjmp_chk.S (CHECK_SP): Use unsigned
+	comparison.
+
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/____longjmp_chk.S: New file.
diff --git a/sysdeps/arm/____longjmp_chk.S b/sysdeps/arm/____longjmp_chk.S
index 9b65c36..16fc4cd 100644
--- a/sysdeps/arm/____longjmp_chk.S
+++ b/sysdeps/arm/____longjmp_chk.S
@@ -48,7 +48,7 @@ longjmp_msg:
 
 #define CHECK_SP(reg)				\
 	cmp	sp, reg;				\
-	ble	.Lok;				\
+	bls	.Lok;				\
 	CALL_FAIL				\
 .Lok:
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6a9f82ac93563fa55cb5aed4cf20fa67352899c9

commit 6a9f82ac93563fa55cb5aed4cf20fa67352899c9
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 22:24:56 2009 +0000

    ____longjmp_chk for MIPS.
    
    	* sysdeps/mips/____longjmp_chk.c: New file.
    	* sysdeps/mips/__longjmp.c: If CHECK_SP is defined, use it.  Don't
    	undefine __longjmp.
    	* sysdeps/mips64/__longjmp.c: Likewise.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 4039c01..9b0b7bd 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,12 @@
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/mips/____longjmp_chk.c: New file.
+	* sysdeps/mips/__longjmp.c: If CHECK_SP is defined, use it.  Don't
+	undefine __longjmp.
+	* sysdeps/mips64/__longjmp.c: Likewise.
+
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c,
 	sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c,
 	sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c,
diff --git a/sysdeps/mips/____longjmp_chk.c b/sysdeps/mips/____longjmp_chk.c
new file mode 100644
index 0000000..a46ed15
--- /dev/null
+++ b/sysdeps/mips/____longjmp_chk.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2009 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+#define __longjmp ____longjmp_chk
+#define CHECK_SP
+#include <__longjmp.c>
diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c
index 386c056..340485d 100644
--- a/sysdeps/mips/__longjmp.c
+++ b/sysdeps/mips/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1997, 2000, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Brendan Kehoe (brendan@zen.org).
 
@@ -20,8 +20,6 @@
 #include <setjmp.h>
 #include <stdlib.h>
 
-#undef __longjmp
-
 #ifndef	__GNUC__
   #error This file uses GNU C extensions; you must compile with GCC.
 #endif
@@ -36,6 +34,11 @@ __longjmp (env, val_arg)
      Without this it saves $a1 in a register which gets clobbered
      along the way.  */
   register int val asm ("a1");
+#ifdef CHECK_SP
+  register long sp asm ("$29");
+  if ((long) (env[0].__sp) < sp)
+    __fortify_fail ("longjmp causes uninitialized stack frame");
+#endif
 
 #ifdef __mips_hard_float
   /* Pull back the floating point callee-saved registers.  */
diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c
index 973b078..d7e36ff 100644
--- a/sysdeps/mips/mips64/__longjmp.c
+++ b/sysdeps/mips/mips64/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1997, 2000, 2003, 2004
+/* Copyright (C) 1992, 1995, 1997, 2000, 2003, 2004, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Brendan Kehoe (brendan@zen.org).
@@ -22,8 +22,6 @@
 #include <sgidefs.h>
 #include <stdlib.h>
 
-#undef __longjmp
-
 #ifndef	__GNUC__
   #error This file uses GNU C extensions; you must compile with GCC.
 #endif
@@ -38,6 +36,11 @@ __longjmp (env, val_arg)
      Without this it saves $a1 in a register which gets clobbered
      along the way.  */
   register int val asm ("a1");
+#ifdef CHECK_SP
+  register long long sp asm ("$29");
+  if ((long long) (env[0].__sp) < sp)
+    __fortify_fail ("longjmp causes uninitialized stack frame");
+#endif
 
 #ifdef __mips_hard_float
   /* Pull back the floating point callee-saved registers.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ef889ffe8d5cf704a67e084a56a70a4da2f9584e

commit ef889ffe8d5cf704a67e084a56a70a4da2f9584e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 22:20:23 2009 +0000

    ____longjmp_chk for ARM.
    
    	* sysdeps/arm/____longjmp_chk.S: New file.
    	* sysdeps/arm/__longjmp.S: If CHECK_SP is defined, use it.
    	* sysdeps/arm/eabi/__longjmp.S: Likewise.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 420c153..1088fc0 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,11 @@
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/arm/____longjmp_chk.S: New file.
+	* sysdeps/arm/__longjmp.S: If CHECK_SP is defined, use it.
+	* sysdeps/arm/eabi/__longjmp.S: Likewise.
+
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PREADV,
 	__ASSUME_PWRITEV): Don't undefine.
 
diff --git a/sysdeps/arm/____longjmp_chk.S b/sysdeps/arm/____longjmp_chk.S
new file mode 100644
index 0000000..9b65c36
--- /dev/null
+++ b/sysdeps/arm/____longjmp_chk.S
@@ -0,0 +1,55 @@
+/* Copyright (C) 2009 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 General Public License
+   along with GCC; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+
+	.section .rodata.str1.1,"aMS",%progbits,1
+	.type	longjmp_msg,%object
+longjmp_msg:
+	.string "longjmp causes uninitialized stack frame"
+	.size	longjmp_msg, .-longjmp_msg
+	.text
+
+#define __longjmp ____longjmp_chk
+
+#ifdef PIC
+# define CALL_FAIL						\
+	ldr	sl, .L_GOT;					\
+.L_GOT_OFF:							\
+	add	sl, pc, sl;					\
+	ldr	r0, .Lstr;					\
+	add	r0, sl, r0;					\
+	B	PLTJMP(HIDDEN_JUMPTARGET(__fortify_fail));	\
+.L_GOT:								\
+	.word	_GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8);		\
+.Lstr:								\
+	.word	longjmp_msg(GOTOFF);
+#else
+# define CALL_FAIL					\
+	ldr	r0, .Lstr;				\
+	B	HIDDEN_JUMPTARGET(__fortify_fail);	\
+.Lstr:							\
+	.word	longjmp_msg;
+#endif
+
+#define CHECK_SP(reg)				\
+	cmp	sp, reg;				\
+	ble	.Lok;				\
+	CALL_FAIL				\
+.Lok:
+
+#include <__longjmp.S>
diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S
index 7b30160..c834e78 100644
--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -1,5 +1,5 @@
 /* longjmp for ARM.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2009 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
@@ -29,5 +29,9 @@ ENTRY (__longjmp)
 	movs	r0, r1		/* get the return value in place */
 	moveq	r0, #1		/* can't let setjmp() return zero! */
 
+#ifdef CHECK_SP
+	ldr	r1, [ip, #32]
+	CHECK_SP (r1)
+#endif
 	LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
 END (__longjmp)
diff --git a/sysdeps/arm/eabi/__longjmp.S b/sysdeps/arm/eabi/__longjmp.S
index fff25cd..1f3f791 100644
--- a/sysdeps/arm/eabi/__longjmp.S
+++ b/sysdeps/arm/eabi/__longjmp.S
@@ -1,5 +1,5 @@
 /* longjmp for ARM.
-   Copyright (C) 1997, 1998, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2005, 2006, 2009 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
@@ -30,6 +30,10 @@ ENTRY (__longjmp)
 	movs	r0, r1		/* get the return value in place */
 	moveq	r0, #1		/* can't let setjmp() return zero! */
 
+#ifdef CHECK_SP
+	ldr	r1, [ip, #32]
+	CHECK_SP (r1)
+#endif
 	LOADREGS(ia, ip!, {v1-v6, sl, fp, sp, lr})
 
 #ifdef IS_IN_rtld

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d9056ac6554d3d9635344d77375ae60f13707001

commit d9056ac6554d3d9635344d77375ae60f13707001
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 17:42:10 2009 +0000

    fallocate fixes for MIPS n32 and n64.
    
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c: New.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index b951c0b..4039c01 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,12 @@
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c: New.
+
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/mips/Versions (libc): Add
 	fallocate64@@GLIBC_2.11.
 
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
new file mode 100644
index 0000000..f973250
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2007, 2009 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+fallocate (int fd, int mode, __off_t offset, __off_t len)
+{
+#ifdef __NR_fallocate
+  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
new file mode 100644
index 0000000..1f37f91
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2007, 2009 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
+{
+#ifdef __NR_fallocate
+  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c
new file mode 100644
index 0000000..d3b7218
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wordsize-64/fallocate.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c
new file mode 100644
index 0000000..fb2b681
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c
@@ -0,0 +1 @@
+/* fallocate64 is in fallocate.c */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9f8832d47f51d4abbbb1e9034f638653c730ec5b

commit 9f8832d47f51d4abbbb1e9034f638653c730ec5b
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 15:19:32 2009 +0000

    Assume preadv and pwritev syscalls on ARM for 2.6.30.
    
    	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PREADV,
    	__ASSUME_PWRITEV): Don't undefine.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 4b304fb..420c153 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,10 @@
 2009-05-16  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PREADV,
+	__ASSUME_PWRITEV): Don't undefine.
+
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/arm/Versions (libc): Add
 	fallocate64@@GLIBC_2.11.
 
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index b33c968..ea439d5 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -56,5 +56,3 @@
 /* These syscalls are not implemented yet for ARM.  */
 #undef __ASSUME_PSELECT
 #undef __ASSUME_PPOLL
-#undef __ASSUME_PREADV
-#undef __ASSUME_PWRITEV

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3066cb224d3614d5859a4fac38675f95738ea713

commit 3066cb224d3614d5859a4fac38675f95738ea713
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 15:14:44 2009 +0000

    	* sysdeps/unix/sysv/linux/m68k/Versions (libc): Add
    	fallocate64@@GLIBC_2.11.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index c68e94a..3afc3da 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/Versions (libc): Add
+	fallocate64@@GLIBC_2.11.
+
 2009-04-25  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* sysdeps/unix/sysv/linux/m68k/kernel-features.h: Revert last
diff --git a/sysdeps/unix/sysv/linux/m68k/Versions b/sysdeps/unix/sysv/linux/m68k/Versions
index 0799bf3..5650f7f 100644
--- a/sysdeps/unix/sysv/linux/m68k/Versions
+++ b/sysdeps/unix/sysv/linux/m68k/Versions
@@ -29,4 +29,7 @@ libc {
     # v*
     versionsort64;
   }
+  GLIBC_2.11 {
+    fallocate64;
+  }
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c504ff3be9c3c63b9b772b84d2c517cd4f21881a

commit c504ff3be9c3c63b9b772b84d2c517cd4f21881a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 14:30:47 2009 +0000

    Add fallocate64 export for MIPS.
    
    	* sysdeps/unix/sysv/linux/mips/Versions (libc): Add
    	fallocate64@@GLIBC_2.11.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index a4759d9..b951c0b 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/Versions (libc): Add
+	fallocate64@@GLIBC_2.11.
+
 2009-05-14  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c,
diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions
index 09df42d..a56322a 100644
--- a/sysdeps/unix/sysv/linux/mips/Versions
+++ b/sysdeps/unix/sysv/linux/mips/Versions
@@ -34,4 +34,7 @@ libc {
     # _*
     _test_and_set;
   }
+  GLIBC_2.11 {
+    fallocate64;
+  }
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=db99b35dde877dfe4882809b802e932f4bd1fd52

commit db99b35dde877dfe4882809b802e932f4bd1fd52
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat May 16 14:29:06 2009 +0000

    Add fallocate64 export for ARM.
    
    	* sysdeps/unix/sysv/linux/arm/Versions (libc): Add
    	fallocate64@@GLIBC_2.11.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index c9f44f4..4b304fb 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-05-16  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/Versions (libc): Add
+	fallocate64@@GLIBC_2.11.
+
 2009-04-25  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/arm/eabi/fpu_control.h: If soft-float, don't use
diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions
index 2ddb2af..1d9e964 100644
--- a/sysdeps/unix/sysv/linux/arm/Versions
+++ b/sysdeps/unix/sysv/linux/arm/Versions
@@ -34,4 +34,7 @@ libc {
   GLIBC_2.3.3 {
     posix_fadvise64; posix_fallocate64;
   }
+  GLIBC_2.11 {
+    fallocate64;
+  }
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9c052b7cc1a903d5de8152d4cc9096c8f8f5f0e1

commit 9c052b7cc1a903d5de8152d4cc9096c8f8f5f0e1
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Sat May 16 10:36:20 2009 +0200

    Remove .cvsignore files

diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 613f66d..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-glibc-ports-*.tar* glibc-port-*.tar*
diff --git a/bare/.cvsignore b/bare/.cvsignore
deleted file mode 100644
index 3fc9f4c..0000000
--- a/bare/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-*.d *.o *.so *.po *.go stamp.* *.stamp *.ustamp *.udeps
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*
-distinfo
diff --git a/sysdeps/mips/.cvsignore b/sysdeps/mips/.cvsignore
deleted file mode 100644
index 1f69fd9..0000000
--- a/sysdeps/mips/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*
diff --git a/sysdeps/unix/bsd/sun/sunos4/.cvsignore b/sysdeps/unix/bsd/sun/sunos4/.cvsignore
deleted file mode 100644
index 1f69fd9..0000000
--- a/sysdeps/unix/bsd/sun/sunos4/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=19afa982843fdffafb27213d8ca86acb34fcdd94

commit 19afa982843fdffafb27213d8ca86acb34fcdd94
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu May 14 22:24:35 2009 +0000

    Fix MIPS n64 build failure with preadv64/pwritev64 aliases.
    
    	* sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c: New files.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 5887530..a4759d9 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-05-14  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c: New files.
+
 2009-04-18  Maciej W. Rozycki  <macro@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/getcontext.S: New file.
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c
new file mode 100644
index 0000000..fd9320c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c
@@ -0,0 +1 @@
+/* Empty since the preadv syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c
new file mode 100644
index 0000000..8b72a29
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c
@@ -0,0 +1 @@
+/* Empty since the pwritev syscall is equivalent.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2b2b217196eecc58505cca0d9cb6f6407d8780b3

commit 2b2b217196eecc58505cca0d9cb6f6407d8780b3
Author: Andreas Schwab <schwab@suse.de>
Date:   Sat Apr 25 19:30:25 2009 +0000

    * sysdeps/unix/sysv/linux/m68k/kernel-features.h: Revert last
    change, the syscalls have been added to 2.6.30-rc4.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index ef7d08d..c68e94a 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2009-04-25  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* sysdeps/unix/sysv/linux/m68k/kernel-features.h: Revert last
+	change, the syscalls have been added to 2.6.30-rc4.
+
 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_PREADV,
@@ -343,7 +348,7 @@
 	(catch_segfault): Likewise.
 	(register_dump): Use the Coldfire-specific sigcontext fields to
 	display call-saved data and address registers (rather than the
-	data stored in sc_fpstate by real_catch_segfault).  Display 8-byte 
+	data stored in sc_fpstate by real_catch_segfault).  Display 8-byte
 	floating-point registers on Coldfire.
 	* sysdeps/unix/sysv/linux/m68k/socket.S (__socket): Pass a temporary
 	register to SINGLE_THREAD_P.
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index d897562..2920943 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -1,6 +1,6 @@
 /* Set flags signalling availability of kernel features based on given
    kernel version number.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -39,5 +39,3 @@
 /* These syscalls are not implemented yet for m68k.  */
 #undef __ASSUME_PSELECT
 #undef __ASSUME_PPOLL
-#undef __ASSUME_PREADV
-#undef __ASSUME_PWRITEV

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ba35741e51b9292eb52617d2382910d26e8a1da3

commit ba35741e51b9292eb52617d2382910d26e8a1da3
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat Apr 25 15:23:44 2009 +0000

    2009-04-25  Aurelien Jarno  <aurelien@aurel32.net>
    
    	* sysdeps/arm/eabi/fpu_control.h: If soft-float, don't use
    	floating-point registers.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 779ef2d..c9f44f4 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-04-25  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/arm/eabi/fpu_control.h: If soft-float, don't use
+	floating-point registers.
+
 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PREADV,
diff --git a/sysdeps/arm/eabi/fpu_control.h b/sysdeps/arm/eabi/fpu_control.h
index 55d7764..9d29994 100644
--- a/sysdeps/arm/eabi/fpu_control.h
+++ b/sysdeps/arm/eabi/fpu_control.h
@@ -1,5 +1,5 @@
 /* FPU control word definitions.  ARM VFP version.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2009 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
@@ -20,6 +20,17 @@
 #ifndef _FPU_CONTROL_H
 #define _FPU_CONTROL_H
 
+#if !defined(_LIBC) && defined(__SOFTFP__)
+
+#define _FPU_RESERVED 0xffffffff
+#define _FPU_DEFAULT  0x00000000
+typedef unsigned int fpu_control_t;
+#define _FPU_GETCW(cw) 0
+#define _FPU_SETCW(cw) do { } while (0)
+extern fpu_control_t __fpu_control;
+
+#else
+
 /* masking of interrupts */
 #define _FPU_MASK_IM	0x00000100	/* invalid operation */
 #define _FPU_MASK_ZM	0x00000200	/* divide by zero */
@@ -48,4 +59,6 @@ typedef unsigned int fpu_control_t;
 /* Default control word set at startup.  */
 extern fpu_control_t __fpu_control;
 
+#endif /* __SOFTFP__ */
+
 #endif /* _FPU_CONTROL_H */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=84c54b39d242e6c8231df015b7b7fb582dcf056e

commit 84c54b39d242e6c8231df015b7b7fb582dcf056e
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Apr 24 20:37:17 2009 +0000

    2009-04-24  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/hppa/hppa1.1/s_signbit.c: New file.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index e43ad65..60480d1 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,7 @@
+2009-04-24  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/hppa/hppa1.1/s_signbit.c: New file.
+
 2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/hppa/dl-machine.h: Remove VALID_ELF_OSABI,
diff --git a/sysdeps/hppa/hppa1.1/s_signbit.c b/sysdeps/hppa/hppa1.1/s_signbit.c
new file mode 100644
index 0000000..d9d4f8b
--- /dev/null
+++ b/sysdeps/hppa/hppa1.1/s_signbit.c
@@ -0,0 +1,35 @@
+/* Return nonzero value if number is negative.
+   Copyright (C) 1997, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <math.h>
+
+#include "math_private.h"
+
+int
+__signbit (double x)
+{
+  int32_t hx;
+
+  GET_HIGH_WORD (hx, x);
+  return hx & 0x80000000;
+}
+#ifdef NO_LONG_DOUBLE
+strong_alias (__signbit, __signbitl)
+#endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ec4cafcbcd5304020bb3d938e7f37373d32d3168

commit ec4cafcbcd5304020bb3d938e7f37373d32d3168
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Apr 24 02:53:23 2009 +0000

    2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/hppa/dl-machine.h: Remove VALID_ELF_OSABI,
    	VALID_ELF_ABIVERSION, and VALID_ELF_HEADER.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index e26de63..e43ad65 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,5 +1,10 @@
 2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
 
+	* sysdeps/hppa/dl-machine.h: Remove VALID_ELF_OSABI,
+	VALID_ELF_ABIVERSION, and VALID_ELF_HEADER.
+
+2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Do not include
 	sysdep.h. Document the reason for other includes.
 
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index 503bbca..e462fd3 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -33,13 +33,6 @@
 #include <abort-instr.h>
 #include <tls.h>
 
-# define VALID_ELF_OSABI(osabi)		((osabi == ELFOSABI_SYSV) || (osabi == ELFOSABI_LINUX))
-# define VALID_ELF_ABIVERSION(ver)	(ver == 0)
-# define VALID_ELF_HEADER(hdr,exp,size) \
-  memcmp (hdr,exp,size-2) == 0 \
-  && VALID_ELF_OSABI (hdr[EI_OSABI]) \
-  && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
-
 /* These two definitions must match the definition of the stub in 
    bfd/elf32-hppa.c (see plt_stub[]).
    

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=783398d8c28a1686cf2202bf5740158e90ee034f

commit 783398d8c28a1686cf2202bf5740158e90ee034f
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Apr 24 02:50:30 2009 +0000

    2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Do not include
    	sysdep.h. Document the reason for other includes.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index aebfc57..e26de63 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,5 +1,10 @@
 2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Do not include
+	sysdep.h. Document the reason for other includes.
+
+2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/hppa/sysdep.h [!__ASSEMBLER__]:
 	Include errno.h.
 
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
index 2964732..d7c8b9d 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -17,10 +17,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <stdint.h>
-#include <sysdep.h>
-#include <abort-instr.h>
-#include <kernel-features.h>
+#include <stdint.h> /*  Required for type definitions e.g. uint8_t.  */
+#include <abort-instr.h> /*  Required for ABORT_INSTRUCTIUON.  */
+#include <kernel-features.h> /*  Required for __ASSUME_LWS_CAS.  */
 
 /* We need EFAULT, ENONSYS */
 #if !defined EFAULT && !defined ENOSYS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fa34de41160e0a05a465666cb0ed930c9982a15b

commit fa34de41160e0a05a465666cb0ed930c9982a15b
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Apr 24 02:48:15 2009 +0000

    2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/sysdep.h [!__ASSEMBLER__]:
    	Include errno.h.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index b673000..aebfc57 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,8 @@
+2009-04-23  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/sysdep.h [!__ASSEMBLER__]:
+	Include errno.h.
+
 2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h:
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h
index 96632a1..e22e571 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep.h
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -24,6 +24,11 @@
 #include <sysdeps/generic/sysdep.h>
 #include <sys/syscall.h>
 
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 #undef ASM_LINE_SEP
 #define ASM_LINE_SEP ! 
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ff3475331e3007db16d792b1e1489170b71308a1

commit ff3475331e3007db16d792b1e1489170b71308a1
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat Apr 18 17:32:04 2009 +0000

    2009-04-18  Maciej W. Rozycki  <macro@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/mips/getcontext.S: New file.
    	* sysdeps/unix/sysv/linux/mips/makecontext.S: New file.
    	* sysdeps/unix/sysv/linux/mips/setcontext.S: New file.
    	* sysdeps/unix/sysv/linux/mips/swapcontext.S: New file.
    	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h (mcontext_t):
    	Update comment.
    	* sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h: New file.
    	* sysdeps/unix/sysv/linux/mips/ucontext_i.sym: New file.
    	* sysdeps/unix/sysv/linux/mips/Makefile (gen-as-const-headers):
    	Add ucontext_i.sym.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index e8a7a11..5887530 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,16 @@
+2009-04-18  Maciej W. Rozycki  <macro@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/getcontext.S: New file.
+	* sysdeps/unix/sysv/linux/mips/makecontext.S: New file.
+	* sysdeps/unix/sysv/linux/mips/setcontext.S: New file.
+	* sysdeps/unix/sysv/linux/mips/swapcontext.S: New file.
+	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h (mcontext_t):
+	Update comment.
+	* sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h: New file.
+	* sysdeps/unix/sysv/linux/mips/ucontext_i.sym: New file.
+	* sysdeps/unix/sysv/linux/mips/Makefile (gen-as-const-headers): 
+	Add ucontext_i.sym.
+
 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_PREADV,
diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile
index 110fccb..162f1b9 100644
--- a/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/Makefile
@@ -135,3 +135,7 @@ sysdep_routines += dl-static
 sysdep-rtld-routines += dl-static
 endif
 endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/unix/sysv/linux/mips/getcontext.S b/sysdeps/unix/sysv/linux/mips/getcontext.S
new file mode 100644
index 0000000..1e77467
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/getcontext.S
@@ -0,0 +1,149 @@
+/* Save current context.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
+
+   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, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#include <sysdep.h>
+#include <sys/asm.h>
+#include <sys/fpregdef.h>
+#include <sys/regdef.h>
+
+#include "ucontext_i.h"
+
+/* int getcontext (ucontext_t *ucp) */
+
+	.text
+LOCALSZ = 0
+MASK = 0x00000000
+#ifdef __PIC__
+LOCALSZ = 1						/* save gp */
+# if _MIPS_SIM != _ABIO32
+MASK = 0x10000000
+# endif
+#endif
+FRAMESZ = ((LOCALSZ * SZREG) + ALSZ) & ALMASK
+GPOFF = FRAMESZ - (1 * SZREG)
+
+NESTED (__getcontext, FRAMESZ, ra)
+	.mask	MASK, 0
+	.fmask	0x00000000, 0
+
+#ifdef __PIC__
+	SETUP_GP
+
+	move	a2, sp
+# define _SP a2
+
+# if _MIPS_SIM != _ABIO32
+	move	a3, gp
+#  define _GP a3
+# endif
+
+	PTR_ADDIU sp, -FRAMESZ
+	SETUP_GP64 (GPOFF, __getcontext)
+	SAVE_GP (GPOFF)
+
+#else  /* ! __PIC__ */
+# define _SP sp
+# define _GP gp
+
+#endif /* ! __PIC__ */
+
+#ifdef PROF
+	.set	noat
+	move	AT, ra
+	jal	_mcount
+	.set	at
+#endif
+
+	/* Store a magic flag.	*/
+	li	v1, 1
+	REG_S	v1, (0 * SZREG + MCONTEXT_GREGS)(a0)	/* zero */
+
+	REG_S	s0, (16 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s1, (17 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s2, (18 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s3, (19 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s4, (20 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s5, (21 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s6, (22 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s7, (23 * SZREG + MCONTEXT_GREGS)(a0)
+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
+	REG_S	_GP, (28 * SZREG + MCONTEXT_GREGS)(a0)
+#endif
+	REG_S	_SP, (29 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	fp, (30 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	ra, (31 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	ra, MCONTEXT_PC(a0)
+
+#ifdef __mips_hard_float
+# if _MIPS_SIM == _ABI64
+	s.d	fs0, (24 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs1, (25 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs2, (26 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs3, (27 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs5, (29 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs6, (30 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs7, (31 * SZREG + MCONTEXT_FPREGS)(a0)
+
+# else  /* _MIPS_SIM != _ABI64 */
+	s.d	fs0, (20 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs1, (22 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs2, (24 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs3, (26 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs5, (30 * SZREG + MCONTEXT_FPREGS)(a0)
+
+# endif /* _MIPS_SIM != _ABI64 */
+
+	cfc1	v1, fcr31
+	sw	v1, MCONTEXT_FPC_CSR(a0)
+#endif /* __mips_hard_float */
+
+/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
+	li	a3, _NSIG8
+	PTR_ADDU a2, a0, UCONTEXT_SIGMASK
+	move	a1, zero
+	li	a0, SIG_BLOCK
+
+	li	v0, SYS_ify (rt_sigprocmask)
+	syscall
+	bnez	a3, 99f
+
+#ifdef __PIC__
+	RESTORE_GP64
+	PTR_ADDIU sp, FRAMESZ
+#endif
+	move	v0, zero
+	jr	ra
+
+99:
+#ifdef __PIC__
+	PTR_LA	t9, JUMPTARGET (__syscall_error)
+	RESTORE_GP64
+	PTR_ADDIU sp, FRAMESZ
+	jr	t9
+
+#else  /* ! __PIC__ */
+
+	j	JUMPTARGET (__syscall_error)
+#endif /* ! __PIC__ */
+PSEUDO_END (__getcontext)
+
+weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h b/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h
new file mode 100644
index 0000000..edf8d45
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h
@@ -0,0 +1,10 @@
+/* Linux kernel RT signal frame. */
+typedef struct kernel_rt_sigframe
+  {
+    uint32_t rs_ass[4];
+    uint32_t rs_code[2];
+    struct siginfo rs_info;
+    struct ucontext rs_uc;
+    uint32_t rs_altcode[8] __attribute__ ((__aligned__ (1 << 7)));
+  }
+kernel_rt_sigframe_t;
diff --git a/sysdeps/unix/sysv/linux/mips/makecontext.S b/sysdeps/unix/sysv/linux/mips/makecontext.S
new file mode 100644
index 0000000..cceee3f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/makecontext.S
@@ -0,0 +1,189 @@
+/* Modify saved context.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
+
+   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, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#include <sysdep.h>
+#include <sys/asm.h>
+#include <sys/fpregdef.h>
+#include <sys/regdef.h>
+
+#include "ucontext_i.h"
+
+/* int makecontext (ucontext_t *ucp, (void *func) (), int argc, ...) */
+
+	.text
+LOCALSZ = 0
+ARGSZ = 0
+MASK = 0x00000000
+#ifdef __PIC__
+LOCALSZ = 1						/* save gp */
+#endif
+#if _MIPS_SIM != _ABIO32
+ARGSZ = 5						/* save a3-a7 */
+# ifdef __PIC__
+MASK = 0x10000000
+# endif
+#endif
+FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK
+GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG)
+#if _MIPS_SIM != _ABIO32
+A3OFF = FRAMESZ - (5 * SZREG)				/* callee-allocated */
+A4OFF = FRAMESZ - (4 * SZREG)
+A5OFF = FRAMESZ - (3 * SZREG)
+A6OFF = FRAMESZ - (2 * SZREG)
+A7OFF = FRAMESZ - (1 * SZREG)
+NARGREGS = 8
+#else
+A3OFF = FRAMESZ + (3 * SZREG)				/* caller-allocated */
+NARGREGS = 4
+#endif
+
+NESTED (__makecontext, FRAMESZ, ra)
+	.mask	MASK, -(ARGSZ * SZREG)
+	.fmask	0x00000000, 0
+
+98:
+#ifdef __PIC__
+	SETUP_GP
+#endif
+
+	PTR_ADDIU sp, -FRAMESZ
+
+#ifdef __PIC__
+	SETUP_GP64 (GPOFF, __makecontext)
+	SAVE_GP (GPOFF)
+#endif
+
+#ifdef PROF
+	.set	noat
+	move	AT, ra
+	jal	_mcount
+	.set	at
+#endif
+
+	/* Store args to be passed.  */
+	REG_S	a3, A3OFF(sp)
+#if _MIPS_SIM != _ABIO32
+	REG_S	a4, A4OFF(sp)
+	REG_S	a5, A5OFF(sp)
+	REG_S	a6, A6OFF(sp)
+	REG_S	a7, A7OFF(sp)
+#endif
+
+	/* Store a magic flag.  */
+	li	v1, 1
+	REG_S	v1, (0 * SZREG + MCONTEXT_GREGS)(a0)	/* zero */
+
+	/* Set up the stack.  */
+	PTR_L	t0, STACK_SP(a0)
+	PTR_L	t2, STACK_SIZE(a0)
+	PTR_ADDIU t1, sp, A3OFF
+	PTR_ADDU t0, t2
+	and	t0, ALMASK
+	blez	a2, 2f					/* no arguments */
+
+	/* Store register arguments.  */
+	PTR_ADDIU t2, a0, MCONTEXT_GREGS + 4 * SZREG
+	move	t3, zero
+0:
+	addiu	t3, 1
+	REG_L	v1, (t1)
+	PTR_ADDIU t1, SZREG
+	REG_S	v1, (t2)
+	PTR_ADDIU t2, SZREG
+	bgeu	t3, a2, 2f				/* all done */
+	bltu	t3, NARGREGS, 0b			/* next */
+
+	/* Make room for stack arguments.  */
+	PTR_SUBU t2, a2, t3
+	PTR_SLL	t2, 3
+	PTR_SUBU t0, t2
+	and	t0, ALMASK
+
+	/* Store stack arguments.  */
+	move	t2, t0
+1:
+	addiu	t3, 1
+	REG_L	v1, (t1)
+	PTR_ADDIU t1, SZREG
+	REG_S	v1, (t2)
+	PTR_ADDIU t2, SZREG
+	bltu	t3, a2, 1b				/* next */
+
+2:
+#if _MIPS_SIM == _ABIO32
+	/* Make room for a0-a3 storage.  */
+	PTR_ADDIU t0, -(NARGSAVE * SZREG)
+#endif
+	PTR_L	v1, UCONTEXT_LINK(a0)
+#ifdef __PIC__
+	PTR_ADDIU t9, 99f - 98b
+#else
+	PTR_LA	t9, 99f
+#endif
+	REG_S	t0, (29 * SZREG + MCONTEXT_GREGS)(a0)	/* sp */
+	REG_S	v1, (16 * SZREG + MCONTEXT_GREGS)(a0)	/* s0 */
+#ifdef __PIC__
+	REG_S	gp, (17 * SZREG + MCONTEXT_GREGS)(a0)	/* s1 */
+#endif
+	REG_S	t9, (31 * SZREG + MCONTEXT_GREGS)(a0)	/* ra */
+	REG_S	a1, MCONTEXT_PC(a0)
+
+#ifdef __PIC__
+	RESTORE_GP64
+	PTR_ADDIU sp, FRAMESZ
+#endif
+	jr	ra
+
+99:
+#ifdef __PIC__
+	move	gp, s1
+#endif
+	move	a0, zero
+	beqz	s0, 0f
+
+	/* setcontext (ucp) */
+	move	a0, s0
+#ifdef __PIC__
+	PTR_LA	t9, JUMPTARGET (__setcontext)
+	jalr	t9
+# if _MIPS_SIM == _ABIO32
+	move	gp, s1
+# endif
+#else
+	jal	JUMPTARGET (__setcontext)
+#endif
+	move	a0, v0
+
+0:
+	/* exit (a0) */
+#ifdef __PIC__
+	PTR_LA	t9, HIDDEN_JUMPTARGET (exit)
+	jalr	t9
+#else
+	jal	HIDDEN_JUMPTARGET (exit)
+#endif
+
+	/* You don't exist, you won't feel anything.  */
+1:
+	lb	zero, (zero)
+	b	1b
+PSEUDO_END (__makecontext)
+
+weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/mips/setcontext.S b/sysdeps/unix/sysv/linux/mips/setcontext.S
new file mode 100644
index 0000000..186f3a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/setcontext.S
@@ -0,0 +1,192 @@
+/* Set current context.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
+
+   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, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#include <sysdep.h>
+#include <sys/asm.h>
+#include <sys/fpregdef.h>
+#include <sys/regdef.h>
+
+#include "ucontext_i.h"
+
+/* int setcontext (const ucontext_t *ucp) */
+
+	.text
+LOCALSZ = 0
+ARGSZ = 0
+MASK = 0x00000000
+#ifdef __PIC__
+LOCALSZ = 1						/* save gp */
+#endif
+#if _MIPS_SIM != _ABIO32
+ARGSZ = 1						/* save a0 */
+# ifdef __PIC__
+MASK = 0x10000000
+# endif
+#endif
+FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK
+GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG)
+#if _MIPS_SIM != _ABIO32
+A0OFF = FRAMESZ - (1 * SZREG)				/* callee-allocated */
+#else
+A0OFF = FRAMESZ + (0 * SZREG)				/* caller-allocated */
+#endif
+
+NESTED (__setcontext, FRAMESZ, ra)
+	.mask	MASK, -(ARGSZ * SZREG)
+	.fmask	0x00000000, 0
+
+#ifdef __PIC__
+	SETUP_GP
+#endif
+
+	PTR_ADDIU sp, -FRAMESZ
+
+#ifdef __PIC__
+	SETUP_GP64 (GPOFF, __setcontext)
+	SAVE_GP (GPOFF)
+#endif
+
+#ifdef PROF
+	.set	noat
+	move	AT, ra
+	jal	_mcount
+	.set	at
+#endif
+
+	/* Check for the magic flag.  */
+	li	v0, 1
+	REG_L	v1, (0 * SZREG + MCONTEXT_GREGS)(a0)	/* zero */
+	bne	v0, v1, 98f
+
+	REG_S	a0, A0OFF(sp)
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
+	li	a3, _NSIG8
+	move	a2, zero
+	PTR_ADDU a1, a0, UCONTEXT_SIGMASK
+	li	a0, SIG_SETMASK
+
+	li	v0, SYS_ify (rt_sigprocmask)
+	syscall
+	bnez	a3, 99f
+
+	REG_L	v0, A0OFF(sp)
+
+#ifdef __mips_hard_float
+# if _MIPS_SIM == _ABI64
+	l.d	fs0, (24 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs1, (25 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs2, (26 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs3, (27 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs5, (29 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs6, (30 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs7, (31 * SZREG + MCONTEXT_FPREGS)(v0)
+
+# else  /* _MIPS_SIM != _ABI64 */
+	l.d	fs0, (20 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs1, (22 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs2, (24 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs3, (26 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs5, (30 * SZREG + MCONTEXT_FPREGS)(v0)
+
+# endif /* _MIPS_SIM != _ABI64 */
+
+	lw	v1, MCONTEXT_FPC_CSR(v0)
+	ctc1	v1, fcr31
+#endif /* __mips_hard_float */
+
+	/* Note the contents of argument registers will be random
+	   unless makecontext() has been called.  */
+	REG_L	a0, (4 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a1, (5 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a2, (6 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a3, (7 * SZREG + MCONTEXT_GREGS)(v0)
+#if _MIPS_SIM != _ABIO32
+	REG_L	a4, (8 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a5, (9 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a6, (10 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a7, (11 * SZREG + MCONTEXT_GREGS)(v0)
+#endif
+
+	REG_L	s0, (16 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s1, (17 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s2, (18 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s3, (19 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s4, (20 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s5, (21 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s6, (22 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s7, (23 * SZREG + MCONTEXT_GREGS)(v0)
+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
+	REG_L	gp, (28 * SZREG + MCONTEXT_GREGS)(v0)
+#endif
+	REG_L	sp, (29 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	fp, (30 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	ra, (31 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	t9, MCONTEXT_PC(v0)
+
+	move	v0, zero
+	jr	t9
+
+98:
+	/* This is a context obtained from a signal handler.
+	   Perform a full restore by pushing the context
+	   passed onto a simulated signal frame on the stack
+	   and call the signal return syscall as if a signal
+	   handler exited normally.  */
+	PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
+
+	/* Only ucontext is referred to from rt_sigreturn,
+	   copy it.  */
+	PTR_ADDIU t1, sp, RT_SIGFRAME_UCONTEXT
+	li	t3, ((UCONTEXT_SIZE + SZREG - 1) / SZREG) - 1
+0:
+	REG_L	t2, (a0)
+	PTR_ADDIU a0, SZREG
+	REG_S	t2, (t1)
+	PTR_ADDIU t1, SZREG
+	.set	noreorder
+	bgtz	t3, 0b
+	 addiu	t3, -1
+	.set	reorder
+
+/* rt_sigreturn () -- no arguments, sp points to struct rt_sigframe.  */
+	li	v0, SYS_ify (rt_sigreturn)
+	syscall
+
+	/* Restore the stack and fall through to the error
+	   path.  Successful rt_sigreturn never returns to
+	   its calling place.  */
+	PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
+99:
+#ifdef __PIC__
+	PTR_LA	t9, JUMPTARGET (__syscall_error)
+	RESTORE_GP64
+	PTR_ADDIU sp, FRAMESZ
+	jr	t9
+
+#else  /* ! __PIC__ */
+
+	j	JUMPTARGET (__syscall_error)
+#endif /* ! __PIC__ */
+PSEUDO_END (__setcontext)
+
+weak_alias (__setcontext, setcontext)
diff --git a/sysdeps/unix/sysv/linux/mips/swapcontext.S b/sysdeps/unix/sysv/linux/mips/swapcontext.S
new file mode 100644
index 0000000..b0b8417
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/swapcontext.S
@@ -0,0 +1,212 @@
+/* Save and set current context.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
+
+   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, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#include <sysdep.h>
+#include <sys/asm.h>
+#include <sys/fpregdef.h>
+#include <sys/regdef.h>
+
+#include "ucontext_i.h"
+
+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
+
+	.text
+LOCALSZ = 0
+ARGSZ = 0
+MASK = 0x00000000
+#ifdef __PIC__
+LOCALSZ = 1						/* save gp */
+#endif
+#if _MIPS_SIM != _ABIO32
+ARGSZ = 1						/* save a1 */
+# ifdef __PIC__
+MASK = 0x10000000
+# endif
+#endif
+FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK
+GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG)
+#if _MIPS_SIM != _ABIO32
+A1OFF = FRAMESZ - (1 * SZREG)				/* callee-allocated */
+#else
+A1OFF = FRAMESZ + (1 * SZREG)				/* caller-allocated */
+#endif
+
+NESTED (__swapcontext, FRAMESZ, ra)
+	.mask	MASK, -(ARGSZ * SZREG)
+	.fmask	0x00000000, 0
+
+#ifdef __PIC__
+	SETUP_GP
+
+	move	a2, sp
+# define _SP a2
+
+# if _MIPS_SIM != _ABIO32
+	move	a3, gp
+#  define _GP a3
+# endif
+
+	PTR_ADDIU sp, -FRAMESZ
+	SETUP_GP64 (GPOFF, __swapcontext)
+	SAVE_GP (GPOFF)
+
+#else  /* ! __PIC__ */
+# define _SP sp
+# define _GP gp
+
+#endif /* ! __PIC__ */
+
+#ifdef PROF
+	.set	noat
+	move	AT, ra
+	jal	_mcount
+	.set	at
+#endif
+
+	/* Store a magic flag.	*/
+	li	v1, 1
+	REG_S	v1, (0 * SZREG + MCONTEXT_GREGS)(a0)	/* zero */
+
+	REG_S	s0, (16 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s1, (17 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s2, (18 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s3, (19 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s4, (20 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s5, (21 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s6, (22 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	s7, (23 * SZREG + MCONTEXT_GREGS)(a0)
+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
+	REG_S	_GP, (28 * SZREG + MCONTEXT_GREGS)(a0)
+#endif
+	REG_S	_SP, (29 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	fp, (30 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	ra, (31 * SZREG + MCONTEXT_GREGS)(a0)
+	REG_S	ra, MCONTEXT_PC(a0)
+
+#ifdef __mips_hard_float
+# if _MIPS_SIM == _ABI64
+	s.d	fs0, (24 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs1, (25 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs2, (26 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs3, (27 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs5, (29 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs6, (30 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs7, (31 * SZREG + MCONTEXT_FPREGS)(a0)
+
+# else  /* _MIPS_SIM != _ABI64 */
+	s.d	fs0, (20 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs1, (22 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs2, (24 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs3, (26 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
+	s.d	fs5, (30 * SZREG + MCONTEXT_FPREGS)(a0)
+
+# endif /* _MIPS_SIM != _ABI64 */
+
+	cfc1	v1, fcr31
+	sw	v1, MCONTEXT_FPC_CSR(a0)
+#endif /* __mips_hard_float */
+
+	REG_S	a1, A1OFF(sp)
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */
+	li	a3, _NSIG8
+	PTR_ADDU a2, a0, UCONTEXT_SIGMASK
+	PTR_ADDU a1, a1, UCONTEXT_SIGMASK
+	li	a0, SIG_SETMASK
+
+	li	v0, SYS_ify (rt_sigprocmask)
+	syscall
+	bnez	a3, 99f
+
+	REG_L	v0, A1OFF(sp)
+
+#ifdef __mips_hard_float
+# if _MIPS_SIM == _ABI64
+	l.d	fs0, (24 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs1, (25 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs2, (26 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs3, (27 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs5, (29 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs6, (30 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs7, (31 * SZREG + MCONTEXT_FPREGS)(v0)
+
+# else  /* _MIPS_SIM != _ABI64 */
+	l.d	fs0, (20 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs1, (22 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs2, (24 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs3, (26 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
+	l.d	fs5, (30 * SZREG + MCONTEXT_FPREGS)(v0)
+
+# endif /* _MIPS_SIM != _ABI64 */
+
+	lw	v1, MCONTEXT_FPC_CSR(v0)
+	ctc1	v1, fcr31
+#endif /* __mips_hard_float */
+
+	/* Note the contents of argument registers will be random
+	   unless makecontext() has been called.  */
+	REG_L	a0, (4 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a1, (5 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a2, (6 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a3, (7 * SZREG + MCONTEXT_GREGS)(v0)
+#if _MIPS_SIM != _ABIO32
+	REG_L	a4, (8 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a5, (9 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a6, (10 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	a7, (11 * SZREG + MCONTEXT_GREGS)(v0)
+#endif
+
+	REG_L	s0, (16 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s1, (17 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s2, (18 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s3, (19 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s4, (20 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s5, (21 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s6, (22 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	s7, (23 * SZREG + MCONTEXT_GREGS)(v0)
+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
+	REG_L	gp, (28 * SZREG + MCONTEXT_GREGS)(v0)
+#endif
+	REG_L	sp, (29 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	fp, (30 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	ra, (31 * SZREG + MCONTEXT_GREGS)(v0)
+	REG_L	t9, MCONTEXT_PC(v0)
+
+	move	v0, zero
+	jr	t9
+
+99:
+#ifdef __PIC__
+	PTR_LA	t9, JUMPTARGET (__syscall_error)
+	RESTORE_GP64
+	PTR_ADDIU sp, FRAMESZ
+	jr	t9
+
+#else  /* ! __PIC__ */
+
+	j	JUMPTARGET (__syscall_error)
+#endif /* ! __PIC__ */
+PSEUDO_END (__swapcontext)
+
+weak_alias (__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
index ac496f3..251f0c8 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006 Free Software
+/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006, 2009 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
@@ -56,12 +56,9 @@ typedef struct fpregset {
 #if _MIPS_SIM == _ABIO32
 /* Earlier versions of glibc for mips had an entirely different
    definition of mcontext_t, that didn't even resemble the
-   corresponding kernel data structure.  Since all legitimate uses of
-   ucontext_t in glibc mustn't have accessed anything beyond
-   uc_mcontext and, even then, taking a pointer to it, casting it to
-   sigcontext_t, and accessing it as such, which is what it has always
-   been, this can still be rectified.  Fortunately, makecontext,
-   [gs]etcontext et all have never been implemented.  */
+   corresponding kernel data structure.  Fortunately, makecontext,
+   [gs]etcontext et all were not implemented back then, so this can
+   still be rectified.  */
 typedef struct
   {
     unsigned int regmask;
diff --git a/sysdeps/unix/sysv/linux/mips/ucontext_i.sym b/sysdeps/unix/sysv/linux/mips/ucontext_i.sym
new file mode 100644
index 0000000..f14b886
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/ucontext_i.sym
@@ -0,0 +1,52 @@
+#include <inttypes.h>
+#include <signal.h>
+#include <stddef.h>
+#include <sys/ucontext.h>
+
+#include <kernel_rt_sigframe.h>
+
+-- Constants used by the rt_sigprocmask call.
+
+SIG_BLOCK
+SIG_SETMASK
+
+_NSIG8				(_NSIG / 8)
+
+-- Offsets of the fields in the kernel rt_sigframe_t structure.
+#define rt_sigframe(member)	offsetof (kernel_rt_sigframe_t, member)
+
+RT_SIGFRAME_UCONTEXT		rt_sigframe (rs_uc)
+
+RT_SIGFRAME_SIZE		sizeof (kernel_rt_sigframe_t)
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member)	offsetof (ucontext_t, member)
+#define stack(member)		ucontext (uc_stack.member)
+#define mcontext(member)	ucontext (uc_mcontext.member)
+
+UCONTEXT_FLAGS			ucontext (uc_flags)
+UCONTEXT_LINK			ucontext (uc_link)
+UCONTEXT_STACK			ucontext (uc_stack)
+UCONTEXT_MCONTEXT		ucontext (uc_mcontext)
+UCONTEXT_SIGMASK		ucontext (uc_sigmask)
+
+STACK_SP			stack (ss_sp)
+STACK_SIZE			stack (ss_size)
+STACK_FLAGS			stack (ss_flags)
+
+MCONTEXT_GREGS			mcontext (gregs)
+MCONTEXT_FPREGS			mcontext (fpregs)
+MCONTEXT_MDHI			mcontext (mdhi)
+MCONTEXT_HI1			mcontext (hi1)
+MCONTEXT_HI2			mcontext (hi2)
+MCONTEXT_HI3			mcontext (hi3)
+MCONTEXT_MDLO			mcontext (mdlo)
+MCONTEXT_LO1			mcontext (lo1)
+MCONTEXT_LO2			mcontext (lo2)
+MCONTEXT_LO3			mcontext (lo3)
+MCONTEXT_PC			mcontext (pc)
+MCONTEXT_FPC_CSR		mcontext (fpc_csr)
+MCONTEXT_USED_MATH		mcontext (used_math)
+MCONTEXT_DSP			mcontext (dsp)
+
+UCONTEXT_SIZE			sizeof (ucontext_t)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=19d6bdd79a7b35f36fda4b9b0e5cd860d4f5d656

commit 19d6bdd79a7b35f36fda4b9b0e5cd860d4f5d656
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat Apr 18 16:26:00 2009 +0000

    	* sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_PREADV,
    	__ASSUME_PWRITEV): Undefine.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index b630578..ef7d08d 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2009-04-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_PREADV,
+	__ASSUME_PWRITEV): Undefine.
+
 2009-03-17  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/getsysstats.c (GET_NPROCS_PARSER):
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 9a6d23d..d897562 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -39,3 +39,5 @@
 /* These syscalls are not implemented yet for m68k.  */
 #undef __ASSUME_PSELECT
 #undef __ASSUME_PPOLL
+#undef __ASSUME_PREADV
+#undef __ASSUME_PWRITEV

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=80c0ce1cac739218fa077672903267fdebe34c7d

commit 80c0ce1cac739218fa077672903267fdebe34c7d
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat Apr 18 14:08:41 2009 +0000

    	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PREADV,
    	__ASSUME_PWRITEV): Undefine.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index d554bfb..779ef2d 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-04-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PREADV,
+	__ASSUME_PWRITEV): Undefine.
+
 2009-03-16  Khem Raj  <raj.khem@gmail.com>
 
 	* sysdeps/unix/sysv/linux/arm/sysdep.h: Include errno.h.
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index ea439d5..b33c968 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -56,3 +56,5 @@
 /* These syscalls are not implemented yet for ARM.  */
 #undef __ASSUME_PSELECT
 #undef __ASSUME_PPOLL
+#undef __ASSUME_PREADV
+#undef __ASSUME_PWRITEV

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=57d0274fe9028205f2431ab323f95a5021601a74

commit 57d0274fe9028205f2431ab323f95a5021601a74
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat Apr 18 14:08:18 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_PREADV,
    	__ASSUME_PWRITEV): Don't define here.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 4e6ce79..e8a7a11 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-04-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_PREADV,
+	__ASSUME_PWRITEV): Don't define here.
+
 2009-04-15  Maciej W. Rozycki  <macro@codesourcery.com>
 
 	* sysdeps/mips/sys/fpregdef.h: Update for new ABIs.
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index 1cdf19e..f479b60 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -31,10 +31,4 @@
 # define __ASSUME_FCNTL64		1
 #endif
 
-/* Support for preadv and pwritev was added in 2.6.30.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061e
-# define __ASSUME_PREADV	1
-# define __ASSUME_PWRITEV	1
-#endif
-
 #include_next <kernel-features.h>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6db53cd54801d6c1b018d1046fd848739643c5e4

commit 6db53cd54801d6c1b018d1046fd848739643c5e4
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Apr 15 20:22:41 2009 +0000

    2009-04-15  Maciej W. Rozycki  <macro@codesourcery.com>
    
    	* sysdeps/mips/sys/fpregdef.h: Update for new ABIs.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 6f5e4f7..4e6ce79 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,7 @@
+2009-04-15  Maciej W. Rozycki  <macro@codesourcery.com>
+
+	* sysdeps/mips/sys/fpregdef.h: Update for new ABIs.
+
 2009-04-09  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Add missing protocol
diff --git a/sysdeps/mips/sys/fpregdef.h b/sysdeps/mips/sys/fpregdef.h
index 3781152..d6c72bb 100644
--- a/sysdeps/mips/sys/fpregdef.h
+++ b/sysdeps/mips/sys/fpregdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94,95,96,97,98,2009 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
@@ -19,19 +19,52 @@
 #ifndef _SYS_FPREGDEF_H
 #define _SYS_FPREGDEF_H
 
-/*
- * These definitions only cover the R3000-ish 16/32 register model.
- * But we're trying to be R3000 friendly anyway ...
- */
-#define fv0	$f0      /* return value */
-#define fv0f	$f1
+#include <sgidefs.h>
+
+/* Commonalities first, individualities next...  */
+
+#define fv0	$f0	/* return value */
 #define fv1	$f2
+
+#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32
+#define fs0	$f20	/* callee saved */
+#define fs1	$f22
+#define fs2	$f24
+#define fs3	$f26
+#define fs4	$f28
+#define fs5	$f30
+#endif /* _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 */
+
+#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32
+#define fa0	$f12	/* argument registers */
+#define fa1	$f13
+#define fa2	$f14
+#define fa3	$f15
+#define fa4	$f16
+#define fa5	$f17
+#define fa6	$f18
+#define fa7	$f19
+
+#define ft0	$f4	/* caller saved */
+#define ft1	$f5
+#define ft2	$f6
+#define ft3	$f7
+#define ft4	$f8
+#define ft5	$f9
+#define ft6	$f10
+#define ft7	$f11
+#endif /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */
+
+#if _MIPS_SIM == _ABIO32
+#define fv0f	$f1	/* return value, high part */
 #define fv1f	$f3
-#define fa0	$f12     /* argument registers */
+
+#define fa0	$f12	/* argument registers */
 #define fa0f	$f13
 #define fa1	$f14
 #define fa1f	$f15
-#define ft0	$f4      /* caller saved */
+
+#define ft0	$f4	/* caller saved */
 #define ft0f	$f5
 #define ft1	$f6
 #define ft1f	$f7
@@ -43,19 +76,44 @@
 #define ft4f	$f17
 #define ft5	$f18
 #define ft5f	$f19
-#define fs0	$f20     /* callee saved */
-#define fs0f	$f21
-#define fs1	$f22
+
+#define fs0f	$f21	/* callee saved, high part */
 #define fs1f	$f23
-#define fs2	$f24
 #define fs2f	$f25
-#define fs3	$f26
 #define fs3f	$f27
-#define fs4	$f28
 #define fs4f	$f29
-#define fs5	$f30
 #define fs5f	$f31
+#endif /* _MIPS_SIM == _ABIO32 */
+
+#if _MIPS_SIM == _ABI64
+#define ft8	$f20	/* caller saved */
+#define ft9	$f21
+#define ft10	$f22
+#define ft11	$f23
+#define ft12	$f1
+#define ft13	$f3
+
+#define fs0	$f24	/* callee saved */
+#define fs1	$f25
+#define fs2	$f26
+#define fs3	$f27
+#define fs4	$f28
+#define fs5	$f29
+#define fs6	$f30
+#define fs7	$f31
+#endif /* _MIPS_SIM == _ABI64 */
+
+#if _MIPS_SIM == _ABIN32
+#define ft8	$f21	/* caller saved */
+#define ft9	$f23
+#define ft10	$f25
+#define ft11	$f27
+#define ft12	$f29
+#define ft13	$f31
+#define ft14	$f1
+#define ft15	$f3
+#endif /* _MIPS_SIM == _ABIN32 */
 
-#define fcr31	$31      /* FPU status register */
+#define fcr31	$31	/* FPU status register */
 
 #endif /* sys/fpregdef.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=70fdbfd9568cadea8ef14f31c5e4a5aaf7e8e18e

commit 70fdbfd9568cadea8ef14f31c5e4a5aaf7e8e18e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Apr 9 22:14:47 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Add missing protocol
    	numbers.
    	* sysdeps/unix/sysv/linux/mips/sys/eventfd.h (EFD_SEMAPHORE):
    	Define.
    	* sysdeps/unix/sysv/linux/mips/kernel-features.h: Add entries for
    	preadv and pwritev.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 6f4b038..6f5e4f7 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,12 @@
+2009-04-09  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Add missing protocol
+	numbers.
+	* sysdeps/unix/sysv/linux/mips/sys/eventfd.h (EFD_SEMAPHORE):
+	Define.
+	* sysdeps/unix/sysv/linux/mips/kernel-features.h: Add entries for
+	preadv and pwritev.
+
 2009-03-18  Maciej W. Rozycki  <macro@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index dad2c2d..60db515 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -95,15 +95,20 @@ enum __socket_type
 #define	PF_ASH		18	/* Ash.  */
 #define	PF_ECONET	19	/* Acorn Econet.  */
 #define	PF_ATMSVC	20	/* ATM SVCs.  */
+#define PF_RDS		21	/* RDS sockets.  */
 #define	PF_SNA		22	/* Linux SNA Project */
 #define	PF_IRDA		23	/* IRDA sockets.  */
 #define	PF_PPPOX	24	/* PPPoX sockets.  */
 #define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define PF_LLC		26	/* Linux LLC.  */
+#define PF_CAN		29	/* Controller Area Network.  */
+#define PF_TIPC		30	/* TIPC sockets.  */
 #define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
 #define	PF_IUCV		32	/* IUCV sockets.  */
 #define PF_RXRPC	33	/* RxRPC sockets.  */
 #define PF_ISDN		34	/* mISDN sockets.  */
-#define	PF_MAX		35	/* For now..  */
+#define PF_PHONET	35	/* Phonet sockets.  */
+#define	PF_MAX		36	/* For now..  */
 
 /* Address families.  */
 #define	AF_UNSPEC	PF_UNSPEC
@@ -130,14 +135,19 @@ enum __socket_type
 #define	AF_ASH		PF_ASH
 #define	AF_ECONET	PF_ECONET
 #define	AF_ATMSVC	PF_ATMSVC
+#define AF_RDS		PF_RDS
 #define	AF_SNA		PF_SNA
 #define	AF_IRDA		PF_IRDA
 #define	AF_PPPOX	PF_PPPOX
 #define	AF_WANPIPE	PF_WANPIPE
+#define AF_LLC		PF_LLC
+#define AF_CAN		PF_CAN
+#define AF_TIPC		PF_TIPC
 #define	AF_BLUETOOTH	PF_BLUETOOTH
 #define	AF_IUCV		PF_IUCV
 #define AF_RXRPC	PF_RXRPC
 #define AF_ISDN		PF_ISDN
+#define AF_PHONET	PF_PHONET
 #define	AF_MAX		PF_MAX
 
 /* Socket level values.  Others are defined in the appropriate headers.
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index f479b60..1cdf19e 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -31,4 +31,10 @@
 # define __ASSUME_FCNTL64		1
 #endif
 
+/* Support for preadv and pwritev was added in 2.6.30.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061e
+# define __ASSUME_PREADV	1
+# define __ASSUME_PWRITEV	1
+#endif
+
 #include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/mips/sys/eventfd.h b/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
index 8b55ba6..b30d09a 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
@@ -28,6 +28,8 @@ typedef uint64_t eventfd_t;
 /* Flags for signalfd.  */
 enum
   {
+    EFD_SEMAPHORE = 1,
+#define EFD_SEMAPHORE EFD_SEMAPHORE
     EFD_CLOEXEC = 02000000,
 #define EFD_CLOEXEC EFD_CLOEXEC
     EFD_NONBLOCK = 0200

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d69fd0cbd2ec67b2dc4ba1e23bac6b9ed6b947c5

commit d69fd0cbd2ec67b2dc4ba1e23bac6b9ed6b947c5
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Mar 18 14:38:51 2009 +0000

    2009-03-18  Maciej W. Rozycki  <macro@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
    	Use the Elf32_Ehdr type to check for EF_MIPS_ABI2 in the flags.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index d4a38dc..6f4b038 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-03-18  Maciej W. Rozycki  <macro@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
+	Use the Elf32_Ehdr type to check for EF_MIPS_ABI2 in the flags.
+
 2009-03-18  Zhang Le  <r0bertz@gentoo.org>
 
 	[BZ #7074]
diff --git a/sysdeps/unix/sysv/linux/mips/readelflib.c b/sysdeps/unix/sysv/linux/mips/readelflib.c
index 99fbaac..547362f 100644
--- a/sysdeps/unix/sysv/linux/mips/readelflib.c
+++ b/sysdeps/unix/sysv/linux/mips/readelflib.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001, 2002, 2003, 2005, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Alexandre Oliva <aoliva@redhat.com>
    Based on work ../x86_64/readelflib.c,
@@ -39,11 +40,13 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 
   if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
     {
+      Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
+
       ret = process_elf32_file (file_name, lib, flag, osversion, soname,
 				file_contents, file_length);
 
       /* n32 libraries are always libc.so.6+.  */
-      if (!ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0)
+      if (!ret && (elf32_header->e_flags & EF_MIPS_ABI2) != 0)
 	*flag = FLAG_MIPS64_LIBN32|FLAG_ELF_LIBC6;
     }
   else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0262d0c47c55109b0ea10239eedc2695f57ad40e

commit 0262d0c47c55109b0ea10239eedc2695f57ad40e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Mar 18 14:31:30 2009 +0000

    2009-03-18  Zhang Le  <r0bertz@gentoo.org>
    
    	[BZ #7074]
    	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
    	Fix the condition used to annotate n32 objects.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index db31315..d4a38dc 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2009-03-18  Zhang Le  <r0bertz@gentoo.org>
+
+	[BZ #7074]
+	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
+	Fix the condition used to annotate n32 objects.
+
 2009-03-17  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/getsysstats.c (GET_NPROCS_PARSER):
diff --git a/sysdeps/unix/sysv/linux/mips/readelflib.c b/sysdeps/unix/sysv/linux/mips/readelflib.c
index baa92fe..99fbaac 100644
--- a/sysdeps/unix/sysv/linux/mips/readelflib.c
+++ b/sysdeps/unix/sysv/linux/mips/readelflib.c
@@ -43,7 +43,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 				file_contents, file_length);
 
       /* n32 libraries are always libc.so.6+.  */
-      if (ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0)
+      if (!ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0)
 	*flag = FLAG_MIPS64_LIBN32|FLAG_ELF_LIBC6;
     }
   else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=edb1d6ef2fbfbc24fcf921d820b4d6c083a66dcb

commit edb1d6ef2fbfbc24fcf921d820b4d6c083a66dcb
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Mar 17 17:41:36 2009 +0000

    	* sysdeps/unix/sysv/linux/m68k/getsysstats.c (GET_NPROCS_PARSER):
    	Change parameters and use next_line.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index 32d01cf..b630578 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2009-03-17  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/getsysstats.c (GET_NPROCS_PARSER):
+	Change parameters and use next_line.
+
 2009-03-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/m68k/bits/link.h: Uglify function parameter names.
diff --git a/sysdeps/unix/sysv/linux/m68k/getsysstats.c b/sysdeps/unix/sysv/linux/m68k/getsysstats.c
index 23207e9..5113720 100644
--- a/sysdeps/unix/sysv/linux/m68k/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/m68k/getsysstats.c
@@ -1,5 +1,5 @@
 /* Determine various system internal values, Linux/m68k version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Schwab <schwab@suse.de>
 
@@ -20,7 +20,7 @@
 
 
 /* We need to define a special parser for /proc/cpuinfo.  */
-#define GET_NPROCS_PARSER(FP, BUFFER, RESULT)				  \
+#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT)	  \
   do									  \
     {									  \
       (RESULT) = 0;							  \
@@ -28,8 +28,9 @@
 	 "CPU:".  We don't have to fear extremely long lines since	  \
 	 the kernel will not generate them.  8192 bytes are really	  \
 	 enough.  */							  \
-      while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL)	  \
-	if (strncmp (BUFFER, "CPU:", 4) == 0)	      	     		  \
+      char *l;								  \
+      while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL)  \
+	if (strncmp (l, "CPU:", 4) == 0)	      	     		  \
 	  ++(RESULT);							  \
     }									  \
   while (0)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4c8c18106e3f50e86804469fdbb4eb2f6f9fdac7

commit 4c8c18106e3f50e86804469fdbb4eb2f6f9fdac7
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Mar 17 15:52:15 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/getsysstats.c (GET_NPROCS_PARSER):
    	Change parameters and use next_line.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index ee9c835..db31315 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,10 @@
 2009-03-17  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/mips/getsysstats.c (GET_NPROCS_PARSER):
+	Change parameters and use next_line.
+
+2009-03-17  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Include errno.h.
 	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
 	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
diff --git a/sysdeps/unix/sysv/linux/mips/getsysstats.c b/sysdeps/unix/sysv/linux/mips/getsysstats.c
index 9b521ac..8053033 100644
--- a/sysdeps/unix/sysv/linux/mips/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/mips/getsysstats.c
@@ -1,5 +1,5 @@
 /* Determine various system internal values, Linux/MIPS version.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2009 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
@@ -19,7 +19,7 @@
 
 
 /* We need to define a special parser for /proc/cpuinfo.  */
-#define GET_NPROCS_PARSER(FP, BUFFER, RESULT)				  \
+#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT)	  \
   do									  \
     {									  \
       (RESULT) = 0;							  \
@@ -27,8 +27,9 @@
 	 "cpu model".  We don't have to fear extremely long lines since	  \
 	 the kernel will not generate them.  8192 bytes are really	  \
 	 enough.  */							  \
-      while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL)	  \
-	if (strncmp (BUFFER, "cpu model", 9) == 0)			  \
+      char *l;								  \
+      while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL)  \
+	if (strncmp (l, "cpu model", 9) == 0)				  \
 	  ++(RESULT);							  \
     }									  \
   while (0)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=340f79762887912b27b6cd56de5c6fa1f2fbfcef

commit 340f79762887912b27b6cd56de5c6fa1f2fbfcef
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Mar 17 15:49:10 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Include errno.h.
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 96d2f46..ee9c835 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2009-03-17  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Include errno.h.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
+
 2009-03-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/bits/link.h: Uglify function parameter names.
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index c3d59dd..753f98a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2005,
+   2009 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
@@ -24,6 +25,11 @@
 
 #include <tls.h>
 
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index b2bbbb0..1513306 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006
+/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -25,6 +25,11 @@
 
 #include <tls.h>
 
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index 8862607..af12bbd 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006
+/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -25,6 +25,11 @@
 
 #include <tls.h>
 
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=26ed7fb1ffd871b37624d7247961b022d5f148bc

commit 26ed7fb1ffd871b37624d7247961b022d5f148bc
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Mar 17 12:32:06 2009 +0000

    2009-03-16  Khem Raj  <raj.khem@gmail.com>
    
    	* sysdeps/unix/sysv/linux/arm/sysdep.h: Include errno.h.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index a2915fd..d554bfb 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2009-03-16  Khem Raj  <raj.khem@gmail.com>
+
+	* sysdeps/unix/sysv/linux/arm/sysdep.h: Include errno.h.
+
 2009-03-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/bits/link.h: Uglify function parameter names.
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 1df63f6..3d7fafc 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -30,6 +30,11 @@
 
 #include <tls.h>
 
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bd855f39f173c9972b6e1892c03378738066ebd4

commit bd855f39f173c9972b6e1892c03378738066ebd4
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sun Mar 15 18:42:52 2009 +0000

    	* sysdeps/m68k/bits/link.h: Uglify function parameter names.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index d199e36..32d01cf 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,7 @@
+2009-03-15  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/m68k/bits/link.h: Uglify function parameter names.
+
 2009-03-04  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Declare
diff --git a/sysdeps/m68k/bits/link.h b/sysdeps/m68k/bits/link.h
index 9d0a945..ce4b5e0 100644
--- a/sysdeps/m68k/bits/link.h
+++ b/sysdeps/m68k/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2009 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
@@ -53,6 +53,6 @@ extern unsigned int la_m68k_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
 					 uintptr_t *__defcook,
 					 const La_m68k_regs *__inregs,
 					 La_m68k_retval *__outregs,
-					 const char *symname);
+					 const char *__symname);
 
 __END_DECLS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ad32d65a9f664c7b21c91a71b653a311effa06f2

commit ad32d65a9f664c7b21c91a71b653a311effa06f2
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sun Mar 15 16:54:26 2009 +0000

    	* sysdeps/mips/bits/link.h: Uglify function parameter names.
    	* sysdeps/unix/sysv/linux/mips/sys/cachectl.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/sys/eventfd.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/sys/sysmips.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index fa78e91..96d2f46 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,11 @@
+2009-03-15  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/bits/link.h: Uglify function parameter names.
+	* sysdeps/unix/sysv/linux/mips/sys/cachectl.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/eventfd.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/sysmips.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise.
+
 2009-03-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Declare
diff --git a/sysdeps/mips/bits/link.h b/sysdeps/mips/bits/link.h
index 3d77a4c..85e69cd 100644
--- a/sysdeps/mips/bits/link.h
+++ b/sysdeps/mips/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2009 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
@@ -79,7 +79,7 @@ extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __nd
 					     uintptr_t *__defcook,
 					     const La_mips_32_regs *__inregs,
 					     La_mips_32_retval *__outregs,
-					     const char *symname);
+					     const char *__symname);
 
 #elif _MIPS_SIM == _ABIN32
 
@@ -95,7 +95,7 @@ extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __nd
 					     uintptr_t *__defcook,
 					     const La_mips_64_regs *__inregs,
 					     La_mips_64_retval *__outregs,
-					     const char *symname);
+					     const char *__symname);
 
 #else
 
@@ -111,7 +111,7 @@ extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __nd
 					     uintptr_t *__defcook,
 					     const La_mips_64_regs *__inregs,
 					     La_mips_64_retval *__outregs,
-					     const char *symname);
+					     const char *__symname);
 
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
index a93e1fb..3d9f914 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000, 2009 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
@@ -29,13 +29,13 @@
 __BEGIN_DECLS
 
 #ifdef __USE_MISC
-extern int cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+extern int cachectl (void *__addr, __const int __nbytes, __const int __op) __THROW;
 #endif
-extern int __cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+extern int __cachectl (void *__addr, __const int __nbytes, __const int __op) __THROW;
 #ifdef __USE_MISC
-extern int cacheflush (void *addr, __const int nbytes, __const int op) __THROW;
+extern int cacheflush (void *__addr, __const int __nbytes, __const int __op) __THROW;
 #endif
-extern int _flush_cache (char *addr, __const int nbytes, __const int op) __THROW;
+extern int _flush_cache (char *__addr, __const int __nbytes, __const int __op) __THROW;
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/eventfd.h b/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
index fa34c8c..8b55ba6 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009 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
@@ -45,7 +45,7 @@ extern int eventfd (int __count, int __flags) __THROW;
 extern int eventfd_read (int __fd, eventfd_t *__value);
 
 /* Increment event counter.  */
-extern int eventfd_write (int __fd, eventfd_t value);
+extern int eventfd_write (int __fd, eventfd_t __value);
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
index 0677caf..aefc52e 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 2000, 2001, 2009 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
@@ -36,7 +36,7 @@
 
 __BEGIN_DECLS
 
-extern int sysmips (__const int cmd, ...) __THROW;
+extern int sysmips (__const int __cmd, ...) __THROW;
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/tas.h b/sysdeps/unix/sysv/linux/mips/sys/tas.h
index b370ee4..c5c8055 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/tas.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/tas.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2007, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
 
@@ -25,7 +26,7 @@
 
 __BEGIN_DECLS
 
-extern int _test_and_set (int *p, int v) __THROW;
+extern int _test_and_set (int *__p, int __v) __THROW;
 
 #ifdef __USE_EXTERN_INLINES
 
@@ -34,9 +35,9 @@ extern int _test_and_set (int *p, int v) __THROW;
 # endif
 
 _EXTERN_INLINE int
-__NTH (_test_and_set (int *p, int v))
+__NTH (_test_and_set (int *__p, int __v))
 {
-  int r, t;
+  int __r, __t;
 
   __asm__ __volatile__
     ("/* Inline test and set */\n"
@@ -55,11 +56,11 @@ __NTH (_test_and_set (int *p, int v))
      ".set	pop\n\t"
      "2:\n\t"
      "/* End test and set */"
-     : "=&r" (r), "=&r" (t), "=m" (*p)
-     : "m" (*p), "r" (v)
+     : "=&r" (__r), "=&r" (__t), "=m" (*__p)
+     : "m" (*__p), "r" (__v)
      : "memory");
 
-  return r;
+  return __r;
 }
 
 #endif /* __USE_EXTERN_INLINES */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=440eb79d6ce9ac8777bbd8307691cb90897444a5

commit 440eb79d6ce9ac8777bbd8307691cb90897444a5
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sun Mar 15 16:53:46 2009 +0000

    	* sysdeps/arm/bits/link.h: Uglify function parameter names.
    	* sysdeps/unix/sysv/linux/arm/sys/io.h: Likewise.
    	* sysdeps/arm/eabi/bits/setjmp.h: Uglify attribute name.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 105ef7d..a2915fd 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2009-03-15  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/bits/link.h: Uglify function parameter names.
+	* sysdeps/unix/sysv/linux/arm/sys/io.h: Likewise.
+	* sysdeps/arm/eabi/bits/setjmp.h: Uglify attribute name.
+
 2009-03-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Declare
diff --git a/sysdeps/arm/bits/link.h b/sysdeps/arm/bits/link.h
index 8dbd2c7..44e4eda 100644
--- a/sysdeps/arm/bits/link.h
+++ b/sysdeps/arm/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2009 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
@@ -61,6 +61,6 @@ extern unsigned int la_arm_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
 					uintptr_t *__defcook,
 					const La_arm_regs *__inregs,
 					La_arm_retval *__outregs,
-					const char *symname);
+					const char *__symname);
 
 __END_DECLS
diff --git a/sysdeps/arm/eabi/bits/setjmp.h b/sysdeps/arm/eabi/bits/setjmp.h
index dd7679d..16c560d 100644
--- a/sysdeps/arm/eabi/bits/setjmp.h
+++ b/sysdeps/arm/eabi/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2006, 2009 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
@@ -32,7 +32,7 @@
    recommends that the buffer contain 64 words.  The first 28 words
    are occupied by v1-v6, sl, fp, sp, pc, d8-d15, and fpscr.  (Note
    that d8-15 require 17 words, due to the use of fstmx.)  */
-typedef int __jmp_buf[64] __attribute__((aligned (8)));
+typedef int __jmp_buf[64] __attribute__((__aligned__ (8)));
 #endif
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/arm/sys/io.h b/sysdeps/unix/sysv/linux/arm/sys/io.h
index 6863990..0712a47 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/io.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/io.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1998, 1999, 2009 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
@@ -35,13 +35,13 @@ extern int ioperm (unsigned long int __from, unsigned long int __num,
 extern int iopl (int __level) __THROW;
 
 /* The functions that actually perform reads and writes.  */
-extern unsigned char inb (unsigned long int port) __THROW;
-extern unsigned short int inw (unsigned long int port) __THROW;
-extern unsigned long int inl (unsigned long int port) __THROW;
+extern unsigned char inb (unsigned long int __port) __THROW;
+extern unsigned short int inw (unsigned long int __port) __THROW;
+extern unsigned long int inl (unsigned long int __port) __THROW;
 
-extern void outb (unsigned char value, unsigned long int port) __THROW;
-extern void outw (unsigned short value, unsigned long int port) __THROW;
-extern void outl (unsigned long value, unsigned long int port) __THROW;
+extern void outb (unsigned char __value, unsigned long int __port) __THROW;
+extern void outw (unsigned short __value, unsigned long int __port) __THROW;
+extern void outl (unsigned long __value, unsigned long int __port) __THROW;
 
 __END_DECLS
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=73ea734a9f1aaebc843353a20ddd51c944204633

commit 73ea734a9f1aaebc843353a20ddd51c944204633
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Mar 4 22:49:21 2009 +0000

    	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Declare
    	fallocate{,64}.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index f6af26a..d199e36 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2009-03-04  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Declare
+	fallocate{,64}.
+
 2009-02-26  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/bits/stat.h: Protect UTIME_NOW and
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
index 203d5a1..1e396dc 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -234,6 +234,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=93311332ba2a6bdb77326af3a83962172a207b31

commit 93311332ba2a6bdb77326af3a83962172a207b31
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Mar 3 23:19:19 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Declare
    	fallocate{,64}.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index d3d575a..fa78e91 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-03-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Declare
+	fallocate{,64}.
+
 2009-02-26  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Protect UTIME_NOW and
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index e8107d7..ef84e96 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -248,6 +248,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ae99295b0505317d1e3e7f11595ad2fab268f350

commit ae99295b0505317d1e3e7f11595ad2fab268f350
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Mar 3 23:18:56 2009 +0000

    	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Declare
    	fallocate{,64}.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 864fd57..105ef7d 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-03-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Declare
+	fallocate{,64}.
+
 2009-02-13  Khem Raj  <raj.khem@gmail.com>
 
 	* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c 
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index 10d11f2..277c97a 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9dcb49b6258c355c0d3a3951191f3f7973d64858

commit 9dcb49b6258c355c0d3a3951191f3f7973d64858
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Feb 27 13:16:51 2009 +0000

    	* sysdeps/unix/sysv/linux/m68k/bits/stat.h: Protect UTIME_NOW and
    	UTIME_OMIT only with __USE_ATFILE.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index c399a48..f6af26a 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,8 @@
+2009-02-26  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/bits/stat.h: Protect UTIME_NOW and
+	UTIME_OMIT only with __USE_ATFILE.
+
 2008-08-10  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/m68k/bits/byteswap.h: Allow inclusion from <endian.h>.
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/sysdeps/unix/sysv/linux/m68k/bits/stat.h
index 6b69240..8d18d6d 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -163,8 +163,7 @@ struct stat64
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
 
-#if defined __USE_ATFILE || defined __USE_GNU
-/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+#ifdef __USE_ATFILE
 # define UTIME_NOW	((1l << 30) - 1l)
 # define UTIME_OMIT	((1l << 30) - 2l)
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2e3804efbfcf4a7279d543181c0a63ff73f5f3c7

commit 2e3804efbfcf4a7279d543181c0a63ff73f5f3c7
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Feb 26 23:25:24 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Protect UTIME_NOW and
    	UTIME_OMIT only with __USE_ATFILE.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index a52748a..d3d575a 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-02-26  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Protect UTIME_NOW and
+	UTIME_OMIT only with __USE_ATFILE.
+
 2009-02-13  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #7040]
diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
index 4e0e30f..af04251 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -1,5 +1,5 @@
 /* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004,
-	2007 Free Software Foundation, Inc.
+	2007, 2009 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
@@ -254,8 +254,7 @@ struct stat64
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
 
-#if defined __USE_ATFILE || defined __USE_GNU
-/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+#ifdef __USE_ATFILE
 # define UTIME_NOW	((1l << 30) - 1l)
 # define UTIME_OMIT	((1l << 30) - 2l)
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6f5d2fa8aa2f0d3d23780a769fe85f4f4fa73c2e

commit 6f5d2fa8aa2f0d3d23780a769fe85f4f4fa73c2e
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Feb 26 21:36:13 2009 +0000

    2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h:
    	Adjust comment. Sort macros alphabetically. Remove old
    	lock comments.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 538837c..b673000 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,5 +1,11 @@
 2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h:
+	Adjust comment. Sort macros alphabetically. Remove old
+	lock comments.
+
+2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c:
 	Update from nptl/sysdeps/pthread/unwind-forcedunwind.c
 	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c:
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
index 62fc80c..d6eb975 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2007, 2009 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
@@ -21,43 +21,30 @@
 
 /* Linuxthread type sizes (bytes):
    sizeof(pthread_attr_t) = 0x24 (36)
-   sizeof(pthread_mutex_t) = 0x30 (48)
-   sizeof(pthread_mutexattr_t) = 0x4 (4)
+   sizeof(pthread_barrier_t) = 0x30 (48)
+   sizeof(pthread_barrierattr_t) = 0x4 (4) 
    sizeof(pthread_cond_t) = 0x30 (48)
-	= Expanded to 64 bytes in NPTL. 
-   sizeof(pthread_cond_compat_t) = 0xc (12)
-	= Did not exist in Linuxthreads.
    sizeof(pthread_condattr_t) = 0x4 (4)
+   sizeof(pthread_mutex_t) = 0x30 (48)
+   sizeof(pthread_mutexattr_t) = 0x4 (4)
    sizeof(pthread_rwlock_t) = 0x40 (64)
    sizeof(pthread_rwlockattr_t) = 0x8 (8)
-   sizeof(pthread_barrier_t) = 0x30 (48)
-   sizeof(pthread_barrierattr_t) = 0x4 (4) */
+   sizeof(pthread_spinlock_t) = 0x10 (16) */
 
 #define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_MUTEX_T 48 
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_BARRIER_T 48
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
 #define __SIZEOF_PTHREAD_COND_T 64
-#define __SIZEOF_PTHREAD_COND_COMPAT_T 12
 #define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_MUTEX_T 48 
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
 #define __SIZEOF_PTHREAD_RWLOCK_T 64
 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 48
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
 
 /* Thread identifiers.  The structure of the attribute type is not
    exposed on purpose.  */
 typedef unsigned long int pthread_t;
 
-/* Our old basic lock type, listed here for posterity.
-   We needed self-aligning locks for linuxthreads LDCW 
-   implementation. For NPTL we use LWS Compare and 
-   Exchange to implement primitives. */
-#if 0
-typedef volatile struct {
-	int lock[4];
-} __attribute__ ((aligned(16))) __atomic_lock_t;
-#endif
-
 typedef union
 {
   char __size[__SIZEOF_PTHREAD_ATTR_T];

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8ff04e6454adeb1887332341f3d6868db45d1dda

commit 8ff04e6454adeb1887332341f3d6868db45d1dda
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Feb 26 21:29:22 2009 +0000

    2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c:
    	Update from nptl/sysdeps/pthread/unwind-forcedunwind.c
    	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c:
    	Update from nptl/sysdeps/pthread/unwind-resume.c

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index e99d768..538837c 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,5 +1,12 @@
 2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c:
+	Update from nptl/sysdeps/pthread/unwind-forcedunwind.c
+	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c:
+	Update from nptl/sysdeps/pthread/unwind-resume.c
+
+2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define 
 	FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME,
 	and FUTEX_BITSET_MATCH_ANY.
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
index cea5d3b..e0eef90 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
 
    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
@@ -20,8 +21,7 @@
 #include <stdio.h>
 #include <unwind.h>
 #include <pthreadP.h>
-
-#define LIBGCC_S_SO "libgcc_s.so.4"
+#include <sysdep.h>
 
 static void *libgcc_s_handle;
 static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
@@ -32,15 +32,16 @@ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
   (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
 static _Unwind_Word (*libgcc_s_getcfa) (struct _Unwind_Context *);
 
-#ifndef LIBGCC_S_SO
-#define LIBGCC_S_SO "libgcc_s.so.1"
-#endif
+#define LIBGCC_S_SO "libgcc_s.so.4"
 
 void
 __attribute_noinline__
 pthread_cancel_init (void)
 {
-  void *resume, *personality, *forcedunwind, *getcfa;
+  void *resume;
+  void *personality;
+  void *forcedunwind;
+  void *getcfa;
   void *handle;
 
   if (__builtin_expect (libgcc_s_handle != NULL, 1))
@@ -62,13 +63,17 @@ pthread_cancel_init (void)
       || ARCH_CANCEL_INIT (handle)
 #endif
       )
-    __libc_fatal ("libgcc_s.so must be installed for pthread_cancel to work\n");
+    __libc_fatal (LIBGCC_S_SO " must be installed for pthread_cancel to work\n");
 
+  PTR_MANGLE (resume);
   libgcc_s_resume = resume;
+  PTR_MANGLE (personality);
   libgcc_s_personality = personality;
+  PTR_MANGLE (forcedunwind);
   libgcc_s_forcedunwind = forcedunwind;
+  PTR_MANGLE (getcfa);
   libgcc_s_getcfa = getcfa;
-  /* Make sure libgcc_s_getcfa is written last.  Otherwise,
+  /* Make sure libgcc_s_handle is written last.  Otherwise,
      pthread_cancel_init might return early even when the pointer the
      caller is interested in is not initialized yet.  */
   atomic_write_barrier ();
@@ -90,10 +95,12 @@ __unwind_freeres (void)
 void
 _Unwind_Resume (struct _Unwind_Exception *exc)
 {
-  if (__builtin_expect (libgcc_s_resume == NULL, 0))
+  if (__builtin_expect (libgcc_s_handle == NULL, 0))
     pthread_cancel_init ();
 
-  libgcc_s_resume (exc);
+  void (*resume) (struct _Unwind_Exception *exc) = libgcc_s_resume;
+  PTR_DEMANGLE (resume);
+  resume (exc);
 }
 
 _Unwind_Reason_Code
@@ -102,28 +109,37 @@ __gcc_personality_v0 (int version, _Unwind_Action actions,
                       struct _Unwind_Exception *ue_header,
                       struct _Unwind_Context *context)
 {
-  if (__builtin_expect (libgcc_s_personality == NULL, 0))
+  if (__builtin_expect (libgcc_s_handle == NULL, 0))
     pthread_cancel_init ();
 
-  return libgcc_s_personality (version, actions, exception_class,
-			       ue_header, context);
+  _Unwind_Reason_Code (*personality)
+    (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
+     struct _Unwind_Context *) = libgcc_s_personality;
+  PTR_DEMANGLE (personality);
+  return personality (version, actions, exception_class, ue_header, context);
 }
 
 _Unwind_Reason_Code
 _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
 		      void *stop_argument)
 {
-  if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0))
+  if (__builtin_expect (libgcc_s_handle == NULL, 0))
     pthread_cancel_init ();
 
-  return libgcc_s_forcedunwind (exc, stop, stop_argument);
+  _Unwind_Reason_Code (*forcedunwind)
+    (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *)
+    = libgcc_s_forcedunwind;
+  PTR_DEMANGLE (forcedunwind);
+  return forcedunwind (exc, stop, stop_argument);
 }
 
 _Unwind_Word
 _Unwind_GetCFA (struct _Unwind_Context *context)
 {
-  if (__builtin_expect (libgcc_s_getcfa == NULL, 0))
+  if (__builtin_expect (libgcc_s_handle == NULL, 0))
     pthread_cancel_init ();
 
-  return libgcc_s_getcfa (context);
+  _Unwind_Word (*getcfa) (struct _Unwind_Context *) = libgcc_s_getcfa;
+  PTR_DEMANGLE (getcfa);
+  return getcfa (context);
 }
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c
index a7485e9..a31ba1a 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/unwind-resume.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
 
    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
@@ -27,11 +28,6 @@ static _Unwind_Reason_Code (*libgcc_s_personality)
   (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
    struct _Unwind_Context *);
 
-#ifndef LIBGCC_S_SO
-#error LIBGCC_S_SO
-#define LIBGCC_S_SO "libgcc_s.so.1"
-#endif
-
 static void
 init (void)
 {
@@ -43,7 +39,7 @@ init (void)
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
       || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
-    __libc_fatal ("libgcc_s.so must be installed for pthread_cancel to work\n");
+    __libc_fatal (LIBGCC_S_SO " must be installed for pthread_cancel to work\n");
 
   libgcc_s_resume = resume;
   libgcc_s_personality = personality;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cdc618aab40e9942181a8496d2bc29509cd32950

commit cdc618aab40e9942181a8496d2bc29509cd32950
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Feb 26 19:46:02 2009 +0000

    2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define
    	FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME,
    	and FUTEX_BITSET_MATCH_ANY.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 350b11a..e99d768 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2009-02-25  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define 
+	FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME,
+	and FUTEX_BITSET_MATCH_ANY.
+
 2009-02-22  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/Versions: Add missing bracket.
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index 6998a91..10be11a 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -41,7 +41,12 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
+#define FUTEX_CLOCK_REALTIME	256
+
+#define FUTEX_BITSET_MATCH_ANY	0xffffffff
 
 /* Bits used in robust mutex implementation.  */
 #define FUTEX_WAITERS		0x80000000

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d4bf22dbef15246f2ed25e13c0a030f0210189f3

commit d4bf22dbef15246f2ed25e13c0a030f0210189f3
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Sun Feb 22 17:15:19 2009 +0000

    2009-02-22  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/Versions: Add missing bracket.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index e575b36..350b11a 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,5 +1,9 @@
 2009-02-22  Carlos O'Donell  <carlos@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/hppa/Versions: Add missing bracket.
+
+2009-02-22  Carlos O'Donell  <carlos@codesourcery.com>
+
 	* sysdeps/hppa/dl-machine.h: Use _dl_runtime_profile.
 
 2009-02-13  Khem Raj  <raj.khem@gmail.com>
diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions
index 26eed69..234c0ba 100644
--- a/sysdeps/unix/sysv/linux/hppa/Versions
+++ b/sysdeps/unix/sysv/linux/hppa/Versions
@@ -19,6 +19,7 @@ libc {
   GLIBC_2.4 {
     #errlist-compat	256
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+  }
 }
 librt {
   GLIBC_2.3 {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=370b2f2c97815286f8a200880cbf8d0e14f6e6dd

commit 370b2f2c97815286f8a200880cbf8d0e14f6e6dd
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Sun Feb 22 17:02:14 2009 +0000

    2009-02-22  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/hppa/dl-machine.h: Use _dl_runtime_profile.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index a817e5f..e575b36 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,7 @@
+2009-02-22  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/hppa/dl-machine.h: Use _dl_runtime_profile.
+
 2009-02-13  Khem Raj  <raj.khem@gmail.com>
 
 	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c 
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index 0854295..503bbca 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -233,7 +233,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
                       GL(dl_profile_map) = l;
                     }
 
-		  if((unsigned long) &_dl_runtime_resolve & 3)
+		  if((unsigned long) &_dl_runtime_profile & 3)
 		    {
                       got[-2] = (Elf32_Addr) ((struct fdesc *)
                                   ((unsigned long) &_dl_runtime_profile & ~3))->ip;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1090d6bf1039732d6441f894f6713e9ab58e01fa

commit 1090d6bf1039732d6441f894f6713e9ab58e01fa
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Feb 13 17:38:50 2009 +0000

    	[BZ #7040]
    	* sysdeps/unix/sysv/linux/mips/sys/inotify.h: Second parameter of
    	inotify_rm_watch should have type int.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index bccb10d..a52748a 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2009-02-13  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #7040]
+	* sysdeps/unix/sysv/linux/mips/sys/inotify.h: Second parameter of
+	inotify_rm_watch should have type int.
+
 2009-02-02  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/shm.h (SHM_EXEC): Define.
diff --git a/sysdeps/unix/sysv/linux/mips/sys/inotify.h b/sysdeps/unix/sysv/linux/mips/sys/inotify.h
index a811c7f..49f3947 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/inotify.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2008, 2009 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
@@ -98,7 +98,7 @@ extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
   __THROW;
 
 /* Remove the watch specified by WD from the inotify instance FD.  */
-extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+extern int inotify_rm_watch (int __fd, int __wd) __THROW;
 
 __END_DECLS
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f281f9cfdae6156aca98c23cecc796907e9ca913

commit f281f9cfdae6156aca98c23cecc796907e9ca913
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Feb 13 17:35:07 2009 +0000

    2009-02-13  Khem Raj  <raj.khem@gmail.com>
    
    	* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
    	(libgcc_s_handle): New variable.
    	(pthread_cancel_init): Depend in libgcc_s_handle for decision to
    	load DSO.  Assign last.
    	(__unwind_freeres): New function.
    
    	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c:
    	Likewise.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index fd520bc..864fd57 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,14 @@
+2009-02-13  Khem Raj  <raj.khem@gmail.com>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c 
+	(libgcc_s_handle): New variable.
+	(pthread_cancel_init): Depend in libgcc_s_handle for decision to
+	load DSO.  Assign last.
+	(__unwind_freeres): New function.
+
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: 
+	Likewise.
+
 2009-02-05  Paul Brook  <paul@codesourcery.com>
             Joseph Myers  <joseph@codesourcery.com>
 
@@ -36,7 +47,7 @@
 
 2009-01-27  Ryosei Takagi  <ryosei@sm.sony.co.jp>
 
-        * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
 	(lll_futex_wake_unlock, lll_futex_requeue): Return zero if success.
 
 2009-01-27  Daniel Jacobowitz  <dan@codesourcery.com>
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
index 71ab77c..ed321a3 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
@@ -22,6 +22,7 @@
 #include <unwind.h>
 #include <pthreadP.h>
 
+static void *libgcc_s_handle;
 static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
@@ -36,7 +37,7 @@ pthread_cancel_init (void)
   void *resume, *personality, *forcedunwind, *getcfa;
   void *handle;
 
-  if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
+  if (__builtin_expect (libgcc_s_handle != NULL, 1))
     {
       /* Force gcc to reload all values.  */
       asm volatile ("" ::: "memory");
@@ -60,11 +61,24 @@ pthread_cancel_init (void)
   libgcc_s_resume = resume;
   libgcc_s_personality = personality;
   libgcc_s_forcedunwind = forcedunwind;
+  libgcc_s_getcfa = getcfa;
   /* Make sure libgcc_s_getcfa is written last.  Otherwise,
      pthread_cancel_init might return early even when the pointer the
      caller is interested in is not initialized yet.  */
   atomic_write_barrier ();
-  libgcc_s_getcfa = getcfa;
+  libgcc_s_handle = handle;
+}
+
+void
+__libc_freeres_fn_section
+__unwind_freeres (void)
+{
+  void *handle = libgcc_s_handle;
+  if (handle != NULL)
+    {
+      libgcc_s_handle = NULL;
+      __libc_dlclose (handle);
+    }
 }
 
 /* It's vitally important that _Unwind_Resume not have a stack frame; the
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index b281963..e19facf 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
@@ -22,6 +22,7 @@
 #include <unwind.h>
 #include <pthreadP.h>
 
+static void *libgcc_s_handle;
 static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
@@ -40,7 +41,7 @@ pthread_cancel_init (void)
   void *handle;
   void *sjlj_register, *sjlj_unregister;
 
-  if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
+  if (__builtin_expect (libgcc_s_handle != NULL, 1))
     {
       /* Force gcc to reload all values.  */
       asm volatile ("" ::: "memory");
@@ -65,11 +66,24 @@ pthread_cancel_init (void)
   libgcc_s_forcedunwind = forcedunwind;
   libgcc_s_sjlj_register = sjlj_register;
   libgcc_s_sjlj_unregister = sjlj_unregister;
+  libgcc_s_getcfa = getcfa;
   /* Make sure libgcc_s_getcfa is written last.  Otherwise,
      pthread_cancel_init might return early even when the pointer the
      caller is interested in is not initialized yet.  */
   atomic_write_barrier ();
-  libgcc_s_getcfa = getcfa;
+  libgcc_s_handle = handle;
+}
+
+void
+__libc_freeres_fn_section
+__unwind_freeres (void)
+{
+  void *handle = libgcc_s_handle;
+  if (handle != NULL)
+    {
+      libgcc_s_handle = NULL;
+      __libc_dlclose (handle);
+    }
 }
 
 void

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b3862ba3c8905a9332bd4338068a26062e1e2722

commit b3862ba3c8905a9332bd4338068a26062e1e2722
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Feb 13 17:34:30 2009 +0000

    2009-02-13  Khem Raj  <raj.khem@gmail.com>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
    	(libgcc_s_handle): New variable.
    	(pthread_cancel_init): Depend in libgcc_s_handle for decision to
    	load DSO.  Assign last.
    	(__unwind_freeres): New function.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 0fac875..a817e5f 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,11 @@
+2009-02-13  Khem Raj  <raj.khem@gmail.com>
+
+	* sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c 
+	(libgcc_s_handle): New variable.
+	(pthread_cancel_init): Depend in libgcc_s_handle for decision to
+	load DSO.  Assign last.
+	(__unwind_freeres): New function.
+
 2009-02-09  Arthur Loiret  <aloiret@debian.org>
 
 	[BZ #9717]
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
index 8666bbb..cea5d3b 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 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
@@ -23,6 +23,7 @@
 
 #define LIBGCC_S_SO "libgcc_s.so.4"
 
+static void *libgcc_s_handle;
 static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
@@ -42,7 +43,7 @@ pthread_cancel_init (void)
   void *resume, *personality, *forcedunwind, *getcfa;
   void *handle;
 
-  if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
+  if (__builtin_expect (libgcc_s_handle != NULL, 1))
     {
       /* Force gcc to reload all values.  */
       asm volatile ("" ::: "memory");
@@ -66,11 +67,24 @@ pthread_cancel_init (void)
   libgcc_s_resume = resume;
   libgcc_s_personality = personality;
   libgcc_s_forcedunwind = forcedunwind;
+  libgcc_s_getcfa = getcfa;
   /* Make sure libgcc_s_getcfa is written last.  Otherwise,
      pthread_cancel_init might return early even when the pointer the
      caller is interested in is not initialized yet.  */
   atomic_write_barrier ();
-  libgcc_s_getcfa = getcfa;
+  libgcc_s_handle = handle;
+}
+
+void
+__libc_freeres_fn_section
+__unwind_freeres (void)
+{
+  void *handle = libgcc_s_handle;
+  if (handle != NULL)
+    {
+      libgcc_s_handle = NULL;
+      __libc_dlclose (handle);
+    }
 }
 
 void

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ab4340a815b484f6d462e7c40639f2f9856b83c8

commit ab4340a815b484f6d462e7c40639f2f9856b83c8
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Mon Feb 9 20:27:56 2009 +0000

    2009-02-09  Arthur Loiret  <aloiret@debian.org>
    
    	[BZ #9717]
    
    	* sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
    	(MALLOC): Adjust __libc_tsd_define arguments.
    	(tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
    	arguments.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 3d570db..0fac875 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,12 @@
+2009-02-09  Arthur Loiret  <aloiret@debian.org>
+
+	[BZ #9717]
+
+	* sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
+	(MALLOC): Adjust __libc_tsd_define arguments.
+	(tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
+	arguments.
+
 2008-08-07  Helge Deller  <deller@gmx.de>
 
 	* sysdeps/unix/sysv/linux/hppa/ucontext_i.sym: New file.
diff --git a/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h b/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
index 817cf59..5dc6e6f 100644
--- a/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
+++ b/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
@@ -63,10 +63,10 @@ extern void *__dso_handle __attribute__ ((__weak__));
 #include <bits/libc-tsd.h>
 
 typedef int tsd_key_t[1];	/* no key data structure, libc magic does it */
-__libc_tsd_define (static, MALLOC)	/* declaration/common definition */
+__libc_tsd_define (static, void *, MALLOC)	/* declaration/common definition */
 #define tsd_key_create(key, destr)	((void) (key))
-#define tsd_setspecific(key, data)	__libc_tsd_set (MALLOC, (data))
-#define tsd_getspecific(key, vptr)	((vptr) = __libc_tsd_get (MALLOC))
+#define tsd_setspecific(key, data)	__libc_tsd_set (void *, MALLOC, (data))
+#define tsd_getspecific(key, vptr)	((vptr) = __libc_tsd_get (void *, MALLOC))
 
 #include <sysdeps/generic/malloc-machine.h>
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5631abde36e37c8031028d0d17e0a6822546404f

commit 5631abde36e37c8031028d0d17e0a6822546404f
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Feb 5 14:46:41 2009 +0000

    2009-02-05  Paul Brook  <paul@codesourcery.com>
                Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto.
    	(elf_machine_load_address): Clear T bit of PLT entry contents.
    	(RTLD_START): Mark function symbols as such.  Tweak pc-relative
    	addressing to avoid depending on pc read pipeline offset.
    	* sysdeps/arm/machine-gmon.h (MCOUNT): Add Thumb-2 implementation.
    	* sysdeps/arm/tls-macros.h: Add alignment for Thumb-2.
    	(ARM_PC_OFFSET): Define.
    	(TLS_IE): Define differently for Thumb-2.
    	(TLS_LE, TLS_LD, TLS_GD): Use ARM_PC_OFFSET.
    	* sysdeps/arm/elf/start.S: Switch to thumb mode for Thumb-2.
    	* sysdeps/unix/sysv/linux/arm/eabi/sysdep.h (INTERNAL_SYSCALL_RAW):
    	Add Thumb implementation.
    	* sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h: New.
    	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c: Enforce
    	alignment for Thumb-2.  Adjust offset from PC for Thumb-2.
    	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: Ditto.
    	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (atomic_full_barrier,
    	__arch_compare_and_exchange_val_32_acq): Add Thumb-2 implementation.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 52480ac..fd520bc 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,25 @@
+2009-02-05  Paul Brook  <paul@codesourcery.com>
+            Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto.
+	(elf_machine_load_address): Clear T bit of PLT entry contents.
+	(RTLD_START): Mark function symbols as such.  Tweak pc-relative
+	addressing to avoid depending on pc read pipeline offset.
+	* sysdeps/arm/machine-gmon.h (MCOUNT): Add Thumb-2 implementation.
+	* sysdeps/arm/tls-macros.h: Add alignment for Thumb-2.
+	(ARM_PC_OFFSET): Define.
+	(TLS_IE): Define differently for Thumb-2.
+	(TLS_LE, TLS_LD, TLS_GD): Use ARM_PC_OFFSET.
+	* sysdeps/arm/elf/start.S: Switch to thumb mode for Thumb-2.
+	* sysdeps/unix/sysv/linux/arm/eabi/sysdep.h (INTERNAL_SYSCALL_RAW):
+	Add Thumb implementation.
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h: New.
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c: Enforce
+	alignment for Thumb-2.  Adjust offset from PC for Thumb-2.
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: Ditto.
+	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (atomic_full_barrier,
+	__arch_compare_and_exchange_val_32_acq): Add Thumb-2 implementation.
+
 2009-02-02  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/bits/shm.h (SHM_EXEC): Define.
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 1a45a26..f839d97 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -53,11 +53,22 @@ static inline Elf32_Addr __attribute__ ((unused))
 elf_machine_dynamic (void)
 {
   Elf32_Addr dynamic;
+#ifdef __thumb2__
+  long tmp;
+  asm ("ldr\t%0, 1f\n\t"
+       "adr\t%1, 1f\n\t"
+       "ldr\t%0, [%0, %1]\n\t"
+       "b 2f\n"
+       ".align 2\n"
+       "1: .word _GLOBAL_OFFSET_TABLE_ - 1b\n"
+       "2:" : "=r" (dynamic), "=r"(tmp));
+#else
   asm ("ldr %0, 2f\n"
        "1: ldr %0, [pc, %0]\n"
        "b 3f\n"
        "2: .word _GLOBAL_OFFSET_TABLE_ - (1b+8)\n"
        "3:" : "=r" (dynamic));
+#endif
   return dynamic;
 }
 
@@ -69,6 +80,10 @@ elf_machine_load_address (void)
   extern void __dl_start asm ("_dl_start");
   Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
   Elf32_Addr pcrel_addr;
+#ifdef __thumb__
+  /* Clear the low bit of the funciton address.  */
+  got_addr &= ~(Elf32_Addr) 1;
+#endif
   asm ("adr %0, _dl_start" : "=r" (pcrel_addr));
   return pcrel_addr - got_addr;
 }
@@ -140,7 +155,9 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 #define RTLD_START asm ("\
 .text\n\
 .globl _start\n\
+.type _start, %function\n\
 .globl _dl_start_user\n\
+.type _dl_start_user, %function\n\
 _start:\n\
 	@ we are PIC code, so get global offset table\n\
 	ldr	sl, .L_GET_GOT\n\
@@ -152,8 +169,8 @@ _start:\n\
 	bl	_dl_start\n\
 	@ returns user entry point in r0\n\
 _dl_start_user:\n\
-	add	sl, pc, sl\n\
-.L_GOT_GOT:\n\
+	adr	r6, .L_GET_GOT\n\
+	add	sl, sl, r6\n\
 	ldr	r4, [sl, r4]\n\
 	@ save the entry point in another register\n\
 	mov	r6, r0\n\
@@ -210,7 +227,7 @@ _dl_start_user:\n\
 	b	.L_done_fixup\n\
 \n\
 .L_GET_GOT:\n\
-	.word	_GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n\
+	.word	_GLOBAL_OFFSET_TABLE_ - .L_GET_GOT\n\
 .L_SKIP_ARGS:\n\
 	.word	_dl_skip_args(GOTOFF)\n\
 .L_FINI_PROC:\n\
diff --git a/sysdeps/arm/elf/start.S b/sysdeps/arm/elf/start.S
index f63b3db..0cf4339 100644
--- a/sysdeps/arm/elf/start.S
+++ b/sysdeps/arm/elf/start.S
@@ -58,6 +58,10 @@
 		...
 					NULL
 */
+#if defined(__thumb2__)
+	.thumb
+	.syntax unified
+#endif
 
 	.text
 	.globl _start
diff --git a/sysdeps/arm/machine-gmon.h b/sysdeps/arm/machine-gmon.h
index fa3f652..dbda0dd 100644
--- a/sysdeps/arm/machine-gmon.h
+++ b/sysdeps/arm/machine-gmon.h
@@ -50,6 +50,28 @@ static void mcount_internal (u_long frompc, u_long selfpc)
    }
 */
 
+#ifdef __thumb2__
+
+#define MCOUNT								\
+void _mcount (void)							\
+{									\
+  __asm__("push		{r0, r1, r2, r3};"				\
+	  "movs		fp, fp;"				      	\
+	  "it		eq;"						\
+          "moveq	r1, #0;"					\
+	  "itttt	ne;"						\
+	  "ldrne	r1, [fp, $-4];"					\
+	  "ldrne	r0, [fp, $-12];"				\
+	  "movnes	r0, r0;"					\
+	  "ldrne	r0, [r0, $-4];"					\
+	  "movs		r0, r0;"					\
+	  "it		ne;"						\
+	  "blne		mcount_internal;"				\
+	  "pop		{r0, r1, r2, r3}");				\
+}
+
+#else
+
 #define MCOUNT								\
 void _mcount (void)							\
 {									\
@@ -65,3 +87,4 @@ void _mcount (void)							\
 	  "ldmia	sp!, {r0, r1, r2, r3}");			\
 }
 
+#endif
diff --git a/sysdeps/arm/tls-macros.h b/sysdeps/arm/tls-macros.h
index 94aa3a8..e41d3bc 100644
--- a/sysdeps/arm/tls-macros.h
+++ b/sysdeps/arm/tls-macros.h
@@ -1,14 +1,36 @@
+#ifdef __thumb2__
+#define ARM_PC_OFFSET "4"
+#else
+#define ARM_PC_OFFSET "8"
+#endif
+
 #define TLS_LE(x)					\
   ({ int *__result;					\
      void *tp = __builtin_thread_pointer ();		\
      asm ("ldr %0, 1f; "				\
 	  "add %0, %1, %0; "				\
 	  "b 2f; "					\
+	  ".align 2; "					\
 	  "1: .word " #x "(tpoff); "			\
 	  "2: "						\
 	  : "=&r" (__result) : "r" (tp));		\
      __result; })
 
+#ifdef __thumb2__
+#define TLS_IE(x)					\
+  ({ int *__result;					\
+     void *tp = __builtin_thread_pointer ();		\
+     asm ("ldr %0, 1f; "				\
+	  "3: add %0, pc, %0;"				\
+	  "ldr %0, [%0];"				\
+	  "add %0, %1, %0; "				\
+	  "b 2f; "					\
+	  ".align 2; "					\
+	  "1: .word " #x "(gottpoff) + (. - 3b - 4); "	\
+	  "2: "						\
+	  : "=&r" (__result) : "r" (tp));		\
+     __result; })
+#else
 #define TLS_IE(x)					\
   ({ int *__result;					\
      void *tp = __builtin_thread_pointer ();		\
@@ -16,10 +38,12 @@
 	  "3: ldr %0, [pc, %0];"			\
 	  "add %0, %1, %0; "				\
 	  "b 2f; "					\
+	  ".align 2; "					\
 	  "1: .word " #x "(gottpoff) + (. - 3b - 8); "	\
 	  "2: "						\
 	  : "=&r" (__result) : "r" (tp));		\
      __result; })
+#endif
 
 #define TLS_LD(x)					\
   ({ char *__result;					\
@@ -28,12 +52,14 @@
      asm ("ldr %0, 2f; "				\
 	  "1: add %0, pc, %0; "				\
 	  "b 3f; "					\
-	  "2: .word " #x "(tlsldm) + (. - 1b - 8); "	\
+	  ".align 2; "					\
+	  "2: .word " #x "(tlsldm) + (. - 1b - "ARM_PC_OFFSET"); "	\
 	  "3: "						\
 	  : "=r" (__result));				\
      __result = (char *)__tls_get_addr (__result);	\
      asm ("ldr %0, 1f; "				\
 	  "b 2f; "					\
+	  ".align 2; "					\
 	  "1: .word " #x "(tlsldo); "			\
 	  "2: "						\
 	  : "=r" (__offset));				\
@@ -45,7 +71,8 @@
      asm ("ldr %0, 2f; "				\
 	  "1: add %0, pc, %0; "				\
 	  "b 3f; "					\
-	  "2: .word " #x "(tlsgd) + (. - 1b - 8); "	\
+	  ".align 2; "					\
+	  "2: .word " #x "(tlsgd) + (. - 1b - "ARM_PC_OFFSET"); "	\
 	  "3: "						\
 	  : "=r" (__result));				\
      (int *)__tls_get_addr (__result); })
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h b/sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h
new file mode 100644
index 0000000..3fb1ec9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include_next <aio_misc.h>
+
+#ifdef __thumb2__
+
+#include <errno.h>
+
+/* The Thumb-2 definition of INTERNAL_SYSCALL_RAW has to hide the use
+   of r7 from the compiler because it cannot handle asm clobbering the
+   hard frame pointer.  In aio_suspend, GCC does not eliminate the
+   hard frame pointer because the function uses variable-length
+   arrays, so it generates unwind information using r7 as virtual
+   stack pointer.  During system calls, when r7 has been saved on the
+   stack, this means the unwind information is invalid.  Without extra
+   unwind directives, which would need to cause unwind information for
+   the asm to be generated separately from that for the parts of the
+   function before and after the asm (with three index table entries),
+   it is not possible to represent any temporary change to the virtual
+   stack pointer.  Instead, we move the problematic system calls out
+   of line into a function that does not require a frame pointer.  */
+
+static __attribute_noinline__ void
+aio_misc_wait (int *resultp,
+	       volatile int *futexp,
+	       const struct timespec *timeout,
+	       int cancel)
+{
+  AIO_MISC_WAIT (*resultp, *futexp, timeout, cancel);
+}
+
+#undef AIO_MISC_WAIT
+#define AIO_MISC_WAIT(result, futex, timeout, cancel)	\
+  aio_misc_wait (&result, &futex, timeout, cancel)
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
index 24ce61b..71ab77c 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -89,7 +89,12 @@ asm (
 "4:	bl	pthread_cancel_init\n"
 "	ldr	r3, [r4, r5]\n"
 "	b	5b\n"
+"	.align 2\n"
+#ifdef __thumb2__
+"1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
+#else
 "1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
+#endif
 "2:	.word	libgcc_s_resume(GOTOFF)\n"
 "	.size	_Unwind_Resume, .-_Unwind_Resume\n"
 );
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
index a9c9d18..3c780b7 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
@@ -66,7 +66,12 @@ asm (
 "4:	bl	init\n"
 "	ldr	r3, [r4, r5]\n"
 "	b	5b\n"
+"	.align 2\n"
+#ifdef __thumb2__
+"1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
+#else
 "1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
+#endif
 "2:	.word	libgcc_s_resume(GOTOFF)\n"
 "	.size	_Unwind_Resume, .-_Unwind_Resume\n"
 );
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h b/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
index 1444f40..a7dd40d 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
@@ -44,6 +44,30 @@
    argument; otherwise the (optional) compatibility code for APCS binaries
    may be invoked.  */
 
+#ifdef __thumb__
+/* Hide the use of r7 from the compiler, this would be a lot
+   easier but for the fact that the syscalls can exceed 255.
+   For the moment the LOAD_ARGS_7 is sacrificed.
+   We can't use push/pop inside the asm because that breaks
+   unwinding (ie. thread cancellation).  */
+#undef LOAD_ARGS_7
+#undef INTERNAL_SYSCALL_RAW
+#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
+  ({								\
+      int _sys_buf[2];						\
+      register int _a1 asm ("a1");				\
+      register int *_r6 asm ("r6") = _sys_buf;			\
+      *_r6 = name;						\
+      LOAD_ARGS_##nr (args)					\
+      asm volatile ("str        r7, [r6, #4]\n\t"		\
+                    "ldr      r7, [r6]\n\t"			\
+                    "swi      0       @ syscall " #name "\n\t"	\
+                    "ldr      r7, [r6, #4]"			\
+                   : "=r" (_a1)					\
+                    : "r" (_r6) ASM_ARGS_##nr			\
+                    : "memory");				\
+       _a1; })
+#else /* ARM */
 #undef INTERNAL_SYSCALL_RAW
 #define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
   ({								\
@@ -55,6 +79,7 @@
 		     : "r" (_nr) ASM_ARGS_##nr			\
 		     : "memory");				\
        _a1; })
+#endif
 
 /* For EABI, non-constant syscalls are actually pretty easy...  */
 #undef INTERNAL_SYSCALL_NCS
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h b/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
index 247ddd3..b0586ea 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
@@ -37,12 +37,21 @@ typedef uintmax_t uatomic_max_t;
 
 void __arm_link_error (void);
 
+#ifdef __thumb2__
+#define atomic_full_barrier() \
+     __asm__ __volatile__						      \
+	     ("movw\tip, #0x0fa0\n\t"					      \
+	      "movt\tip, #0xffff\n\t"					      \
+	      "blx\tip"							      \
+	      : : : "ip", "lr", "cc", "memory");
+#else
 #define atomic_full_barrier() \
      __asm__ __volatile__						      \
 	     ("mov\tip, #0xffff0fff\n\t"				      \
 	      "mov\tlr, pc\n\t"						      \
 	      "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)"			      \
 	      : : : "ip", "lr", "cc", "memory");
+#endif
 
 /* Atomic compare and exchange.  This sequence relies on the kernel to
    provide a compare and exchange operation which is atomic on the
@@ -59,6 +68,32 @@ void __arm_link_error (void);
    specify one to work around GCC PR rtl-optimization/21223.  Otherwise
    it may cause a_oldval or a_tmp to be moved to a different register.  */
 
+#ifdef __thumb2__
+/* Thumb-2 has ldrex/strex.  However it does not have barrier instructions,
+   so we still need to use the kernel helper.  */
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  ({ register __typeof (oldval) a_oldval asm ("r0");			      \
+     register __typeof (oldval) a_newval asm ("r1") = (newval);		      \
+     register __typeof (mem) a_ptr asm ("r2") = (mem);			      \
+     register __typeof (oldval) a_tmp asm ("r3");			      \
+     register __typeof (oldval) a_oldval2 asm ("r4") = (oldval);	      \
+     __asm__ __volatile__						      \
+	     ("0:\tldr\t%[tmp],[%[ptr]]\n\t"				      \
+	      "cmp\t%[tmp], %[old2]\n\t"				      \
+	      "bne\t1f\n\t"						      \
+	      "mov\t%[old], %[old2]\n\t"				      \
+	      "movw\t%[tmp], #0x0fc0\n\t"				      \
+	      "movt\t%[tmp], #0xffff\n\t"				      \
+	      "blx\t%[tmp]\n\t"						      \
+	      "bcc\t0b\n\t"						      \
+	      "mov\t%[tmp], %[old2]\n\t"				      \
+	      "1:"							      \
+	      : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp)		      \
+	      : [new] "r" (a_newval), [ptr] "r" (a_ptr),		      \
+		[old2] "r" (a_oldval2)					      \
+	      : "ip", "lr", "cc", "memory");				      \
+     a_tmp; })
+#else
 #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
   ({ register __typeof (oldval) a_oldval asm ("r0");			      \
      register __typeof (oldval) a_newval asm ("r1") = (newval);		      \
@@ -81,6 +116,7 @@ void __arm_link_error (void);
 		[old2] "r" (a_oldval2)					      \
 	      : "ip", "lr", "cc", "memory");				      \
      a_tmp; })
+#endif
 
 #define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
   ({ __arm_link_error (); oldval; })

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8085bd60e25f8697bd50e0e4658a26d23e16702a

commit 8085bd60e25f8697bd50e0e4658a26d23e16702a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Feb 2 15:36:15 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/shm.h (SHM_EXEC): Define.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index d48e4df..bccb10d 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,7 @@
+2009-02-02  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/shm.h (SHM_EXEC): Define.
+
 2009-01-27  Maciej W. Rozycki  <macro@linux-mips.org>
 	    Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h
index 037980c..07f9743 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003,2009 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
@@ -30,6 +30,7 @@
 #define SHM_RDONLY	010000		/* attach read-only else read-write */
 #define SHM_RND		020000		/* round attach address to SHMLBA */
 #define SHM_REMAP	040000		/* take-over region on attach */
+#define SHM_EXEC	0100000		/* execution access */
 
 /* Commands for `shmctl'.  */
 #define SHM_LOCK	11		/* lock segment (root only) */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=19df4df1752d9d0e9543a1f42579f625c1659a29

commit 19df4df1752d9d0e9543a1f42579f625c1659a29
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Feb 2 15:35:22 2009 +0000

    	* sysdeps/unix/sysv/linux/arm/bits/shm.h (SHM_EXEC): Define.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 338d768..52480ac 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2009-02-02  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/bits/shm.h (SHM_EXEC): Define.
+
 2009-01-27  Min Zhang  <mzhang@mvista.com>
 
 	* sysdeps/arm/memset.S (memset): Use stm instead of two
diff --git a/sysdeps/unix/sysv/linux/arm/bits/shm.h b/sysdeps/unix/sysv/linux/arm/bits/shm.h
index 4faa287..b723cc9 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,2000,2002,2004,2008
+/* Copyright (C) 1995,1996,1997,2000,2002,2004,2008,2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -31,6 +31,7 @@
 #define SHM_RDONLY	010000		/* attach read-only else read-write */
 #define SHM_RND		020000		/* round attach address to SHMLBA */
 #define SHM_REMAP	040000		/* take-over region on attach */
+#define SHM_EXEC	0100000		/* execution access */
 
 /* Commands for `shmctl'.  */
 #define SHM_LOCK	11		/* lock segment (root only) */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f2c9d882070d2c4bc5a099690961562662b8522a

commit f2c9d882070d2c4bc5a099690961562662b8522a
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Jan 27 17:10:08 2009 +0000

    2009-01-27  Min Zhang  <mzhang@mvista.com>
    
    	* sysdeps/arm/memset.S (memset): Use stm instead of two
    	str instructions.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 2a8a252..338d768 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-01-27  Min Zhang  <mzhang@mvista.com>
+
+	* sysdeps/arm/memset.S (memset): Use stm instead of two
+	str instructions.
+
 2009-01-27  Kirill A. Shutemov <kirill@shutemov.name>
 
 	* sysdeps/arm/elf/start.S (_start): Use position-independent code
diff --git a/sysdeps/arm/memset.S b/sysdeps/arm/memset.S
index b37451b..a276570 100644
--- a/sysdeps/arm/memset.S
+++ b/sysdeps/arm/memset.S
@@ -35,20 +35,17 @@ ENTRY(memset)
 	and	r1, r1, #255	@ clear any sign bits
 	orr	r1, r1, r1, lsl $8
 	orr	r1, r1, r1, lsl $16
+	mov	ip, r1
 
 1:
 	subs	r2, r2, #8
-	strcs	r1, [r3], #4	@ store up to 32 bytes per loop iteration
-	strcs	r1, [r3], #4
+	stmcsia	r3!, {r1, ip}	@ store up to 32 bytes per loop iteration
 	subcss	r2, r2, #8
-	strcs	r1, [r3], #4
-	strcs	r1, [r3], #4
+	stmcsia	r3!, {r1, ip}
 	subcss	r2, r2, #8
-	strcs	r1, [r3], #4
-	strcs	r1, [r3], #4
+	stmcsia	r3!, {r1, ip}
 	subcss	r2, r2, #8
-	strcs	r1, [r3], #4
-	strcs	r1, [r3], #4
+	stmcsia	r3!, {r1, ip}
 	bcs	1b
 
 	and	r2, r2, #7

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=856cb7775f0dc086c62eb2610e6e5613926e0a99

commit 856cb7775f0dc086c62eb2610e6e5613926e0a99
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Jan 27 16:01:19 2009 +0000

    2009-01-27  Kirill A. Shutemov <kirill@shutemov.name>
    
    	* sysdeps/arm/elf/start.S (_start): Use position-independent code
    	if SHARED.  Clear lr.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 0d3eba2..2a8a252 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-01-27  Kirill A. Shutemov <kirill@shutemov.name>
+
+	* sysdeps/arm/elf/start.S (_start): Use position-independent code
+	if SHARED.  Clear lr.
+
 2009-01-27  Ryosei Takagi  <ryosei@sm.sony.co.jp>
 
         * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
diff --git a/sysdeps/arm/elf/start.S b/sysdeps/arm/elf/start.S
index 2e0a8b1..f63b3db 100644
--- a/sysdeps/arm/elf/start.S
+++ b/sysdeps/arm/elf/start.S
@@ -1,5 +1,5 @@
 /* Startup code for ARM & ELF
-   Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2005
+   Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2005, 2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -67,11 +67,9 @@ _start:
        /* Protect against unhandled exceptions.  */
        .fnstart
 #endif
-	/* Fetch address of fini */
-	ldr ip, =__libc_csu_fini
-
-	/* Clear the frame pointer since this is the outermost frame.  */
+	/* Clear the frame pointer and link register since this is the outermost frame. */
 	mov fp, #0
+	mov lr, #0
 
 	/* Pop argc off the stack and save a pointer to argv */
 	ldr a2, [sp], #4
@@ -83,21 +81,53 @@ _start:
 	/* Push rtld_fini */
 	str a1, [sp, #-4]!
 
+#ifdef SHARED
+	ldr sl, .L_GOT
+.L_GOT_OFF:
+	add sl, pc, sl
+
+	ldr ip, .L_GOT+4	/* __libc_csu_fini */
+	ldr ip, [sl, ip]
+
+	str ip, [sp, #-4]!	/* Push __libc_csu_fini */
+
+	ldr a4, .L_GOT+8	/* __libc_csu_init */
+	ldr a4, [sl, a4]
+
+	ldr a1, .L_GOT+12	/* main */
+	ldr a1, [sl, a1]
+
+	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+	/* Let the libc call main and exit with its return code.  */
+	bl __libc_start_main(PLT)
+#else
+	/* Fetch address of __libc_csu_fini */
+	ldr ip, =__libc_csu_fini
+
+	/* Push __libc_csu_fini */
+	str ip, [sp, #-4]!
+
 	/* Set up the other arguments in registers */
 	ldr a1, =main
 	ldr a4, =__libc_csu_init
 
-	/* Push fini */
-	str ip, [sp, #-4]!
-
 	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
-
 	/* Let the libc call main and exit with its return code.  */
 	bl __libc_start_main
+#endif
 
 	/* should never get here....*/
 	bl abort
 
+#ifdef SHARED
+.L_GOT:
+	.word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8)
+	.word __libc_csu_fini(GOT)
+	.word __libc_csu_init(GOT)
+	.word main(GOT)
+#endif
+
+
 #if !defined(__USING_SJLJ_EXCEPTIONS__)
        .cantunwind
        .fnend

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=60acbff563ba810b33fed59133033380d4de9429

commit 60acbff563ba810b33fed59133033380d4de9429
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Jan 27 15:48:44 2009 +0000

            * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
    	(lll_futex_wake_unlock, lll_futex_requeue): Return zero if success.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index eb02191..0d3eba2 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-01-27  Ryosei Takagi  <ryosei@sm.sony.co.jp>
+
+        * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+	(lll_futex_wake_unlock, lll_futex_requeue): Return zero if success.
+
 2009-01-27  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/sysdep.h: Include <tls.h>.
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 95920ab..e745e66 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -114,7 +114,7 @@
     __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
 			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
 			      (nr_wake), (nr_move), (mutex), (val));	      \
-    __ret;								      \
+    INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
 
 
@@ -127,7 +127,7 @@
 			      __lll_private_flag (FUTEX_WAKE_OP, private),    \
 			      (nr_wake), (nr_wake2), (futexp2),		      \
 			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
-    __ret;								      \
+    INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
 
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a68f927f95aeaa729ed920516fc49a9e639f6552

commit a68f927f95aeaa729ed920516fc49a9e639f6552
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Jan 27 15:36:22 2009 +0000

    	* sysdeps/unix/sysv/linux/arm/sysdep.h: Include <tls.h>.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 4172ee4..eb02191 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2009-01-27  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/sysdep.h: Include <tls.h>.
+
 2009-01-12  Mike Frysinger  <vapier@gentoo.org>
 
 	* sysdeps/arm/fpu/setjmp.S: Add hidden_def (__sigsetjmp).
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 59ccbbc..1df63f6 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -28,6 +28,8 @@
 /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
 #include <dl-sysdep.h>
 
+#include <tls.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9290e553761b1cab417d5413cf12940b03849f12

commit 9290e553761b1cab417d5413cf12940b03849f12
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Jan 27 15:32:55 2009 +0000

    	PR glibc/1048
    	* sysdeps/unix/sysv/linux/mips/dl-static.c: New file to support
    	variable page size for MIPS.
    	* sysdeps/unix/sysv/linux/mips/ldsodefs.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/Makefile: Build dl-static in elf.
    	* sysdeps/unix/sysv/linux/mips/Versions: Add _dl_var_init.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 8d8d38e..d48e4df 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,13 @@
+2009-01-27  Maciej W. Rozycki  <macro@linux-mips.org>
+	    Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
+
+	PR glibc/1048
+	* sysdeps/unix/sysv/linux/mips/dl-static.c: New file to support
+	variable page size for MIPS.
+	* sysdeps/unix/sysv/linux/mips/ldsodefs.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/Makefile: Build dl-static in elf.
+	* sysdeps/unix/sysv/linux/mips/Versions: Add _dl_var_init.
+
 2009-01-12  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/resource.h (enum
diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile
index 72fa87b..110fccb 100644
--- a/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/Makefile
@@ -126,3 +126,12 @@ else
 	mv -f $(@:.h=.d)-t $(@:.h=.d)
 endif
 endif
+
+ifeq ($(subdir),elf)
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+sysdep_routines += dl-static
+sysdep-rtld-routines += dl-static
+endif
+endif
diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions
index 50bfac5..09df42d 100644
--- a/sysdeps/unix/sysv/linux/mips/Versions
+++ b/sysdeps/unix/sysv/linux/mips/Versions
@@ -1,3 +1,9 @@
+ld {
+  GLIBC_PRIVATE {
+    # used for loading by static libraries
+    _dl_var_init;
+  }
+}
 libc {
   # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
   # When you get an error from errlist-compat.awk, you need to add a new
diff --git a/sysdeps/unix/sysv/linux/mips/dl-static.c b/sysdeps/unix/sysv/linux/mips/dl-static.c
new file mode 100644
index 0000000..3a99e7e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/dl-static.c
@@ -0,0 +1,92 @@
+/* Variable initialization.  MIPS version.
+   Copyright (C) 2001, 2002, 2003, 2005 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <ldsodefs.h>
+
+#ifdef SHARED
+
+void
+_dl_var_init (void *array[])
+{
+  /* It has to match "variables" below. */
+  enum
+    {
+      DL_PAGESIZE = 0
+    };
+
+  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
+}
+
+#else
+#include <bits/libc-lock.h>
+
+__libc_lock_define_initialized_recursive (static, _dl_static_lock)
+
+static void *variables[] =
+{
+  &GLRO(dl_pagesize)
+};
+
+static void
+_dl_unprotect_relro (struct link_map *l)
+{
+  ElfW(Addr) start = ((l->l_addr + l->l_relro_addr)
+		      & ~(GLRO(dl_pagesize) - 1));
+  ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size)
+		    & ~(GLRO(dl_pagesize) - 1));
+
+  if (start != end)
+    __mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE);
+}
+
+void
+_dl_static_init (struct link_map *l)
+{
+  struct link_map *rtld_map = l;
+  struct r_scope_elem **scope;
+  const ElfW(Sym) *ref = NULL;
+  lookup_t loadbase;
+  void (*f) (void *[]);
+  size_t i;
+
+  __libc_lock_lock_recursive (_dl_static_lock);
+
+  loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope,
+				  NULL, 0, 1, NULL);
+  
+  for (scope = l->l_local_scope; *scope != NULL; scope++)
+    for (i = 0; i < (*scope)->r_nlist; i++)
+      if ((*scope)->r_list[i] == loadbase)
+	{
+	  rtld_map = (*scope)->r_list[i];
+	  break;
+	}
+
+  if (ref != NULL)
+    {
+      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
+      _dl_unprotect_relro (rtld_map);
+      f (variables);
+      _dl_protect_relro (rtld_map);
+    }
+
+  __libc_lock_unlock_recursive (_dl_static_lock);
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/ldsodefs.h b/sysdeps/unix/sysv/linux/mips/ldsodefs.h
new file mode 100644
index 0000000..8d5efec
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/ldsodefs.h
@@ -0,0 +1,33 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects. MIPS.
+   Copyright (C) 2001, 2003 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_LDSODEFS_H
+
+/* Get the real definitions.  */
+#include_next <ldsodefs.h>
+
+/* Now define our stuff.  */
+
+/* We need special support to initialize DSO loaded for statically linked
+   binaries.  */
+extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
+#define DL_STATIC_INIT(map) _dl_static_init (map)
+
+#endif /* ldsodefs.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e5c922c9023a2dc498fc1a1abdda8b7d552b60b1

commit e5c922c9023a2dc498fc1a1abdda8b7d552b60b1
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jan 12 16:49:33 2009 +0000

    2009-01-12  Mike Frysinger  <vapier@gentoo.org>
    
    	* sysdeps/arm/fpu/setjmp.S: Add hidden_def (__sigsetjmp).

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 710d426..4172ee4 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2009-01-12  Mike Frysinger  <vapier@gentoo.org>
+
+	* sysdeps/arm/fpu/setjmp.S: Add hidden_def (__sigsetjmp).
+
 2009-01-12  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
diff --git a/sysdeps/arm/fpu/setjmp.S b/sysdeps/arm/fpu/setjmp.S
index 8432836..82a7e19 100644
--- a/sysdeps/arm/fpu/setjmp.S
+++ b/sysdeps/arm/fpu/setjmp.S
@@ -33,3 +33,5 @@ ENTRY (__sigsetjmp)
 	/* Make a tail call to __sigjmp_save; it takes the same args.  */
 	B	PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
 END (__sigsetjmp)
+
+hidden_def (__sigsetjmp)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e27433a86962048afbf94135b620b04ef15986a6

commit e27433a86962048afbf94135b620b04ef15986a6
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jan 12 16:45:43 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/resource.h (enum
    	__rusage_who): Avoid comma after RUSAGE_CHILDREN if not
    	-D_GNU_SOURCE.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 49b7167..8d8d38e 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,11 @@
 2009-01-12  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/mips/bits/resource.h (enum
+	__rusage_who): Avoid comma after RUSAGE_CHILDREN if not
+	-D_GNU_SOURCE.
+
+2009-01-12  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
 	FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index 3cfdc5d..39d17d7 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -1,6 +1,6 @@
 /* Bit values & structures for resource limits.  Linux/MIPS version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006, 2008,
+   2009 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
@@ -166,10 +166,11 @@ enum __rusage_who
 #define RUSAGE_SELF RUSAGE_SELF
 
   /* All of its terminated child processes.  */
-  RUSAGE_CHILDREN = -1,
+  RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
 
 #ifdef __USE_GNU
+  ,
   /* The calling thread.  */
   RUSAGE_THREAD = 1
 # define RUSAGE_THREAD RUSAGE_THREAD

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bb3b3056df2d85d15a4052bad9461e30da646a4e

commit bb3b3056df2d85d15a4052bad9461e30da646a4e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jan 12 16:38:17 2009 +0000

    	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
    	FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 7aac3a1..49b7167 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2009-01-12  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
+	FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
+
 2008-12-19  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c,
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index eae3f40..ab284df 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008,
+   2009 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
@@ -38,6 +39,9 @@
 #define FUTEX_WAIT_BITSET	9
 #define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
+#define FUTEX_CLOCK_REALTIME	256
+
+#define FUTEX_BITSET_MATCH_ANY	0xffffffff
 
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9b1af9bd983a4e79244c144e837b004125292b98

commit 9b1af9bd983a4e79244c144e837b004125292b98
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jan 12 16:37:27 2009 +0000

    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
    	FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 045b6d5..710d426 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2009-01-12  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
+	FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
+
 2008-12-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 7a05462..95920ab 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2007, 2008, 2009 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
@@ -38,6 +38,9 @@
 #define FUTEX_WAIT_BITSET	9
 #define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
+#define FUTEX_CLOCK_REALTIME	256
+
+#define FUTEX_BITSET_MATCH_ANY	0xffffffff
 
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=01aa93bd54bdda064240756ce5cab10bea65d636

commit 01aa93bd54bdda064240756ce5cab10bea65d636
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Dec 19 21:35:57 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c,
    	sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c: New.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 23c1e25..7aac3a1 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,10 @@
+2008-12-19  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c: New.
+
 2008-12-09  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/socket.h (SCM_CREDENTIALS):
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c
new file mode 100644
index 0000000..5516885
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <kernel-features.h>
+#include <sysdep.h>
+
+#define posix_fallocate static internal_fallocate
+#include <sysdeps/posix/posix_fallocate.c>
+#undef posix_fallocate
+
+#if !defined __ASSUME_FALLOCATE && defined __NR_fallocate
+int __have_fallocate attribute_hidden;
+#endif
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+posix_fallocate (int fd, __off_t offset, __off_t len)
+{
+#ifdef __NR_fallocate
+# ifndef __ASSUME_FALLOCATE
+  if (__builtin_expect (__have_fallocate >= 0, 1))
+# endif
+    {
+      INTERNAL_SYSCALL_DECL (err);
+      int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
+
+      if (! INTERNAL_SYSCALL_ERROR_P (res, err))
+	return 0;
+
+# ifndef __ASSUME_FALLOCATE
+      if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0))
+	__have_fallocate = -1;
+      else
+# endif
+	if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
+	  return INTERNAL_SYSCALL_ERRNO (res, err);
+    }
+#endif
+
+  return internal_fallocate (fd, offset, len);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c
new file mode 100644
index 0000000..10e9a4a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <kernel-features.h>
+#include <sysdep.h>
+
+extern int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len);
+#define __posix_fallocate64_l64 static internal_fallocate64
+#include <sysdeps/posix/posix_fallocate64.c>
+#undef __posix_fallocate64_l64
+
+#if !defined __ASSUME_FALLOCATE && defined __NR_fallocate
+/* Defined in posix_fallocate.c.  */
+extern int __have_fallocate attribute_hidden;
+#endif
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+__posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
+{
+#ifdef __NR_fallocate
+# ifndef __ASSUME_FALLOCATE
+  if (__builtin_expect (__have_fallocate >= 0, 1))
+# endif
+    {
+      INTERNAL_SYSCALL_DECL (err);
+      int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
+
+      if (! INTERNAL_SYSCALL_ERROR_P (res, err))
+	return 0;
+
+# ifndef __ASSUME_FALLOCATE
+      if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0))
+	__have_fallocate = -1;
+      else
+# endif
+	if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
+	  return INTERNAL_SYSCALL_ERRNO (res, err);
+    }
+#endif
+
+  return internal_fallocate64 (fd, offset, len);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c
new file mode 100644
index 0000000..b3fe81b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c
new file mode 100644
index 0000000..f466f13
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c
@@ -0,0 +1 @@
+/* posix_fallocate64 is in posix_fallocate.c */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=64762db4138285bdcdd3804444f767c9c58d40df

commit 64762db4138285bdcdd3804444f767c9c58d40df
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Dec 9 23:53:33 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/socket.h (SCM_CREDENTIALS):
    	Make available only for __USE_GNU.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 91974a7..23c1e25 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-12-09  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h (SCM_CREDENTIALS):
+	Make available only for __USE_GNU.
+
 2008-12-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 4f219d5..dad2c2d 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -303,7 +303,7 @@ enum
   {
     SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
 #define SCM_RIGHTS SCM_RIGHTS
-#ifdef __USE_BSD
+#ifdef __USE_GNU
     , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
 # define SCM_CREDENTIALS SCM_CREDENTIALS
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9a9863b435e55a561d421599bad98e9d8093ec40

commit 9a9863b435e55a561d421599bad98e9d8093ec40
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Dec 3 23:37:48 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
    	FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 9bd9e04..91974a7 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-12-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
+	FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET.
+
 2008-11-25  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/sys/signalfd.h (signalfd): Fix
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index 1cb3d9b..eae3f40 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
@@ -35,6 +35,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=74af6970b86576628142ed49f313b2c14ea3a273

commit 74af6970b86576628142ed49f313b2c14ea3a273
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Dec 3 23:36:56 2008 +0000

    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
    	FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 74748f1..045b6d5 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2008-12-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
+	FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET.
+
 2008-11-25  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/sysdep.h (LOAD_ARGS_1, LOAD_ARGS_2,
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 889f97c..7a05462 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -35,6 +35,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7deeab197e80c9b3aea6eccbe912a52ee90fa4b8

commit 7deeab197e80c9b3aea6eccbe912a52ee90fa4b8
Author: Roland McGrath <roland@gnu.org>
Date:   Wed Nov 26 19:20:37 2008 +0000

    .

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 2e101a8..6bb3b7c 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,3 +1,10 @@
+2008-11-26  Roland McGrath  <roland@redhat.com>
+
+	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main
+	repository's ia64 file; #include that.
+	* sysdeps/unix/sysv/linux/alpha/ipc_priv.h: Contents moved to main
+	repository's powerpc file; #include that.
+
 2008-11-25  Roland McGrath  <roland@redhat.com>
 
 	* ChangeLog.alpha: New file (this one).

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=751759ebd260c3091839fe9ed410d54903248cf4

commit 751759ebd260c3091839fe9ed410d54903248cf4
Author: Roland McGrath <roland@gnu.org>
Date:   Wed Nov 26 19:20:13 2008 +0000

    2008-11-26  Roland McGrath  <roland@redhat.com>
    
    	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main
    	repository's ia64 file; #include that.
    	* sysdeps/unix/sysv/linux/alpha/ipc_priv.h: Contents moved to main
    	repository's powerpc file; #include that.

diff --git a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h
index 0328dc0..67883be 100644
--- a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h
+++ b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h
@@ -1,47 +1 @@
-/* Copyright (C) 1995-1999, 2000, 2003 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <sys/ipc.h>
-
-#define __IPC_64	0x100
-
-struct __old_ipc_perm
-{
-  __key_t __key;			/* Key.  */
-  unsigned int uid;			/* Owner's user ID.  */
-  unsigned int gid;			/* Owner's group ID.  */
-  unsigned int cuid;			/* Creator's user ID.  */
-  unsigned int cgid;			/* Creator's group ID.  */
-  unsigned int mode;			/* Read/write permission.  */
-  unsigned short int __seq;		/* Sequence number.  */
-};
-
-
-/* The codes for the functions to use the ipc syscall multiplexer.  */
-#define IPCOP_semop	 1
-#define IPCOP_semget	 2
-#define IPCOP_semctl	 3
-#define IPCOP_semtimedop 4
-#define IPCOP_msgsnd	11
-#define IPCOP_msgrcv	12
-#define IPCOP_msgget	13
-#define IPCOP_msgctl	14
-#define IPCOP_shmat	21
-#define IPCOP_shmdt	22
-#define IPCOP_shmget	23
-#define IPCOP_shmctl	24
+#include <sysdeps/unix/sysv/linux/powerpc/ipc_priv.h>
diff --git a/sysdeps/unix/sysv/linux/alpha/wordexp.c b/sysdeps/unix/sysv/linux/alpha/wordexp.c
index c2972e4..075b267 100644
--- a/sysdeps/unix/sysv/linux/alpha/wordexp.c
+++ b/sysdeps/unix/sysv/linux/alpha/wordexp.c
@@ -1,60 +1 @@
-/* Copyright (C) 2001, 2004, 2005 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <shlib-compat.h>
-
-/* For Linux/Alpha we have to make the wordexp symbols versioned.  */
-#define wordexp(words, pwordexp, flags) \
-  __new_wordexp (words, pwordexp, flags)
-
-#include <posix/wordexp.c>
-
-versioned_symbol (libc, __new_wordexp, wordexp, GLIBC_2_2_2);
-
-
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2_2)
-/* The old, incorrect wordexp_t definition.  */
-typedef struct
-  {
-    int we_wordc;		/* Count of words matched.  */
-    char **we_wordv;		/* List of expanded words.  */
-    int we_offs;		/* Slots to reserve in `we_wordv'.  */
-  } old_wordexp_t;
-
-
-int
-attribute_compat_text_section
-__old_wordexp (const char *words, old_wordexp_t *pwordexp, int flags)
-{
-  wordexp_t we;
-  int result;
-
-  we.we_wordc = pwordexp->we_wordc;
-  we.we_wordv = pwordexp->we_wordv;
-  we.we_offs = pwordexp->we_offs;
-
-  result = __new_wordexp (words, &we, flags);
-
-  pwordexp->we_wordc = we.we_wordc;
-  pwordexp->we_wordv = we.we_wordv;
-  pwordexp->we_offs = we.we_offs;
-
-  return result;
-}
-compat_symbol (libc, __old_wordexp, wordexp, GLIBC_2_1);
-#endif
+#include <sysdeps/unix/sysv/linux/ia64/wordexp.c>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5823b5780d3b8d090b31dfbfe28ff37fb97faf20

commit 5823b5780d3b8d090b31dfbfe28ff37fb97faf20
Author: Roland McGrath <roland@gnu.org>
Date:   Wed Nov 26 07:21:20 2008 +0000

    
    
    	* ChangeLog.alpha: New file (this one).
    	* sysdeps/alpha, sysdeps/unix/bsd/osf/alpha,
    	sysdeps/unix/bsd/Attic/osf1/alpha, sysdeps/unix/sysv/linux/alpha,
    	sysdeps/unix/sysv/linux/alpha/alpha, sysdeps/unix/alpha,
    	sysdeps/mach/alpha, sysdeps/mach/hurd/alpha:
    	Subdirectories moved here from main repository.
    	* sysdeps/alpha/nptl, sysdeps/unix/sysv/linux/alpha/nptl:
    	Subdirectories moved here from main repository's nptl/ subdirectory.
    	* sysdeps/alpha/preconfigure: New file.
    	* sysdeps/alpha/shlib-versions: New file.

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
new file mode 100644
index 0000000..2e101a8
--- /dev/null
+++ b/ChangeLog.alpha
@@ -0,0 +1,18 @@
+2008-11-25  Roland McGrath  <roland@redhat.com>
+
+	* ChangeLog.alpha: New file (this one).
+	* sysdeps/alpha, sysdeps/unix/bsd/osf/alpha,
+	sysdeps/unix/bsd/Attic/osf1/alpha, sysdeps/unix/sysv/linux/alpha,
+	sysdeps/unix/sysv/linux/alpha/alpha, sysdeps/unix/alpha,
+	sysdeps/mach/alpha, sysdeps/mach/hurd/alpha:
+	Subdirectories moved here from main repository.
+	* sysdeps/alpha/nptl, sysdeps/unix/sysv/linux/alpha/nptl:
+	Subdirectories moved here from main repository's nptl/ subdirectory.
+	* sysdeps/alpha/preconfigure: New file.
+	* sysdeps/alpha/shlib-versions: New file.
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+End:
diff --git a/sysdeps/alpha/preconfigure b/sysdeps/alpha/preconfigure
new file mode 100644
index 0000000..ad3dc69
--- /dev/null
+++ b/sysdeps/alpha/preconfigure
@@ -0,0 +1,3 @@
+case "$machine" in
+alpha*)		base_machine=alpha machine=alpha/$machine ;;
+esac
diff --git a/sysdeps/alpha/shlib-versions b/sysdeps/alpha/shlib-versions
new file mode 100644
index 0000000..cd4b9af
--- /dev/null
+++ b/sysdeps/alpha/shlib-versions
@@ -0,0 +1,14 @@
+alpha.*-.*-linux.*	libm=6.1
+alpha.*-.*-linux.*	libc=6.1
+
+alpha.*-.*-linux.*	ld=ld-linux.so.2
+
+alpha.*-.*-linux.*	libdl=2.1
+
+alpha.*-.*-linux.*	libutil=1.1
+
+alpha.*-.*-linux.*	libresolv=2.1
+
+alpha.*-.*-linux.*	libnsl=1.1
+alpha.*-.*-linux.*	libcrypt=1.1
+alpha.*-.*-linux.*	libBrokenLocale=1.1

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=10d461b5588149f453d8d8dc77f47355d36a5700

commit 10d461b5588149f453d8d8dc77f47355d36a5700
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Nov 25 16:45:39 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/sys/signalfd.h (signalfd): Fix
    	__THROW vs. __nonnull order for C++.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index e94e109..9bd9e04 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-11-25  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/sys/signalfd.h (signalfd): Fix
+	__THROW vs. __nonnull order for C++.
+
 2008-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Do not redefine.
diff --git a/sysdeps/unix/sysv/linux/mips/sys/signalfd.h b/sysdeps/unix/sysv/linux/mips/sys/signalfd.h
index 2fe7e37..08923c0 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/signalfd.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/signalfd.h
@@ -59,7 +59,7 @@ __BEGIN_DECLS
 /* Request notification for delivery of signals in MASK to be
    performed using descriptor FD.*/
 extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
-  __nonnull ((2)) __THROW;
+  __THROW __nonnull ((2));
 
 __END_DECLS
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9806fbba75e0103fdfcb641e72e5cdba93a717a2

commit 9806fbba75e0103fdfcb641e72e5cdba93a717a2
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Nov 25 16:37:26 2008 +0000

    	* sysdeps/unix/sysv/linux/arm/sysdep.h (LOAD_ARGS_1, LOAD_ARGS_2,
    	LOAD_ARGS_3, LOAD_ARGS_4, LOAD_ARGS_5, LOAD_ARGS_6, LOAD_ARGS_7):
    	Load all arguments into temporary variables before loading into
    	registers.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index e409001..74748f1 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,10 @@
+2008-11-25  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/sysdep.h (LOAD_ARGS_1, LOAD_ARGS_2,
+	LOAD_ARGS_3, LOAD_ARGS_4, LOAD_ARGS_5, LOAD_ARGS_6, LOAD_ARGS_7):
+	Load all arguments into temporary variables before loading into
+	registers.
+
 2008-08-19  Joseph Myers  <joseph@codesourcery.com>
 
 	* data/c++-types-arm-linux-gnueabi.data: New.
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 2952067..59ccbbc 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -238,32 +238,39 @@ __local_syscall_error:						\
 #define LOAD_ARGS_0()
 #define ASM_ARGS_0
 #define LOAD_ARGS_1(a1)				\
-  _a1 = (int) (a1);				\
-  LOAD_ARGS_0 ()
+  int _a1tmp = (int) (a1);			\
+  LOAD_ARGS_0 ()				\
+  _a1 = _a1tmp;
 #define ASM_ARGS_1	ASM_ARGS_0, "r" (_a1)
 #define LOAD_ARGS_2(a1, a2)			\
-  register int _a2 asm ("a2") = (int) (a2);	\
-  LOAD_ARGS_1 (a1)
+  int _a2tmp = (int) (a2);			\
+  LOAD_ARGS_1 (a1)				\
+  register int _a2 asm ("a2") = _a2tmp;
 #define ASM_ARGS_2	ASM_ARGS_1, "r" (_a2)
 #define LOAD_ARGS_3(a1, a2, a3)			\
-  register int _a3 asm ("a3") = (int) (a3);	\
-  LOAD_ARGS_2 (a1, a2)
+  int _a3tmp = (int) (a3);			\
+  LOAD_ARGS_2 (a1, a2)				\
+  register int _a3 asm ("a3") = _a3tmp;
 #define ASM_ARGS_3	ASM_ARGS_2, "r" (_a3)
 #define LOAD_ARGS_4(a1, a2, a3, a4)		\
-  register int _a4 asm ("a4") = (int) (a4);	\
-  LOAD_ARGS_3 (a1, a2, a3)
+  int _a4tmp = (int) (a4);			\
+  LOAD_ARGS_3 (a1, a2, a3)			\
+  register int _a4 asm ("a4") = _a4tmp;
 #define ASM_ARGS_4	ASM_ARGS_3, "r" (_a4)
 #define LOAD_ARGS_5(a1, a2, a3, a4, a5)		\
-  register int _v1 asm ("v1") = (int) (a5);	\
-  LOAD_ARGS_4 (a1, a2, a3, a4)
+  int _v1tmp = (int) (a5);			\
+  LOAD_ARGS_4 (a1, a2, a3, a4)			\
+  register int _v1 asm ("v1") = _v1tmp;
 #define ASM_ARGS_5	ASM_ARGS_4, "r" (_v1)
 #define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)	\
-  register int _v2 asm ("v2") = (int) (a6);	\
-  LOAD_ARGS_5 (a1, a2, a3, a4, a5)
+  int _v2tmp = (int) (a6);			\
+  LOAD_ARGS_5 (a1, a2, a3, a4, a5)		\
+  register int _v2 asm ("v2") = _v2tmp;
 #define ASM_ARGS_6	ASM_ARGS_5, "r" (_v2)
 #define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7)	\
-  register int _v3 asm ("v3") = (int) (a7);	\
-  LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6)
+  int _v3tmp = (int) (a7);			\
+  LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6)		\
+  register int _v3 asm ("v3") = _v3tmp;
 #define ASM_ARGS_7	ASM_ARGS_6, "r" (_v3)
 
 /* We can't implement non-constant syscalls directly since the syscall

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d7f95e85c0d88a96de9e2c9fb650d322bc647e29

commit d7f95e85c0d88a96de9e2c9fb650d322bc647e29
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Oct 23 17:11:06 2008 +0000

    Regenerated: autoconf ports/sysdeps/hppa/configure.in

diff --git a/sysdeps/hppa/configure b/sysdeps/hppa/configure
index 22a61fb..b50ec17 100644
--- a/sysdeps/hppa/configure
+++ b/sysdeps/hppa/configure
@@ -1,1609 +1,6 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
-  if (eval ":") 2>/dev/null; then
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-
-  if test $as_have_required = yes && 	 (eval ":
-(as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=\$LINENO
-  as_lineno_2=\$LINENO
-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
-  :
-else
-  as_candidate_shells=
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  case $as_dir in
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
-	   done;;
-       esac
-done
-IFS=$as_save_IFS
-
-
-      for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells that exist, to save several forks.
-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		{ ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
-  CONFIG_SHELL=$as_shell
-	       as_have_required=yes
-	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
-  (exit $1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
-  break
-fi
-
-fi
-
-      done
-
-      if test "x$CONFIG_SHELL" != x; then
-  for as_var in BASH_ENV ENV
-        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-        done
-        export CONFIG_SHELL
-        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
-    if test $as_have_required = no; then
-  echo This script requires a shell more modern than all the
-      echo shells that I found on your system.  Please install a
-      echo modern shell, or manually run the script under such a
-      echo shell if you do have one.
-      { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell autoconf@gnu.org about your system,
-  echo including any error possibly output before this
-  echo message
-}
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
-  case `echo 'x\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-    as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-        test -d "$1/.";
-      else
-	case $1 in
-        -*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias'
-ac_subst_files=''
-      ac_precious_vars='build_alias
-host_alias
-target_alias'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
-    ac_prev=
-    continue
-  fi
-
-  case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
-    datadir=$ac_optarg ;;
-
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=\$ac_optarg ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=\$ac_optarg ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=no ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    eval $ac_envvar=\$ac_optarg
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
-		datadir sysconfdir sharedstatedir localstatedir includedir \
-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
-do
-  eval ac_val=\$$ac_var
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-  esac
-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { echo "$as_me: error: Working directory cannot be determined" >&2
-   { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { echo "$as_me: error: pwd does not report name of working directory" >&2
-   { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
-   { (exit 1); exit 1; }; }
-	pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
-_ACEOF
-
-  cat <<\_ACEOF
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
-  cat <<\_ACEOF
-
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" || continue
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
-    2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-	ac_must_keep_next=false # Got value, back to normal.
-      else
-	case $ac_arg in
-	  *=* | --config-cache | -C | -disable-* | --disable-* \
-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-	  | -with-* | --with-* | -without-* | --without-* | --x)
-	    case "$ac_configure_args0 " in
-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-	    esac
-	    ;;
-	  -* ) ac_must_keep_next=true ;;
-	esac
-      fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
-      ;;
-    esac
-  done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      *) $as_unset $ac_var ;;
-      esac ;;
-    esac
-  done
-  (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      sed -n \
-	"s/'\''/'\''\\\\'\'''\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
-    *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-)
-    echo
-
-    cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      echo "$ac_var='\''$ac_val'\''"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
-      echo
-      for ac_var in $ac_subst_files
-      do
-	eval ac_val=\$$ac_var
-	case $ac_val in
-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-	esac
-	echo "$ac_var='\''$ac_val'\''"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
-      echo
-      cat confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
-  set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
-  set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
-  set x "$ac_default_prefix/share/config.site" \
-	"$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . "$cache_file";;
-      *)                      . "./$cache_file";;
-    esac
-  fi
-else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
- { echo "$as_me:$LINENO: checking for assembler line separator" >&5
+
+{ echo "$as_me:$LINENO: checking for assembler line separator" >&5
 echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6; }
 if test "${libc_cv_asm_line_sep+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=63ad0ed1d569a8e89b2e9b6202e884bc05339836

commit 63ad0ed1d569a8e89b2e9b6202e884bc05339836
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Oct 23 16:57:35 2008 +0000

    Regenerated: autoconf  ports/sysdeps/hppa/configure.in

diff --git a/sysdeps/hppa/configure b/sysdeps/hppa/configure
index bc01e46..22a61fb 100644
--- a/sysdeps/hppa/configure
+++ b/sysdeps/hppa/configure
@@ -1,7 +1,1610 @@
-# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
 
-echo "$as_me:$LINENO: checking for assembler line separator" >&5
-echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ { echo "$as_me:$LINENO: checking for assembler line separator" >&5
+echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6; }
 if test "${libc_cv_asm_line_sep+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -25,8 +1628,8 @@ else
 fi
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $libc_cv_asm_line_sep" >&5
-echo "${ECHO_T}$libc_cv_asm_line_sep" >&6
+{ echo "$as_me:$LINENO: result: $libc_cv_asm_line_sep" >&5
+echo "${ECHO_T}$libc_cv_asm_line_sep" >&6; }
 cat >>confdefs.h <<_ACEOF
 #define ASM_LINE_SEP $libc_cv_asm_line_sep
 _ACEOF

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9c482dc51db55ff376598d1fa373d27a69b1764d

commit 9c482dc51db55ff376598d1fa373d27a69b1764d
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Oct 23 16:57:15 2008 +0000

    Regenerated: autoconf  ports/sysdeps/hppa/elf/configure.in

diff --git a/sysdeps/hppa/elf/configure b/sysdeps/hppa/elf/configure
index 226c30d..ba69990 100644
--- a/sysdeps/hppa/elf/configure
+++ b/sysdeps/hppa/elf/configure
@@ -4,8 +4,8 @@
 if test "$usetls" != no; then
 # Check for support of thread-local storage handling in assembler and
 # linker.
-echo "$as_me:$LINENO: checking for hppa TLS support" >&5
-echo $ECHO_N "checking for hppa TLS support... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for hppa TLS support" >&5
+echo $ECHO_N "checking for hppa TLS support... $ECHO_C" >&6; }
 if test "${libc_cv_hppa_tls+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -52,8 +52,8 @@ else
 fi
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $libc_cv_hppa_tls" >&5
-echo "${ECHO_T}$libc_cv_hppa_tls" >&6
+{ echo "$as_me:$LINENO: result: $libc_cv_hppa_tls" >&5
+echo "${ECHO_T}$libc_cv_hppa_tls" >&6; }
 if test $libc_cv_hppa_tls = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_TLS_SUPPORT 1

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9a3d967483c9bcaf9f72a24588913cbd6d94c0ed

commit 9a3d967483c9bcaf9f72a24588913cbd6d94c0ed
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Oct 16 20:28:45 2008 +0000

    	* sysdeps/unix/sysv/linux/sys/signalfd.h (signalfd): Fix __THROW vs.
    	__nonnull order for C++.
    	* sysdeps/unix/sysv/linux/alpha/sys/signalfd.h (signalfd): Likewise.
    	* sysdeps/unix/sysv/linux/sparc/sys/signalfd.h (signalfd): Likewise.

diff --git a/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h b/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
index a820eaf..4cbe977 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
@@ -59,7 +59,7 @@ __BEGIN_DECLS
 /* Request notification for delivery of signals in MASK to be
    performed using descriptor FD.*/
 extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
-  __nonnull ((2)) __THROW;
+  __THROW __nonnull ((2));
 
 __END_DECLS
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f6e40d38942b13ae5347c52a5bc80ac23e233a21

commit f6e40d38942b13ae5347c52a5bc80ac23e233a21
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Oct 15 19:37:36 2008 +0000

    	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Do not redefine.
    	* sysdeps/mips/dl-machine.h (STO_MIPS_PLT, R_MIPS_COPY,
    	R_MIPS_JUMP_SLOT, DT_MIPS_PLTGOT): Do not redefine.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index a4f03a7..e94e109 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2008-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Do not redefine.
+	* sysdeps/mips/dl-machine.h (STO_MIPS_PLT, R_MIPS_COPY,
+	R_MIPS_JUMP_SLOT, DT_MIPS_PLTGOT): Do not redefine.
+
 2008-10-01  Mark Shinwell  <shinwell@codesourcery.com>
 	    Daniel Jacobowitz  <dan@codesourcery.com>
 	    Richard Sandiford  <rdsandiford@googlemail.com>
diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h
index 41ae000..dfd03ba 100644
--- a/sysdeps/mips/dl-dtprocnum.h
+++ b/sysdeps/mips/dl-dtprocnum.h
@@ -17,12 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* Until elf/elf.h in glibc is updated.  */
-#ifndef STO_MIPS_PLT
-# undef DT_MIPS_NUM
-# define DT_MIPS_NUM 0x35
-#endif
-
 /* Number of extra dynamic section entries for this architecture.  By
    default there are none.  */
 #define DT_THISPROCNUM	DT_MIPS_NUM
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index bca0dbe..ef088bf 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -53,14 +53,6 @@
 	".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t"
 #endif
 
-/* Until elf/elf.h in glibc is updated.  */
-#ifndef STO_MIPS_PLT
-#define STO_MIPS_PLT			0x8
-#define R_MIPS_COPY		126
-#define R_MIPS_JUMP_SLOT        127
-#define DT_MIPS_PLTGOT	     0x70000032
-#endif
-
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.
    This only makes sense on MIPS when using PLTs, so choose the
    PLT relocation (not encountered when not using PLTs).  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=63fb881a04bb46b83f95b83c3751ba9d0145e29a

commit 63fb881a04bb46b83f95b83c3751ba9d0145e29a
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Oct 1 13:28:14 2008 +0000

    2008-10-01  Mark Shinwell  <shinwell@codesourcery.com>
    	    Daniel Jacobowitz  <dan@codesourcery.com>
    	    Richard Sandiford  <rdsandiford@googlemail.com>
    
    	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Redefine.
    	* sysdeps/mips/dl-lookup.c: New.
    	* sysdeps/mips/do-lookup.h: New.
    	* sysdeps/mips/dl-machine.h (ELF_MACHINE_NO_PLT): Remove
    	definition.
    	(STO_MIPS_PLT, R_MIPS_COPY, R_MIPS_JUMP_SLOT, DT_MIPS_PLTGOT): Define
    	if needed.
    	(ELF_MACHINE_JMP_SLOT): Alter definition and update comment.
    	(elf_machine_type_class): Likewise.
    	(ELF_MACHINE_PLT_REL): Define.
    	(elf_machine_fixup_plt): New.
    	(elf_machine_plt_value): New.
    	(elf_machine_reloc): Handle jump slot and copy relocations.
    	(elf_machine_lazy_rel): Point relocation place at PLT if
    	required.
    	(RESOLVE_GOTSYM): Take a relocation type argument.
    	(elf_machine_got_rel): Bind lazy stubs directly to their target if
    	!lazy.  Skip lazy binding for PLT symbols.
    	(elf_machine_runtime_setup): Fill in .got.plt header.
    	* sysdeps/mips/dl-trampoline.c (IFNEWABI): New macro.
    	(ELF_DL_PLT_FRAME_SIZE, ELF_DL_PLT_SAVE_ARG_REGS,
    	ELF_DL_PLT_RESTORE_ARG_REGS): Define.
    	(_dl_runtime_pltresolve): New.
    	* sysdeps/mips/bits/linkmap.h: New file.
    	* sysdeps/mips/tls-macros.h: Load $gp as required.  Merge 32-bit and
    	64-bit versions.
    
    	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (SYSCALL_ERROR_LABEL):
    	Delete definition.
    	* sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h (PSEUDO_CPLOAD,
    	PSEUDO_ERRJMP, PSEUDO_SAVEGP, PSEUDO_LOADGP): Define.
    	(PSEUDO): Use them.  Move outside __PIC__.
    	(PSEUDO_JMP): New.
    	(CENABLE, CDISABLE): Use it.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 065ac68..a4f03a7 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,42 @@
+2008-10-01  Mark Shinwell  <shinwell@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+	    Richard Sandiford  <rdsandiford@googlemail.com>
+
+	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Redefine.
+	* sysdeps/mips/dl-lookup.c: New.
+	* sysdeps/mips/do-lookup.h: New.
+	* sysdeps/mips/dl-machine.h (ELF_MACHINE_NO_PLT): Remove
+	definition.
+	(STO_MIPS_PLT, R_MIPS_COPY, R_MIPS_JUMP_SLOT, DT_MIPS_PLTGOT): Define
+	if needed.
+	(ELF_MACHINE_JMP_SLOT): Alter definition and update comment.
+	(elf_machine_type_class): Likewise.
+	(ELF_MACHINE_PLT_REL): Define.
+	(elf_machine_fixup_plt): New.
+	(elf_machine_plt_value): New.
+	(elf_machine_reloc): Handle jump slot and copy relocations.
+	(elf_machine_lazy_rel): Point relocation place at PLT if
+	required.
+	(RESOLVE_GOTSYM): Take a relocation type argument.
+	(elf_machine_got_rel): Bind lazy stubs directly to their target if
+	!lazy.  Skip lazy binding for PLT symbols.
+	(elf_machine_runtime_setup): Fill in .got.plt header.
+	* sysdeps/mips/dl-trampoline.c (IFNEWABI): New macro.
+	(ELF_DL_PLT_FRAME_SIZE, ELF_DL_PLT_SAVE_ARG_REGS,
+	ELF_DL_PLT_RESTORE_ARG_REGS): Define.
+	(_dl_runtime_pltresolve): New.
+	* sysdeps/mips/bits/linkmap.h: New file.
+	* sysdeps/mips/tls-macros.h: Load $gp as required.  Merge 32-bit and
+	64-bit versions.
+
+	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (SYSCALL_ERROR_LABEL):
+	Delete definition.
+	* sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h (PSEUDO_CPLOAD,
+	PSEUDO_ERRJMP, PSEUDO_SAVEGP, PSEUDO_LOADGP): Define.
+	(PSEUDO): Use them.  Move outside __PIC__.
+	(PSEUDO_JMP): New.
+	(CENABLE, CDISABLE): Use it.
+
 2008-08-19  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: Change epoll_create2
diff --git a/sysdeps/mips/bits/linkmap.h b/sysdeps/mips/bits/linkmap.h
new file mode 100644
index 0000000..a6df782
--- /dev/null
+++ b/sysdeps/mips/bits/linkmap.h
@@ -0,0 +1,4 @@
+struct link_map_machine
+  {
+    ElfW(Addr) plt; /* Address of .plt */
+  };
diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h
index dfd03ba..41ae000 100644
--- a/sysdeps/mips/dl-dtprocnum.h
+++ b/sysdeps/mips/dl-dtprocnum.h
@@ -17,6 +17,12 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/* Until elf/elf.h in glibc is updated.  */
+#ifndef STO_MIPS_PLT
+# undef DT_MIPS_NUM
+# define DT_MIPS_NUM 0x35
+#endif
+
 /* Number of extra dynamic section entries for this architecture.  By
    default there are none.  */
 #define DT_THISPROCNUM	DT_MIPS_NUM
diff --git a/sysdeps/mips/dl-lookup.c b/sysdeps/mips/dl-lookup.c
new file mode 100644
index 0000000..015c153
--- /dev/null
+++ b/sysdeps/mips/dl-lookup.c
@@ -0,0 +1,581 @@
+/* Look up a symbol in the loaded objects.
+   MIPS/Linux version - this is identical to the common version, but
+   because it is in sysdeps/mips, it gets sysdeps/mips/do-lookup.h.
+   Using <do-lookup.h> instead of "do-lookup.h" would work too.
+
+   Copyright (C) 1995-2005, 2006, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <alloca.h>
+#include <libintl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <ldsodefs.h>
+#include <dl-hash.h>
+#include <dl-machine.h>
+#include <sysdep-cancel.h>
+#include <bits/libc-lock.h>
+#include <tls.h>
+
+#include <assert.h>
+
+#define VERSTAG(tag)	(DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (tag))
+
+/* We need this string more than once.  */
+static const char undefined_msg[] = "undefined symbol: ";
+
+
+struct sym_val
+  {
+    const ElfW(Sym) *s;
+    struct link_map *m;
+  };
+
+
+#define make_string(string, rest...) \
+  ({									      \
+    const char *all[] = { string, ## rest };				      \
+    size_t len, cnt;							      \
+    char *result, *cp;							      \
+									      \
+    len = 1;								      \
+    for (cnt = 0; cnt < sizeof (all) / sizeof (all[0]); ++cnt)		      \
+      len += strlen (all[cnt]);						      \
+									      \
+    cp = result = alloca (len);						      \
+    for (cnt = 0; cnt < sizeof (all) / sizeof (all[0]); ++cnt)		      \
+      cp = __stpcpy (cp, all[cnt]);					      \
+									      \
+    result;								      \
+  })
+
+/* Statistics function.  */
+#ifdef SHARED
+# define bump_num_relocations() ++GL(dl_num_relocations)
+#else
+# define bump_num_relocations() ((void) 0)
+#endif
+
+
+/* The actual lookup code.  */
+#include "do-lookup.h"
+
+
+static uint_fast32_t
+dl_new_hash (const char *s)
+{
+  uint_fast32_t h = 5381;
+  for (unsigned char c = *s; c != '\0'; c = *++s)
+    h = h * 33 + c;
+  return h & 0xffffffff;
+}
+
+
+/* Add extra dependency on MAP to UNDEF_MAP.  */
+static int
+internal_function
+add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
+{
+  struct link_map *runp;
+  unsigned int i;
+  int result = 0;
+
+  /* Avoid self-references and references to objects which cannot be
+     unloaded anyway.  */
+  if (undef_map == map)
+    return 0;
+
+  /* Avoid references to objects which cannot be unloaded anyway.  */
+  assert (map->l_type == lt_loaded);
+  if ((map->l_flags_1 & DF_1_NODELETE) != 0)
+    return 0;
+
+  struct link_map_reldeps *l_reldeps
+    = atomic_forced_read (undef_map->l_reldeps);
+
+  /* Make sure l_reldeps is read before l_initfini.  */
+  atomic_read_barrier ();
+
+  /* Determine whether UNDEF_MAP already has a reference to MAP.  First
+     look in the normal dependencies.  */
+  struct link_map **l_initfini = atomic_forced_read (undef_map->l_initfini);
+  if (l_initfini != NULL)
+    {
+      for (i = 0; l_initfini[i] != NULL; ++i)
+	if (l_initfini[i] == map)
+	  return 0;
+    }
+
+  /* No normal dependency.  See whether we already had to add it
+     to the special list of dynamic dependencies.  */
+  unsigned int l_reldepsact = 0;
+  if (l_reldeps != NULL)
+    {
+      struct link_map **list = &l_reldeps->list[0];
+      l_reldepsact = l_reldeps->act;
+      for (i = 0; i < l_reldepsact; ++i)
+	if (list[i] == map)
+	  return 0;
+    }
+
+  /* Save serial number of the target MAP.  */
+  unsigned long long serial = map->l_serial;
+
+  /* Make sure nobody can unload the object while we are at it.  */
+  if (__builtin_expect (flags & DL_LOOKUP_GSCOPE_LOCK, 0))
+    {
+      /* We can't just call __rtld_lock_lock_recursive (GL(dl_load_lock))
+	 here, that can result in ABBA deadlock.  */
+      THREAD_GSCOPE_RESET_FLAG ();
+      __rtld_lock_lock_recursive (GL(dl_load_lock));
+      /* While MAP value won't change, after THREAD_GSCOPE_RESET_FLAG ()
+	 it can e.g. point to unallocated memory.  So avoid the optimizer
+	 treating the above read from MAP->l_serial as ensurance it
+	 can safely dereference it.  */
+      map = atomic_forced_read (map);
+
+      /* From this point on it is unsafe to dereference MAP, until it
+	 has been found in one of the lists.  */
+
+      /* Redo the l_initfini check in case undef_map's l_initfini
+	 changed in the mean time.  */
+      if (undef_map->l_initfini != l_initfini
+	  && undef_map->l_initfini != NULL)
+	{
+	  l_initfini = undef_map->l_initfini;
+	  for (i = 0; l_initfini[i] != NULL; ++i)
+	    if (l_initfini[i] == map)
+	      goto out_check;
+	}
+
+      /* Redo the l_reldeps check if undef_map's l_reldeps changed in
+	 the mean time.  */
+      if (undef_map->l_reldeps != NULL)
+	{
+	  if (undef_map->l_reldeps != l_reldeps)
+	    {
+	      struct link_map **list = &undef_map->l_reldeps->list[0];
+	      l_reldepsact = undef_map->l_reldeps->act;
+	      for (i = 0; i < l_reldepsact; ++i)
+		if (list[i] == map)
+		  goto out_check;
+	    }
+	  else if (undef_map->l_reldeps->act > l_reldepsact)
+	    {
+	      struct link_map **list
+		= &undef_map->l_reldeps->list[0];
+	      i = l_reldepsact;
+	      l_reldepsact = undef_map->l_reldeps->act;
+	      for (; i < l_reldepsact; ++i)
+		if (list[i] == map)
+		  goto out_check;
+	    }
+	}
+    }
+  else
+    __rtld_lock_lock_recursive (GL(dl_load_lock));
+
+  /* The object is not yet in the dependency list.  Before we add
+     it make sure just one more time the object we are about to
+     reference is still available.  There is a brief period in
+     which the object could have been removed since we found the
+     definition.  */
+  runp = GL(dl_ns)[undef_map->l_ns]._ns_loaded;
+  while (runp != NULL && runp != map)
+    runp = runp->l_next;
+
+  if (runp != NULL)
+    {
+      /* The object is still available.  */
+
+      /* MAP could have been dlclosed, freed and then some other dlopened
+	 library could have the same link_map pointer.  */
+      if (map->l_serial != serial)
+	goto out_check;
+
+      /* Redo the NODELETE check, as when dl_load_lock wasn't held
+	 yet this could have changed.  */
+      if ((map->l_flags_1 & DF_1_NODELETE) != 0)
+	goto out;
+
+      /* If the object with the undefined reference cannot be removed ever
+	 just make sure the same is true for the object which contains the
+	 definition.  */
+      if (undef_map->l_type != lt_loaded
+	  || (undef_map->l_flags_1 & DF_1_NODELETE) != 0)
+	{
+	  map->l_flags_1 |= DF_1_NODELETE;
+	  goto out;
+	}
+
+      /* Add the reference now.  */
+      if (__builtin_expect (l_reldepsact >= undef_map->l_reldepsmax, 0))
+	{
+	  /* Allocate more memory for the dependency list.  Since this
+	     can never happen during the startup phase we can use
+	     `realloc'.  */
+	  struct link_map_reldeps *newp;
+	  unsigned int max
+	    = undef_map->l_reldepsmax ? undef_map->l_reldepsmax * 2 : 10;
+
+	  newp = malloc (sizeof (*newp) + max * sizeof (struct link_map *));
+	  if (newp == NULL)
+	    {
+	      /* If we didn't manage to allocate memory for the list this is
+		 no fatal problem.  We simply make sure the referenced object
+		 cannot be unloaded.  This is semantically the correct
+		 behavior.  */
+	      map->l_flags_1 |= DF_1_NODELETE;
+	      goto out;
+	    }
+	  else
+	    {
+	      if (l_reldepsact)
+		memcpy (&newp->list[0], &undef_map->l_reldeps->list[0],
+			l_reldepsact * sizeof (struct link_map *));
+	      newp->list[l_reldepsact] = map;
+	      newp->act = l_reldepsact + 1;
+	      atomic_write_barrier ();
+	      void *old = undef_map->l_reldeps;
+	      undef_map->l_reldeps = newp;
+	      undef_map->l_reldepsmax = max;
+	      if (old)
+		_dl_scope_free (old);
+	    }
+	}
+      else
+	{
+	  undef_map->l_reldeps->list[l_reldepsact] = map;
+	  atomic_write_barrier ();
+	  undef_map->l_reldeps->act = l_reldepsact + 1;
+	}
+
+      /* Display information if we are debugging.  */
+      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+	_dl_debug_printf ("\
+\nfile=%s [%lu];  needed by %s [%lu] (relocation dependency)\n\n",
+			  map->l_name[0] ? map->l_name : rtld_progname,
+			  map->l_ns,
+			  undef_map->l_name[0]
+			  ? undef_map->l_name : rtld_progname,
+			  undef_map->l_ns);
+    }
+  else
+    /* Whoa, that was bad luck.  We have to search again.  */
+    result = -1;
+
+ out:
+  /* Release the lock.  */
+  __rtld_lock_unlock_recursive (GL(dl_load_lock));
+
+  if (__builtin_expect (flags & DL_LOOKUP_GSCOPE_LOCK, 0))
+    THREAD_GSCOPE_SET_FLAG ();
+
+  return result;
+
+ out_check:
+  if (map->l_serial != serial)
+    result = -1;
+  goto out;
+}
+
+static void
+internal_function
+_dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
+		    const ElfW(Sym) **ref, struct sym_val *value,
+		    const struct r_found_version *version, int type_class,
+		    int protected);
+
+
+/* Search loaded objects' symbol tables for a definition of the symbol
+   UNDEF_NAME, perhaps with a requested version for the symbol.
+
+   We must never have calls to the audit functions inside this function
+   or in any function which gets called.  If this would happen the audit
+   code might create a thread which can throw off all the scope locking.  */
+lookup_t
+internal_function
+_dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+		     const ElfW(Sym) **ref,
+		     struct r_scope_elem *symbol_scope[],
+		     const struct r_found_version *version,
+		     int type_class, int flags, struct link_map *skip_map)
+{
+  const uint_fast32_t new_hash = dl_new_hash (undef_name);
+  unsigned long int old_hash = 0xffffffff;
+  struct sym_val current_value = { NULL, NULL };
+  struct r_scope_elem **scope = symbol_scope;
+
+  bump_num_relocations ();
+
+  /* No other flag than DL_LOOKUP_ADD_DEPENDENCY or DL_LOOKUP_GSCOPE_LOCK
+     is allowed if we look up a versioned symbol.  */
+  assert (version == NULL
+	  || (flags & ~(DL_LOOKUP_ADD_DEPENDENCY | DL_LOOKUP_GSCOPE_LOCK))
+	     == 0);
+
+  size_t i = 0;
+  if (__builtin_expect (skip_map != NULL, 0))
+    /* Search the relevant loaded objects for a definition.  */
+    while ((*scope)->r_list[i] != skip_map)
+      ++i;
+
+  /* Search the relevant loaded objects for a definition.  */
+  for (size_t start = i; *scope != NULL; start = 0, ++scope)
+    {
+      int res = do_lookup_x (undef_name, new_hash, &old_hash, *ref,
+			     &current_value, *scope, start, version, flags,
+			     skip_map, type_class);
+      if (res > 0)
+	break;
+
+      if (__builtin_expect (res, 0) < 0 && skip_map == NULL)
+	{
+	  /* Oh, oh.  The file named in the relocation entry does not
+	     contain the needed symbol.  This code is never reached
+	     for unversioned lookups.  */
+	  assert (version != NULL);
+	  const char *reference_name = undef_map ? undef_map->l_name : NULL;
+
+	  /* XXX We cannot translate the message.  */
+	  _dl_signal_cerror (0, (reference_name[0]
+				 ? reference_name
+				 : (rtld_progname ?: "<main program>")),
+			     N_("relocation error"),
+			     make_string ("symbol ", undef_name, ", version ",
+					  version->name,
+					  " not defined in file ",
+					  version->filename,
+					  " with link time reference",
+					  res == -2
+					  ? " (no version symbols)" : ""));
+	  *ref = NULL;
+	  return 0;
+	}
+    }
+
+  if (__builtin_expect (current_value.s == NULL, 0))
+    {
+      if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
+	  && skip_map == NULL)
+	{
+	  /* We could find no value for a strong reference.  */
+	  const char *reference_name = undef_map ? undef_map->l_name : "";
+	  const char *versionstr = version ? ", version " : "";
+	  const char *versionname = (version && version->name
+				     ? version->name : "");
+
+	  /* XXX We cannot translate the message.  */
+	  _dl_signal_cerror (0, (reference_name[0]
+				 ? reference_name
+				 : (rtld_progname ?: "<main program>")),
+			     N_("symbol lookup error"),
+			     make_string (undefined_msg, undef_name,
+					  versionstr, versionname));
+	}
+      *ref = NULL;
+      return 0;
+    }
+
+  int protected = (*ref
+		   && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED);
+  if (__builtin_expect (protected != 0, 0))
+    {
+      /* It is very tricky.  We need to figure out what value to
+         return for the protected symbol.  */
+      if (type_class == ELF_RTYPE_CLASS_PLT)
+	{
+	  if (current_value.s != NULL && current_value.m != undef_map)
+	    {
+	      current_value.s = *ref;
+	      current_value.m = undef_map;
+	    }
+	}
+      else
+	{
+	  struct sym_val protected_value = { NULL, NULL };
+
+	  for (scope = symbol_scope; *scope != NULL; i = 0, ++scope)
+	    if (do_lookup_x (undef_name, new_hash, &old_hash, *ref,
+			     &protected_value, *scope, i, version, flags,
+			     skip_map, ELF_RTYPE_CLASS_PLT) != 0)
+	      break;
+
+	  if (protected_value.s != NULL && protected_value.m != undef_map)
+	    {
+	      current_value.s = *ref;
+	      current_value.m = undef_map;
+	    }
+	}
+    }
+
+  /* We have to check whether this would bind UNDEF_MAP to an object
+     in the global scope which was dynamically loaded.  In this case
+     we have to prevent the latter from being unloaded unless the
+     UNDEF_MAP object is also unloaded.  */
+  if (__builtin_expect (current_value.m->l_type == lt_loaded, 0)
+      /* Don't do this for explicit lookups as opposed to implicit
+	 runtime lookups.  */
+      && (flags & DL_LOOKUP_ADD_DEPENDENCY) != 0
+      /* Add UNDEF_MAP to the dependencies.  */
+      && add_dependency (undef_map, current_value.m, flags) < 0)
+      /* Something went wrong.  Perhaps the object we tried to reference
+	 was just removed.  Try finding another definition.  */
+      return _dl_lookup_symbol_x (undef_name, undef_map, ref,
+				  (flags & DL_LOOKUP_GSCOPE_LOCK)
+				  ? undef_map->l_scope : symbol_scope,
+				  version, type_class, flags, skip_map);
+
+  /* The object is used.  */
+  current_value.m->l_used = 1;
+
+  if (__builtin_expect (GLRO(dl_debug_mask)
+			& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
+    _dl_debug_bindings (undef_name, undef_map, ref,
+			&current_value, version, type_class, protected);
+
+  *ref = current_value.s;
+  return LOOKUP_VALUE (current_value.m);
+}
+
+
+/* Cache the location of MAP's hash table.  */
+
+void
+internal_function
+_dl_setup_hash (struct link_map *map)
+{
+  Elf_Symndx *hash;
+  Elf_Symndx nchain;
+
+  if (__builtin_expect (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
+  				    + DT_THISPROCNUM + DT_VERSIONTAGNUM
+				    + DT_EXTRANUM + DT_VALNUM] != NULL, 1))
+    {
+      Elf32_Word *hash32
+	= (void *) D_PTR (map, l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
+				      + DT_THISPROCNUM + DT_VERSIONTAGNUM
+				      + DT_EXTRANUM + DT_VALNUM]);
+      map->l_nbuckets = *hash32++;
+      Elf32_Word symbias = *hash32++;
+      Elf32_Word bitmask_nwords = *hash32++;
+      /* Must be a power of two.  */
+      assert ((bitmask_nwords & (bitmask_nwords - 1)) == 0);
+      map->l_gnu_bitmask_idxbits = bitmask_nwords - 1;
+      map->l_gnu_shift = *hash32++;
+
+      map->l_gnu_bitmask = (ElfW(Addr) *) hash32;
+      hash32 += __ELF_NATIVE_CLASS / 32 * bitmask_nwords;
+
+      map->l_gnu_buckets = hash32;
+      hash32 += map->l_nbuckets;
+      map->l_gnu_chain_zero = hash32 - symbias;
+      return;
+    }
+
+  if (!map->l_info[DT_HASH])
+    return;
+  hash = (void *) D_PTR (map, l_info[DT_HASH]);
+
+  map->l_nbuckets = *hash++;
+  nchain = *hash++;
+  map->l_buckets = hash;
+  hash += map->l_nbuckets;
+  map->l_chain = hash;
+}
+
+
+static void
+internal_function
+_dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
+		    const ElfW(Sym) **ref, struct sym_val *value,
+		    const struct r_found_version *version, int type_class,
+		    int protected)
+{
+  const char *reference_name = undef_map->l_name;
+
+  if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)
+    {
+      _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
+			(reference_name[0]
+			 ? reference_name
+			 : (rtld_progname ?: "<main program>")),
+			undef_map->l_ns,
+			value->m->l_name[0] ? value->m->l_name : rtld_progname,
+			value->m->l_ns,
+			protected ? "protected" : "normal", undef_name);
+      if (version)
+	_dl_debug_printf_c (" [%s]\n", version->name);
+      else
+	_dl_debug_printf_c ("\n");
+    }
+#ifdef SHARED
+  if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
+    {
+      int conflict = 0;
+      struct sym_val val = { NULL, NULL };
+
+      if ((GLRO(dl_trace_prelink_map) == NULL
+	   || GLRO(dl_trace_prelink_map) == GL(dl_ns)[LM_ID_BASE]._ns_loaded)
+	  && undef_map != GL(dl_ns)[LM_ID_BASE]._ns_loaded)
+	{
+	  const uint_fast32_t new_hash = dl_new_hash (undef_name);
+	  unsigned long int old_hash = 0xffffffff;
+
+	  do_lookup_x (undef_name, new_hash, &old_hash, *ref, &val,
+		       undef_map->l_local_scope[0], 0, version, 0, NULL,
+		       type_class);
+
+	  if (val.s != value->s || val.m != value->m)
+	    conflict = 1;
+	}
+
+      if (value->s
+	  && (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
+				== STT_TLS, 0)))
+	type_class = 4;
+
+      if (conflict
+	  || GLRO(dl_trace_prelink_map) == undef_map
+	  || GLRO(dl_trace_prelink_map) == NULL
+	  || type_class == 4)
+	{
+	  _dl_printf ("%s 0x%0*Zx 0x%0*Zx -> 0x%0*Zx 0x%0*Zx ",
+		      conflict ? "conflict" : "lookup",
+		      (int) sizeof (ElfW(Addr)) * 2,
+		      (size_t) undef_map->l_map_start,
+		      (int) sizeof (ElfW(Addr)) * 2,
+		      (size_t) (((ElfW(Addr)) *ref) - undef_map->l_map_start),
+		      (int) sizeof (ElfW(Addr)) * 2,
+		      (size_t) (value->s ? value->m->l_map_start : 0),
+		      (int) sizeof (ElfW(Addr)) * 2,
+		      (size_t) (value->s ? value->s->st_value : 0));
+
+	  if (conflict)
+	    _dl_printf ("x 0x%0*Zx 0x%0*Zx ",
+			(int) sizeof (ElfW(Addr)) * 2,
+			(size_t) (val.s ? val.m->l_map_start : 0),
+			(int) sizeof (ElfW(Addr)) * 2,
+			(size_t) (val.s ? val.s->st_value : 0));
+
+	  _dl_printf ("/%x %s\n", type_class, undef_name);
+	}
+    }
+#endif
+}
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index 1b8d0f3..bca0dbe 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -25,8 +25,6 @@
 
 #define ELF_MACHINE_NAME "MIPS"
 
-#define ELF_MACHINE_NO_PLT
-
 #include <entry.h>
 
 #ifndef ENTRY_POINT
@@ -55,11 +53,23 @@
 	".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t"
 #endif
 
+/* Until elf/elf.h in glibc is updated.  */
+#ifndef STO_MIPS_PLT
+#define STO_MIPS_PLT			0x8
+#define R_MIPS_COPY		126
+#define R_MIPS_JUMP_SLOT        127
+#define DT_MIPS_PLTGOT	     0x70000032
+#endif
+
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.
-   This makes no sense on MIPS but we have to define this to R_MIPS_REL32
-   to avoid the asserts in dl-lookup.c from blowing.  */
-#define ELF_MACHINE_JMP_SLOT			R_MIPS_REL32
-#define elf_machine_type_class(type)		ELF_RTYPE_CLASS_PLT
+   This only makes sense on MIPS when using PLTs, so choose the
+   PLT relocation (not encountered when not using PLTs).  */
+#define ELF_MACHINE_JMP_SLOT			R_MIPS_JUMP_SLOT
+#define elf_machine_type_class(type) \
+  ((((type) == ELF_MACHINE_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)	\
+   | (((type) == R_MIPS_COPY) * ELF_RTYPE_CLASS_COPY))
+
+#define ELF_MACHINE_PLT_REL 1
 
 /* Translate a processor specific dynamic tag to the index
    in l_info array.  */
@@ -73,6 +83,15 @@ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
        (ElfW(Addr)) (r); \
    } while (0)
 
+/* Allow ABIVERSION == 1, meaning PLTs and copy relocations are
+   required.  */
+#define VALID_ELF_ABIVERSION(ver)	(ver == 0 || ver == 2)
+#define VALID_ELF_OSABI(osabi)		(osabi == ELFOSABI_SYSV)
+#define VALID_ELF_HEADER(hdr,exp,size) \
+  memcmp (hdr,exp,size-2) == 0 \
+  && VALID_ELF_OSABI (hdr[EI_OSABI]) \
+  && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
+
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int __attribute_used__
 elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
@@ -294,6 +313,24 @@ do {									\
 #  define ARCH_LA_PLTEXIT mips_n64_gnu_pltexit
 # endif
 
+/* For a non-writable PLT, rewrite the .got.plt entry at RELOC_ADDR to
+   point at the symbol with address VALUE.  For a writable PLT, rewrite
+   the corresponding PLT entry instead.  */
+static inline ElfW(Addr)
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+		       const ElfW(Rel) *reloc,
+		       ElfW(Addr) *reloc_addr, ElfW(Addr) value)
+{
+  return *reloc_addr = value;
+}
+
+static inline ElfW(Addr)
+elf_machine_plt_value (struct link_map *map, const ElfW(Rel) *reloc,
+		       ElfW(Addr) value)
+{
+  return value;
+}
+
 #endif /* !dl_machine_h */
 
 #ifdef RESOLVE_MAP
@@ -461,6 +498,57 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
 #endif
     case R_MIPS_NONE:		/* Alright, Wilbur.  */
       break;
+
+    case R_MIPS_JUMP_SLOT:
+      {
+	struct link_map *sym_map;
+	ElfW(Addr) value;
+
+	/* The addend for a jump slot relocation must always be zero:
+	   calls via the PLT always branch to the symbol's address and
+	   not to the address plus a non-zero offset.  */
+	if (r_addend != 0)
+	  _dl_signal_error (0, map->l_name, NULL,
+			    "found jump slot relocation with non-zero addend");
+
+	sym_map = RESOLVE_MAP (&sym, version, r_type);
+	value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+	*addr_field = value;
+
+	break;
+      }
+
+    case R_MIPS_COPY:
+      {
+	const ElfW(Sym) *const refsym = sym;
+	struct link_map *sym_map;
+	ElfW(Addr) value;
+
+	/* Calculate the address of the symbol.  */
+	sym_map = RESOLVE_MAP (&sym, version, r_type);
+	value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+
+	if (__builtin_expect (sym == NULL, 0))
+	  /* This can happen in trace mode if an object could not be
+	     found.  */
+	  break;
+	if (__builtin_expect (sym->st_size > refsym->st_size, 0)
+	    || (__builtin_expect (sym->st_size < refsym->st_size, 0)
+		&& GLRO(dl_verbose)))
+	  {
+	    const char *strtab;
+
+	    strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+	    _dl_error_printf ("\
+  %s: Symbol `%s' has different size in shared object, consider re-linking\n",
+			      rtld_progname ?: "<program name unknown>",
+			      strtab + refsym->st_name);
+	  }
+	memcpy (reloc_addr, (void *) value,
+	        MIN (sym->st_size, refsym->st_size));
+	break;
+      }
+
 #if _MIPS_SIM == _ABI64
     case R_MIPS_64:
       /* For full compliance with the ELF64 ABI, one must precede the
@@ -504,9 +592,23 @@ elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
 auto inline void
 __attribute__((always_inline))
 elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc)
+		      ElfW(Addr) l_addr, const ElfW(Rel) *reloc)
 {
-  /* Do nothing.  */
+  ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
+  const unsigned int r_type = ELFW(R_TYPE) (reloc->r_info);
+  /* Check for unexpected PLT reloc type.  */
+  if (__builtin_expect (r_type == R_MIPS_JUMP_SLOT, 1))
+    {
+      if (__builtin_expect (map->l_mach.plt, 0) == 0)
+	{
+	  /* Nothing is required here since we only support lazy
+	     relocation in executables.  */
+	}
+      else
+	*reloc_addr = map->l_mach.plt;
+    }
+  else
+    _dl_reloc_bad_type (map, r_type, 1);
 }
 
 auto inline void
@@ -537,13 +639,13 @@ elf_machine_got_rel (struct link_map *map, int lazy)
   const ElfW(Half) *vernum;
   int i, n, symidx;
 
-#define RESOLVE_GOTSYM(sym,vernum,sym_index)				  \
+#define RESOLVE_GOTSYM(sym,vernum,sym_index,reloc)			  \
     ({									  \
       const ElfW(Sym) *ref = sym;					  \
       const struct r_found_version *version				  \
         = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL;	  \
       struct link_map *sym_map;						  \
-      sym_map = RESOLVE_MAP (&ref, version, R_MIPS_REL32);		  \
+      sym_map = RESOLVE_MAP (&ref, version, reloc);			  \
       ref ? sym_map->l_addr + ref->st_value : 0;			  \
     })
 
@@ -584,25 +686,38 @@ elf_machine_got_rel (struct link_map *map, int lazy)
     {
       if (sym->st_shndx == SHN_UNDEF)
 	{
-	  if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC
-	      && sym->st_value && lazy)
-	    *got = sym->st_value + map->l_addr;
+	  if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC && sym->st_value
+	      && !(sym->st_other & STO_MIPS_PLT))
+	    {
+	      if (lazy)
+		*got = sym->st_value + map->l_addr;
+	      else
+		/* This is a lazy-binding stub, so we don't need the
+		   canonical address.  */
+		*got = RESOLVE_GOTSYM (sym, vernum, symidx, R_MIPS_JUMP_SLOT);
+	    }
 	  else
-	    *got = RESOLVE_GOTSYM (sym, vernum, symidx);
+	    *got = RESOLVE_GOTSYM (sym, vernum, symidx, R_MIPS_32);
 	}
       else if (sym->st_shndx == SHN_COMMON)
-	*got = RESOLVE_GOTSYM (sym, vernum, symidx);
+	*got = RESOLVE_GOTSYM (sym, vernum, symidx, R_MIPS_32);
       else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC
-	       && *got != sym->st_value
-	       && lazy)
-	*got += map->l_addr;
+	       && *got != sym->st_value)
+	{
+	  if (lazy)
+	    *got += map->l_addr;
+	  else
+	    /* This is a lazy-binding stub, so we don't need the
+	       canonical address.  */
+	    *got = RESOLVE_GOTSYM (sym, vernum, symidx, R_MIPS_JUMP_SLOT);
+	}
       else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION)
 	{
 	  if (sym->st_other == 0)
 	    *got += map->l_addr;
 	}
       else
-	*got = RESOLVE_GOTSYM (sym, vernum, symidx);
+	*got = RESOLVE_GOTSYM (sym, vernum, symidx, R_MIPS_32);
 
       ++got;
       ++sym;
@@ -623,6 +738,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 # ifndef RTLD_BOOTSTRAP
   ElfW(Addr) *got;
   extern void _dl_runtime_resolve (ElfW(Word));
+  extern void _dl_runtime_pltresolve (void);
   extern int _dl_mips_gnu_objects;
 
   if (lazy)
@@ -649,6 +765,20 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
   /* Relocate global offset table.  */
   elf_machine_got_rel (l, lazy);
 
+  /* If using PLTs, fill in the first two entries of .got.plt.  */
+  if (l->l_info[DT_JMPREL] && lazy)
+    {
+      ElfW(Addr) *gotplt;
+      gotplt = (ElfW(Addr) *) D_PTR (l, l_info[DT_MIPS (PLTGOT)]);
+      /* If a library is prelinked but we have to relocate anyway,
+	 we have to be able to undo the prelinking of .got.plt.
+	 The prelinker saved the address of .plt for us here.  */
+      if (gotplt[1])
+	l->l_mach.plt = gotplt[1] + l->l_addr;
+      gotplt[0] = (ElfW(Addr)) &_dl_runtime_pltresolve;
+      gotplt[1] = (ElfW(Addr)) l;
+    }
+
 # endif
   return lazy;
 }
diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c
index 459adf9..ff58b0d 100644
--- a/sysdeps/mips/dl-trampoline.c
+++ b/sysdeps/mips/dl-trampoline.c
@@ -200,7 +200,24 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
 	lw	$7, 28($29)\n						      \
 "
 
+/* The PLT resolver should also save and restore $2 and $3, which are used
+   as arguments to MIPS16 stub functions.  */
+#define ELF_DL_PLT_FRAME_SIZE 48
+
+#define ELF_DL_PLT_SAVE_ARG_REGS \
+	ELF_DL_SAVE_ARG_REGS "\
+	sw	$2, 40($29)\n						      \
+	sw	$3, 44($29)\n						      \
+"
+
+#define ELF_DL_PLT_RESTORE_ARG_REGS \
+	ELF_DL_RESTORE_ARG_REGS "\
+	lw	$2, 40($29)\n						      \
+	lw	$3, 44($29)\n						      \
+"
+
 #define IFABIO32(X) X
+#define IFNEWABI(X)
 
 #else /* _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 */
 
@@ -230,7 +247,24 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
 	ld	$11, 64($29)\n						      \
 "
 
+/* The PLT resolver should also save and restore $2 and $3, which are used
+   as arguments to MIPS16 stub functions.  */
+#define ELF_DL_PLT_FRAME_SIZE 96
+
+#define ELF_DL_PLT_SAVE_ARG_REGS \
+	ELF_DL_SAVE_ARG_REGS "\
+	sd	$2, 80($29)\n						      \
+	sd	$3, 88($29)\n						      \
+"
+
+#define ELF_DL_PLT_RESTORE_ARG_REGS \
+	ELF_DL_RESTORE_ARG_REGS "\
+	ld	$2, 80($29)\n						      \
+	ld	$3, 88($29)\n						      \
+"
+
 #define IFABIO32(X)
+#define IFNEWABI(X) X
 
 #endif
 
@@ -270,3 +304,56 @@ _dl_runtime_resolve:\n\
 	.end	_dl_runtime_resolve\n\
 	.previous\n\
 ");
+
+/* Assembler veneer called from the PLT header code when using PLTs.
+
+   Code in each PLT entry and the PLT header fills in the arguments to
+   this function:
+
+   - $15 (o32 t7, n32/n64 t3) - caller's return address
+   - $24 (t8) - PLT entry index
+   - $25 (t9) - address of _dl_runtime_pltresolve
+   - o32 $28 (gp), n32/n64 $14 (t2) - address of .got.plt
+
+   Different registers are used for .got.plt because the ABI was
+   originally designed for o32, where gp was available (call
+   clobbered).  On n32/n64 gp is call saved.
+
+   _dl_fixup needs:
+
+   - $4 (a0) - link map address
+   - $5 (a1) - .rel.plt offset (== PLT entry index * 8)  */
+
+asm ("\n\
+	.text\n\
+	.align	2\n\
+	.globl	_dl_runtime_pltresolve\n\
+	.type	_dl_runtime_pltresolve,@function\n\
+	.ent	_dl_runtime_pltresolve\n\
+_dl_runtime_pltresolve:\n\
+	.frame	$29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) ", $31\n\
+	.set noreorder\n\
+	# Save arguments and sp value in stack.\n\
+	" STRINGXP(PTR_SUBIU) "	$29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) "\n\
+	" IFABIO32(STRINGXP(PTR_L) "	$13, " STRINGXP(PTRSIZE) "($28)") "\n\
+	" IFNEWABI(STRINGXP(PTR_L) "	$13, " STRINGXP(PTRSIZE) "($14)") "\n\
+	# Modify t9 ($25) so as to point .cpload instruction.\n\
+	" IFABIO32(STRINGXP(PTR_ADDIU) "	$25, 12\n") "\
+	# Compute GP.\n\
+	" STRINGXP(SETUP_GP) "\n\
+	" STRINGXV(SETUP_GP64 (0, _dl_runtime_pltresolve)) "\n\
+	.set reorder\n\
+	" IFABIO32(STRINGXP(CPRESTORE(32))) "\n\
+	" ELF_DL_PLT_SAVE_ARG_REGS "\
+	move	$4, $13\n\
+	sll	$5, $24, " STRINGXP(PTRLOG) " + 1\n\
+	jal	_dl_fixup\n\
+	move	$25, $2\n\
+	" ELF_DL_PLT_RESTORE_ARG_REGS "\
+	" STRINGXP(RESTORE_GP64) "\n\
+	" STRINGXP(PTR_ADDIU) "	$29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) "\n\
+	jr	$25\n\
+	.end	_dl_runtime_pltresolve\n\
+	.previous\n\
+");
+
diff --git a/sysdeps/mips/do-lookup.h b/sysdeps/mips/do-lookup.h
new file mode 100644
index 0000000..0d92620
--- /dev/null
+++ b/sysdeps/mips/do-lookup.h
@@ -0,0 +1,37 @@
+/* MIPS-specific veneer to GLIBC's do-lookup.h.
+   Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* The semantics of zero/non-zero values of undefined symbols differs
+   depending on whether the non-PIC ABI is in use.  Under the non-PIC ABI,
+   a non-zero value indicates that there is an address reference to the
+   symbol and thus it must always be resolved (except when resolving a jump
+   slot relocation) to the PLT entry whose address is provided as the
+   symbol's value; a zero value indicates that this canonical-address
+   behaviour is not required.  Yet under the classic MIPS psABI, a zero value
+   indicates that there is an address reference to the function and the
+   dynamic linker must resolve the symbol immediately upon loading.  To
+   avoid conflict, symbols for which the dynamic linker must assume the
+   non-PIC ABI semantics are marked with the STO_MIPS_PLT flag.  The
+   following ugly hack causes the code in the platform-independent
+   do-lookup.h file to check this flag correctly.  */
+#define st_value st_shndx == SHN_UNDEF && !(sym->st_other & STO_MIPS_PLT)) \
+		 || (sym->st_value
+#include_next "do-lookup.h"
+#undef st_value
+
diff --git a/sysdeps/mips/tls-macros.h b/sysdeps/mips/tls-macros.h
index 2d0516b..8fe2e4a 100644
--- a/sysdeps/mips/tls-macros.h
+++ b/sysdeps/mips/tls-macros.h
@@ -1,44 +1,56 @@
 /* Macros to support TLS testing in times of missing compiler support.  */
 
-#if _MIPS_SIM != _ABI64
+#include <sys/cdefs.h>
+#include <sys/asm.h>
 
-/* These versions are for o32 and n32.  */
+#define __STRING2(X) __STRING(X)
+#define ADDU __STRING2(PTR_ADDU)
+#define ADDIU __STRING2(PTR_ADDIU)
+#define LW __STRING2(PTR_L)
 
-# define TLS_GD(x)					\
-  ({ void *__result;					\
-     extern void *__tls_get_addr (void *);		\
-     asm ("addiu %0, $28, %%tlsgd(" #x ")"		\
-	  : "=r" (__result));				\
-     (int *)__tls_get_addr (__result); })
+/* Load the GOT pointer, which may not be in $28 in a non-PIC
+   (abicalls pic0) function.  */
+#ifndef __PIC__
+# if _MIPS_SIM != _ABI64
+#  define LOAD_GP "move %[tmp], $28\n\tla $28, __gnu_local_gp\n\t"
+# else
+#  define LOAD_GP "move %[tmp], $28\n\tdla $28, __gnu_local_gp\n\t"
+# endif
+# define UNLOAD_GP "\n\tmove $28, %[tmp]"
 #else
+# define LOAD_GP
+# define UNLOAD_GP
+#endif
+
 # define TLS_GD(x)					\
-  ({ void *__result;					\
+  ({ void *__result, *__tmp;				\
      extern void *__tls_get_addr (void *);		\
-     asm ("daddiu %0, $28, %%tlsgd(" #x ")"		\
-	  : "=r" (__result));				\
+     asm (LOAD_GP ADDIU " %0, $28, %%tlsgd(" #x ")"	\
+	  UNLOAD_GP					\
+	  : "=r" (__result), [tmp] "=&r" (__tmp));	\
      (int *)__tls_get_addr (__result); })
-#endif
-
-#if _MIPS_SIM != _ABI64
 # define TLS_LD(x)					\
-  ({ void *__result;					\
+  ({ void *__result, *__tmp;				\
      extern void *__tls_get_addr (void *);		\
-     asm ("addiu %0, $28, %%tlsldm(" #x ")"		\
-	  : "=r" (__result));				\
+     asm (LOAD_GP ADDIU " %0, $28, %%tlsldm(" #x ")"	\
+	  UNLOAD_GP					\
+	  : "=r" (__result), [tmp] "=&r" (__tmp));	\
      __result = __tls_get_addr (__result);		\
      asm ("lui $3,%%dtprel_hi(" #x ")\n\t"		\
 	  "addiu $3,$3,%%dtprel_lo(" #x ")\n\t"		\
-	  "addu %0,%0,$3"				\
+	  ADDU " %0,%0,$3"				\
 	  : "+r" (__result) : : "$3");			\
      __result; })
 # define TLS_IE(x)					\
-  ({ void *__result;					\
+  ({ void *__result, *__tmp;				\
      asm (".set push\n\t.set mips32r2\n\t"		\
 	  "rdhwr\t%0,$29\n\t.set pop"			\
 	  : "=v" (__result));				\
-     asm ("lw $3,%%gottprel(" #x ")($28)\n\t"		\
-	  "addu %0,%0,$3"				\
-	  : "+r" (__result) : : "$3");			\
+     asm (LOAD_GP LW " $3,%%gottprel(" #x ")($28)\n\t"	\
+	  ADDU " %0,%0,$3"				\
+	  UNLOAD_GP					\
+	  : "+r" (__result), [tmp] "=&r" (__tmp)	\
+	  : : "$3");					\
      __result; })
 # define TLS_LE(x)					\
   ({ void *__result;					\
@@ -47,42 +59,6 @@
 	  : "=v" (__result));				\
      asm ("lui $3,%%tprel_hi(" #x ")\n\t"		\
 	  "addiu $3,$3,%%tprel_lo(" #x ")\n\t"		\
-	  "addu %0,%0,$3"				\
+	  ADDU " %0,%0,$3"				\
 	  : "+r" (__result) : : "$3");			\
      __result; })
-
-#else
-
-/* These versions are for n64.  */
-
-# define TLS_LD(x)					\
-  ({ void *__result;					\
-     extern void *__tls_get_addr (void *);		\
-     asm ("daddiu %0, $28, %%tlsldm(" #x ")"		\
-	  : "=r" (__result));				\
-     __result = __tls_get_addr (__result);		\
-     asm ("lui $3,%%dtprel_hi(" #x ")\n\t"		\
-	  "daddiu $3,$3,%%dtprel_lo(" #x ")\n\t"	\
-	  "daddu %0,%0,$3"				\
-	  : "+r" (__result) : : "$3");			\
-     __result; })
-# define TLS_IE(x)					\
-  ({ void *__result;					\
-     asm (".set push\n\t.set mips32r2\n\t"		\
-	  "rdhwr\t%0,$29\n\t.set pop"			\
-	  : "=v" (__result));				\
-     asm ("ld $3,%%gottprel(" #x ")($28)\n\t"		\
-	  "daddu %0,%0,$3"				\
-	  : "+r" (__result) : : "$3");			\
-     __result; })
-# define TLS_LE(x)					\
-  ({ void *__result;					\
-     asm (".set push\n\t.set mips32r2\n\t"		\
-	  "rdhwr\t%0,$29\n\t.set pop"			\
-	  : "=v" (__result));				\
-     asm ("lui $3,%%tprel_hi(" #x ")\n\t"		\
-	  "daddiu $3,$3,%%tprel_lo(" #x ")\n\t"		\
-	  "daddu %0,%0,$3"				\
-	  : "+r" (__result) : : "$3");			\
-     __result; })
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index 089fa9d..c3d59dd 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -35,15 +35,7 @@
 # define SYS_ify(syscall_name)	__NR_/**/syscall_name
 #endif
 
-#ifdef __ASSEMBLER__
-
-/* We don't want the label for the error handler to be visible in the symbol
-   table when we define it here.  */
-#ifdef __PIC__
-# define SYSCALL_ERROR_LABEL 99b
-#endif
-
-#else   /* ! __ASSEMBLER__ */
+#ifndef __ASSEMBLER__
 
 /* Define a macro which expands into the inline wrapper code for a system
    call.  */
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
index f2bf2d7..85ceff5 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
@@ -25,28 +25,38 @@
 
 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
 
-#ifdef __PIC__
+# ifdef __PIC__
+#  define PSEUDO_CPLOAD .cpload t9;
+#  define PSEUDO_ERRJMP la t9, __syscall_error; jr t9;
+#  define PSEUDO_SAVEGP sw gp, 32(sp); cfi_rel_offset (gp, 32);
+#  define PSEUDO_LOADGP lw gp, 32(sp);
+# else
+#  define PSEUDO_CPLOAD
+#  define PSEUDO_ERRJMP j __syscall_error;
+#  define PSEUDO_SAVEGP
+#  define PSEUDO_LOADGP
+# endif
+
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
       .align 2;								      \
   L(pseudo_start):							      \
       cfi_startproc;							      \
-  99: la t9,__syscall_error;						      \
-      jr t9;								      \
+  99: PSEUDO_ERRJMP							      \
   .type __##syscall_name##_nocancel, @function;				      \
   .globl __##syscall_name##_nocancel;					      \
   __##syscall_name##_nocancel:						      \
     .set noreorder;							      \
-    .cpload t9;								      \
+    PSEUDO_CPLOAD							      \
     li v0, SYS_ify(syscall_name);					      \
     syscall;								      \
     .set reorder;							      \
-    bne a3, zero, SYSCALL_ERROR_LABEL;			       		      \
+    bne a3, zero, 99b;					       		      \
     ret;								      \
   .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	      \
   ENTRY (name)								      \
     .set noreorder;							      \
-    .cpload t9;								      \
+    PSEUDO_CPLOAD							      \
     .set reorder;							      \
     SINGLE_THREAD_P(v1);						      \
     bne zero, v1, L(pseudo_cancel);					      \
@@ -54,17 +64,16 @@
     li v0, SYS_ify(syscall_name);					      \
     syscall;								      \
     .set reorder;							      \
-    bne a3, zero, SYSCALL_ERROR_LABEL;			       		      \
+    bne a3, zero, 99b;					       		      \
     ret;								      \
   L(pseudo_cancel):							      \
     SAVESTK_##args;						              \
     sw ra, 28(sp);							      \
     cfi_rel_offset (ra, 28);						      \
-    sw gp, 32(sp);							      \
-    cfi_rel_offset (gp, 32);						      \
+    PSEUDO_SAVEGP							      \
     PUSHARGS_##args;			/* save syscall args */	      	      \
     CENABLE;								      \
-    lw gp, 32(sp);							      \
+    PSEUDO_LOADGP							      \
     sw v0, 44(sp);			/* save mask */			      \
     POPARGS_##args;			/* restore syscall args */	      \
     .set noreorder;							      \
@@ -75,12 +84,12 @@
     sw a3, 40(sp);			/* save syscall error flag */	      \
     lw a0, 44(sp);			/* pass mask as arg1 */		      \
     CDISABLE;								      \
-    lw gp, 32(sp);							      \
+    PSEUDO_LOADGP							      \
     lw v0, 36(sp);			/* restore syscall result */          \
     lw a3, 40(sp);			/* restore syscall error flag */      \
     lw ra, 28(sp);			/* restore return address */	      \
     .set noreorder;							      \
-    bne a3, zero, SYSCALL_ERROR_LABEL;					      \
+    bne a3, zero, 99b;							      \
      RESTORESTK;						              \
   L(pseudo_end):							      \
     .set reorder;
@@ -88,8 +97,6 @@
 # undef PSEUDO_END
 # define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
 
-#endif
-
 # define PUSHARGS_0	/* nothing to do */
 # define PUSHARGS_1	PUSHARGS_0 sw a0, 0(sp); cfi_rel_offset (a0, 0);
 # define PUSHARGS_2	PUSHARGS_1 sw a1, 4(sp); cfi_rel_offset (a1, 4);
@@ -136,19 +143,25 @@
 # define RESTORESTK 	addu sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
 
 
+# ifdef __PIC__
 /* We use jalr rather than jal.  This means that the assembler will not
    automatically restore $gp (in case libc has multiple GOTs) so we must
    do it manually - which we have to do anyway since we don't use .cprestore.
    It also shuts up the assembler warning about not using .cprestore.  */
+#  define PSEUDO_JMP(sym) la t9, sym; jalr t9;
+# else
+#  define PSEUDO_JMP(sym) jal sym;
+# endif
+
 # ifdef IS_IN_libpthread
-#  define CENABLE	la t9, __pthread_enable_asynccancel; jalr t9;
-#  define CDISABLE	la t9, __pthread_disable_asynccancel; jalr t9;
+#  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
+#  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
 # elif defined IS_IN_librt
-#  define CENABLE	la t9, __librt_enable_asynccancel; jalr t9;
-#  define CDISABLE	la t9, __librt_disable_asynccancel; jalr t9;
+#  define CENABLE	PSEUDO_JMP (__librt_enable_asynccancel)
+#  define CDISABLE	PSEUDO_JMP (__librt_disable_asynccancel)
 # else
-#  define CENABLE	la t9, __libc_enable_asynccancel; jalr t9;
-#  define CDISABLE	la t9, __libc_disable_asynccancel; jalr t9;
+#  define CENABLE	PSEUDO_JMP (__libc_enable_asynccancel)
+#  define CDISABLE	PSEUDO_JMP (__libc_disable_asynccancel)
 # endif
 
 # ifndef __ASSEMBLER__

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a961a11ea20b9390c863fac1ea8a8b5f0c102ce1

commit a961a11ea20b9390c863fac1ea8a8b5f0c102ce1
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Aug 19 16:53:11 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: Change epoll_create2
    	to epoll_create1.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 0e6a06b..065ac68 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,10 @@
 2008-08-19  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: Change epoll_create2
+	to epoll_create1.
+
+2008-08-19  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define SOCK_CLOEXEC,
 	SOCK_NONBLOCK, PF_ISDN and AF_ISDN.
 	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: New file.
diff --git a/sysdeps/unix/sysv/linux/mips/sys/epoll.h b/sysdeps/unix/sysv/linux/mips/sys/epoll.h
index 72bed46..6d2ec8e 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/epoll.h
@@ -31,7 +31,7 @@ typedef __sigset_t sigset_t;
 #endif
 
 
-/* Flags to be passed to epoll_create2.  */
+/* Flags to be passed to epoll_create1.  */
 enum
   {
     EPOLL_CLOEXEC = 02000000,
@@ -101,8 +101,9 @@ __BEGIN_DECLS
    returned by epoll_create() should be closed with close().  */
 extern int epoll_create (int __size) __THROW;
 
-/* Same as epoll_create but with an additional FLAGS parameter.  */
-extern int epoll_create2 (int __size, int __flags) __THROW;
+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
+   parameter has been dropped.  */
+extern int epoll_create1 (int __flags) __THROW;
 
 
 /* Manipulate an epoll instance "epfd". Returns 0 in case of success,

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=72e2fdef91d3f504d91e0227e0ec98b7650d8c49

commit 72e2fdef91d3f504d91e0227e0ec98b7650d8c49
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Aug 19 16:12:35 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define SOCK_CLOEXEC,
    	SOCK_NONBLOCK, PF_ISDN and AF_ISDN.
    	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: New file.
    	* sysdeps/unix/sysv/linux/mips/sys/eventfd.h: New file.
    	* sysdeps/unix/sysv/linux/mips/sys/inotify.h: New file.
    	* sysdeps/unix/sysv/linux/mips/sys/signalfd.h: New file.
    	* sysdeps/unix/sysv/linux/mips/sys/timerfd.h: New file.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 409c2c9..0e6a06b 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,15 @@
 2008-08-19  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define SOCK_CLOEXEC,
+	SOCK_NONBLOCK, PF_ISDN and AF_ISDN.
+	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: New file.
+	* sysdeps/unix/sysv/linux/mips/sys/eventfd.h: New file.
+	* sysdeps/unix/sysv/linux/mips/sys/inotify.h: New file.
+	* sysdeps/unix/sysv/linux/mips/sys/signalfd.h: New file.
+	* sysdeps/unix/sysv/linux/mips/sys/timerfd.h: New file.
+
+2008-08-19  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/mips/fpu_control.h (_FPU_GETCW, _FPU_SETCW): Make asms
 	volatile.
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index f3adf5f..4f219d5 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -54,10 +54,20 @@ enum __socket_type
 #define SOCK_SEQPACKET SOCK_SEQPACKET
   SOCK_DCCP = 6,
 #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol.  */
-  SOCK_PACKET = 10		/* Linux specific way of getting packets
+  SOCK_PACKET = 10,		/* Linux specific way of getting packets
 				   at the dev level.  For writing rarp and
 				   other similar things on the user level. */
 #define SOCK_PACKET SOCK_PACKET
+
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of paccept.  */
+
+  SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the
+				   new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+  SOCK_NONBLOCK = 0200		/* Atomically mark descriptor(s) as
+				   non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
 };
 
 /* Protocol families.  */
@@ -92,7 +102,8 @@ enum __socket_type
 #define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
 #define	PF_IUCV		32	/* IUCV sockets.  */
 #define PF_RXRPC	33	/* RxRPC sockets.  */
-#define	PF_MAX		34	/* For now..  */
+#define PF_ISDN		34	/* mISDN sockets.  */
+#define	PF_MAX		35	/* For now..  */
 
 /* Address families.  */
 #define	AF_UNSPEC	PF_UNSPEC
@@ -126,6 +137,7 @@ enum __socket_type
 #define	AF_BLUETOOTH	PF_BLUETOOTH
 #define	AF_IUCV		PF_IUCV
 #define AF_RXRPC	PF_RXRPC
+#define AF_ISDN		PF_ISDN
 #define	AF_MAX		PF_MAX
 
 /* Socket level values.  Others are defined in the appropriate headers.
diff --git a/sysdeps/unix/sysv/linux/mips/sys/epoll.h b/sysdeps/unix/sysv/linux/mips/sys/epoll.h
new file mode 100644
index 0000000..72bed46
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sys/epoll.h
@@ -0,0 +1,143 @@
+/* Copyright (C) 2002-2006, 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_EPOLL_H
+#define	_SYS_EPOLL_H	1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Get __sigset_t.  */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+
+/* Flags to be passed to epoll_create2.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 0200
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
+
+
+enum EPOLL_EVENTS
+  {
+    EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+    EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+    EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+    EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+    EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+    EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+    EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+    EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+    EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+    EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+    EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
+    EPOLLONESHOT = (1 << 30),
+#define EPOLLONESHOT EPOLLONESHOT
+    EPOLLET = (1 << 31)
+#define EPOLLET EPOLLET
+  };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl().  */
+#define EPOLL_CTL_ADD 1	/* Add a file descriptor to the interface.  */
+#define EPOLL_CTL_DEL 2	/* Remove a file descriptor from the interface.  */
+#define EPOLL_CTL_MOD 3	/* Change file descriptor epoll_event structure.  */
+
+
+typedef union epoll_data
+{
+  void *ptr;
+  int fd;
+  uint32_t u32;
+  uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+  uint32_t events;	/* Epoll events */
+  epoll_data_t data;	/* User data variable */
+};
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance.  Returns an fd for the new instance.
+   The "size" parameter is a hint specifying the number of file
+   descriptors to be associated with the new instance.  The fd
+   returned by epoll_create() should be closed with close().  */
+extern int epoll_create (int __size) __THROW;
+
+/* Same as epoll_create but with an additional FLAGS parameter.  */
+extern int epoll_create2 (int __size, int __flags) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+   -1 in case of error ( the "errno" variable will contain the
+   specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+   constants defined above. The "fd" parameter is the target of the
+   operation. The "event" parameter describes which events the caller
+   is interested in and any associated user data.  */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+		      struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+   triggered events returned in "events" buffer. Or -1 in case of
+   error with the "errno" variable set to the specific error code. The
+   "events" parameter is a buffer that will contain triggered
+   events. The "maxevents" is the maximum number of events to be
+   returned ( usually size of "events" ). The "timeout" parameter
+   specifies the maximum wait time in milliseconds (-1 == infinite).
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+		       int __maxevents, int __timeout);
+
+
+/* Same as epoll_wait, but the thread's signal mask is temporarily
+   and atomically replaced with the one provided as parameter.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
+			int __maxevents, int __timeout,
+			__const __sigset_t *__ss);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/eventfd.h b/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
new file mode 100644
index 0000000..fa34c8c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sys/eventfd.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_EVENTFD_H
+#define	_SYS_EVENTFD_H	1
+
+#include <stdint.h>
+
+
+/* Type for event counter.  */
+typedef uint64_t eventfd_t;
+
+/* Flags for signalfd.  */
+enum
+  {
+    EFD_CLOEXEC = 02000000,
+#define EFD_CLOEXEC EFD_CLOEXEC
+    EFD_NONBLOCK = 0200
+#define EFD_NONBLOCK EFD_NONBLOCK
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for generic event channel.  Set initial
+   value to COUNT.  */
+extern int eventfd (int __count, int __flags) __THROW;
+
+/* Read event counter and possibly wait for events.  */
+extern int eventfd_read (int __fd, eventfd_t *__value);
+
+/* Increment event counter.  */
+extern int eventfd_write (int __fd, eventfd_t value);
+
+__END_DECLS
+
+#endif /* sys/eventfd.h */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/inotify.h b/sysdeps/unix/sysv/linux/mips/sys/inotify.h
new file mode 100644
index 0000000..a811c7f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sys/inotify.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 2005, 2006, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_INOTIFY_H
+#define	_SYS_INOTIFY_H	1
+
+#include <stdint.h>
+
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 02000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 0200
+#define IN_NONBLOCK IN_NONBLOCK
+  };
+
+
+/* Structure describing an inotify event.  */
+struct inotify_event
+{
+  int wd;		/* Watch descriptor.  */
+  uint32_t mask;	/* Watch mask.  */
+  uint32_t cookie;	/* Cookie to synchronize two events.  */
+  uint32_t len;		/* Length (including NULs) of name.  */
+  char name __flexarr;	/* Name.  */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.  */
+#define IN_ACCESS	 0x00000001	/* File was accessed.  */
+#define IN_MODIFY	 0x00000002	/* File was modified.  */
+#define IN_ATTRIB	 0x00000004	/* Metadata changed.  */
+#define IN_CLOSE_WRITE	 0x00000008	/* Writtable file was closed.  */
+#define IN_CLOSE_NOWRITE 0x00000010	/* Unwrittable file closed.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close.  */
+#define IN_OPEN		 0x00000020	/* File was opened.  */
+#define IN_MOVED_FROM	 0x00000040	/* File was moved from X.  */
+#define IN_MOVED_TO      0x00000080	/* File was moved to Y.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO) /* Moves.  */
+#define IN_CREATE	 0x00000100	/* Subfile was created.  */
+#define IN_DELETE	 0x00000200	/* Subfile was deleted.  */
+#define IN_DELETE_SELF	 0x00000400	/* Self was deleted.  */
+#define IN_MOVE_SELF	 0x00000800	/* Self was moved.  */
+
+/* Events sent by the kernel.  */
+#define IN_UNMOUNT	 0x00002000	/* Backing fs was unmounted.  */
+#define IN_Q_OVERFLOW	 0x00004000	/* Event queued overflowed.  */
+#define IN_IGNORED	 0x00008000	/* File was ignored.  */
+
+/* Helper events.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)	/* Close.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO)		/* Moves.  */
+
+/* Special flags.  */
+#define IN_ONLYDIR	 0x01000000	/* Only watch the path if it is a
+					   directory.  */
+#define IN_DONT_FOLLOW	 0x02000000	/* Do not follow a sym link.  */
+#define IN_MASK_ADD	 0x20000000	/* Add to the mask of an already
+					   existing watch.  */
+#define IN_ISDIR	 0x40000000	/* Event occurred against dir.  */
+#define IN_ONESHOT	 0x80000000	/* Only send event once.  */
+
+/* All events which a program can wait on.  */
+#define IN_ALL_EVENTS	 (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE  \
+			  | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM	      \
+			  | IN_MOVED_TO | IN_CREATE | IN_DELETE		      \
+			  | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init (void) __THROW;
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init1 (int __flags) __THROW;
+
+/* Add watch of object NAME to inotify instance FD.  Notify about
+   events specified by MASK.  */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+  __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD.  */
+extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/signalfd.h b/sysdeps/unix/sysv/linux/mips/sys/signalfd.h
new file mode 100644
index 0000000..2fe7e37
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sys/signalfd.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_SIGNALFD_H
+#define	_SYS_SIGNALFD_H	1
+
+#define __need_sigset_t
+#include <signal.h>
+#include <stdint.h>
+
+
+struct signalfd_siginfo
+{
+  uint32_t ssi_signo;
+  int32_t ssi_errno;
+  int32_t ssi_code;
+  uint32_t ssi_pid;
+  uint32_t ssi_uid;
+  int32_t ssi_fd;
+  uint32_t ssi_tid;
+  uint32_t ssi_band;
+  uint32_t ssi_overrun;
+  uint32_t ssi_trapno;
+  int32_t ssi_status;
+  int32_t ssi_int;
+  uint64_t ssi_ptr;
+  uint64_t ssi_utime;
+  uint64_t ssi_stime;
+  uint64_t ssi_addr;
+  uint8_t __pad[48];
+};
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 02000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 0200
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
+
+__BEGIN_DECLS
+
+/* Request notification for delivery of signals in MASK to be
+   performed using descriptor FD.*/
+extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
+  __nonnull ((2)) __THROW;
+
+__END_DECLS
+
+#endif /* sys/signalfd.h */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/timerfd.h b/sysdeps/unix/sysv/linux/mips/sys/timerfd.h
new file mode 100644
index 0000000..ebd37ff
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/sys/timerfd.h
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_TIMERFD_H
+#define	_SYS_TIMERFD_H	1
+
+#include <time.h>
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 02000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 0200
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
+enum
+  {
+    TFD_TIMER_ABSTIME = 1 << 0
+#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for new interval timer source.  */
+extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
+
+/* Set next expiration time of interval timer source UFD to UTMR.  If
+   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
+   absolute.  Optionally return the old expiration time in OTMR.  */
+extern int timerfd_settime (int __ufd, int __flags,
+			    __const struct itimerspec *__utmr,
+			    struct itimerspec *__otmr) __THROW;
+
+/* Return the next expiration time of UFD.  */
+extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timerfd.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7d6729c9db4b3a27b3b344bb2125ed16d71aaf72

commit 7d6729c9db4b3a27b3b344bb2125ed16d71aaf72
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Aug 19 16:06:38 2008 +0000

    	* sysdeps/powerpc/nofpu/shlib-versions: New.
    	* c++-types-powerpcsoft-linux-gnu.data: New.
    	* localplt-powerpcsoft-linux-gnu.data: New.
    	* sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Use
    	__fegetenv.

diff --git a/ChangeLog.powerpc b/ChangeLog.powerpc
index 463dd29..136f97a 100644
--- a/ChangeLog.powerpc
+++ b/ChangeLog.powerpc
@@ -1,3 +1,11 @@
+2008-08-19  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/powerpc/nofpu/shlib-versions: New.
+	* c++-types-powerpcsoft-linux-gnu.data: New.
+	* localplt-powerpcsoft-linux-gnu.data: New.
+	* sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Use
+	__fegetenv.
+
 2007-08-29  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/powerpc/nofpu/fsetexcptflg.c (__fesetexceptflag): Do not
diff --git a/data/c++-types-powerpcsoft-linux-gnu.data b/data/c++-types-powerpcsoft-linux-gnu.data
new file mode 100644
index 0000000..fde53bf
--- /dev/null
+++ b/data/c++-types-powerpcsoft-linux-gnu.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/data/localplt-powerpcsoft-linux-gnu.data b/data/localplt-powerpcsoft-linux-gnu.data
new file mode 100644
index 0000000..65fa5da
--- /dev/null
+++ b/data/localplt-powerpcsoft-linux-gnu.data
@@ -0,0 +1,41 @@
+libc.so: _Unwind_Find_FDE
+libc.so: __adddf3
+libc.so: __addsf3
+libc.so: __divdf3
+libc.so: __divsf3
+libc.so: __eqdf2
+libc.so: __eqsf2
+libc.so: __extendsfdf2
+libc.so: __fixdfsi
+libc.so: __fixsfsi
+libc.so: __fixunsdfsi
+libc.so: __floatsidf
+libc.so: __floatsisf
+libc.so: __floatunsidf
+libc.so: __floatunsisf
+libc.so: __gedf2
+libc.so: __gtdf2
+libc.so: __ledf2
+libc.so: __ltdf2
+libc.so: __muldf3
+libc.so: __mulsf3
+libc.so: __nedf2
+libc.so: __signbit
+libc.so: __signbitl
+libc.so: __subdf3
+libc.so: __subsf3
+libc.so: __truncdfsf2
+libc.so: __unorddf2
+libc.so: abort
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: __signbit
+libm.so: __signbitf
+libm.so: __signbitl
+libm.so: copysignl
+libm.so: fabsl
+libm.so: fegetround
+libm.so: matherr
diff --git a/sysdeps/powerpc/nofpu/feholdexcpt.c b/sysdeps/powerpc/nofpu/feholdexcpt.c
index ade9d19..4074ac0 100644
--- a/sysdeps/powerpc/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/nofpu/feholdexcpt.c
@@ -1,6 +1,6 @@
 /* Store current floating-point environment and clear exceptions
    (soft-float edition).
-   Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007, 2008 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
    This file is part of the GNU C Library.
 
@@ -28,7 +28,7 @@ feholdexcept (fenv_t *envp)
   fenv_union_t u;
 
   /* Get the current state.  */
-  fegetenv (envp);
+  __fegetenv (envp);
 
   u.fenv = *envp;
   /* Clear everything except the rounding mode.  */
diff --git a/sysdeps/powerpc/nofpu/shlib-versions b/sysdeps/powerpc/nofpu/shlib-versions
new file mode 100644
index 0000000..72085dd
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/shlib-versions
@@ -0,0 +1 @@
+powerpc.*-.*-.*		ABI			powerpcsoft-@OS@

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5de92c17d793598f429917e2520c31b45e5d6111

commit 5de92c17d793598f429917e2520c31b45e5d6111
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Aug 19 15:59:07 2008 +0000

    	* data/c++-types-arm-linux-gnueabi.data: New.
    	* data/localplt-arm-linux-gnueabi.data: New.
    	* sysdeps/arm/bsd-_setjmp.S: Use HIDDEN_JUMPTARGET to call
    	__sigsetjmp.
    	* sysdeps/arm/bsd-setjmp.S: Likewise.
    	* sysdeps/arm/eabi/aeabi_localeconv.c: Use __localeconv.
    	* sysdeps/arm/eabi/find_exidx.c (__gnu_Unwind_Find_exidx): Use
    	__dl_iterate_phdr.
    	* sysdeps/arm/eabi/setjmp.S: Add hidden_def (__sigsetjmp).
    	* sysdeps/arm/memmove.S: Use HIDDEN_JUMPTARGET to call memcpy from
    	within libc.
    	* sysdeps/arm/setjmp.S: Add hidden_def (__sigsetjmp).
    	* sysdeps/unix/sysv/linux/arm/clone.S: Use HIDDEN_JUMPTARGET to
    	call _exit.
    	* sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Use __sysctl,
    	__readlink and fgets_unlocked.
    	(_ioperm): Use __open and __close.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 5cca360..e409001 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,23 @@
+2008-08-19  Joseph Myers  <joseph@codesourcery.com>
+
+	* data/c++-types-arm-linux-gnueabi.data: New.
+	* data/localplt-arm-linux-gnueabi.data: New.
+	* sysdeps/arm/bsd-_setjmp.S: Use HIDDEN_JUMPTARGET to call
+	__sigsetjmp.
+	* sysdeps/arm/bsd-setjmp.S: Likewise.
+	* sysdeps/arm/eabi/aeabi_localeconv.c: Use __localeconv.
+	* sysdeps/arm/eabi/find_exidx.c (__gnu_Unwind_Find_exidx): Use
+	__dl_iterate_phdr.
+	* sysdeps/arm/eabi/setjmp.S: Add hidden_def (__sigsetjmp).
+	* sysdeps/arm/memmove.S: Use HIDDEN_JUMPTARGET to call memcpy from
+	within libc.
+	* sysdeps/arm/setjmp.S: Add hidden_def (__sigsetjmp).
+	* sysdeps/unix/sysv/linux/arm/clone.S: Use HIDDEN_JUMPTARGET to
+	call _exit.
+	* sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Use __sysctl,
+	__readlink and fgets_unlocked.
+	(_ioperm): Use __open and __close.
+
 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/eabi/fgetexcptflg.c: New.
diff --git a/data/c++-types-arm-linux-gnueabi.data b/data/c++-types-arm-linux-gnueabi.data
new file mode 100644
index 0000000..fde53bf
--- /dev/null
+++ b/data/c++-types-arm-linux-gnueabi.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/data/localplt-arm-linux-gnueabi.data b/data/localplt-arm-linux-gnueabi.data
new file mode 100644
index 0000000..109522e
--- /dev/null
+++ b/data/localplt-arm-linux-gnueabi.data
@@ -0,0 +1,13 @@
+libc.so: __signbit
+libc.so: calloc
+libc.so: free
+libc.so: fscanf
+libc.so: malloc
+libc.so: memalign
+libc.so: raise
+libc.so: realloc
+libm.so: __signbit
+libm.so: __signbitf
+libm.so: matherr
+libpthread.so: __errno_location
+libpthread.so: raise
diff --git a/sysdeps/arm/bsd-_setjmp.S b/sysdeps/arm/bsd-_setjmp.S
index c4a094e..c3a4383 100644
--- a/sysdeps/arm/bsd-_setjmp.S
+++ b/sysdeps/arm/bsd-_setjmp.S
@@ -1,5 +1,5 @@
 /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  ARM version.
-   Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2002, 2008 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
@@ -25,6 +25,6 @@
 
 ENTRY (_setjmp)
 	mov	r1, #0
-	b	PLTJMP(C_SYMBOL_NAME(__sigsetjmp))
+	b	PLTJMP(HIDDEN_JUMPTARGET(__sigsetjmp))
 END (_setjmp)
 libc_hidden_def (_setjmp)
diff --git a/sysdeps/arm/bsd-setjmp.S b/sysdeps/arm/bsd-setjmp.S
index d227ba6..36c571c 100644
--- a/sysdeps/arm/bsd-setjmp.S
+++ b/sysdeps/arm/bsd-setjmp.S
@@ -1,5 +1,5 @@
 /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  ARM version.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2008 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
@@ -25,5 +25,5 @@
 
 ENTRY (setjmp)
 	mov	r1, #1
-	b	PLTJMP(C_SYMBOL_NAME(__sigsetjmp))
+	b	PLTJMP(HIDDEN_JUMPTARGET(__sigsetjmp))
 END (setjmp)
diff --git a/sysdeps/arm/eabi/aeabi_localeconv.c b/sysdeps/arm/eabi/aeabi_localeconv.c
index f4e51d0..323148e 100644
--- a/sysdeps/arm/eabi/aeabi_localeconv.c
+++ b/sysdeps/arm/eabi/aeabi_localeconv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2008 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
@@ -21,5 +21,5 @@
 struct lconv *
 __aeabi_localeconv (void)
 {
-  return localeconv ();
+  return __localeconv ();
 }
diff --git a/sysdeps/arm/eabi/find_exidx.c b/sysdeps/arm/eabi/find_exidx.c
index 9e4f401..59b33de 100644
--- a/sysdeps/arm/eabi/find_exidx.c
+++ b/sysdeps/arm/eabi/find_exidx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2008 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
@@ -72,7 +72,7 @@ __gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount)
 
   data.pc = pc;
   data.exidx_start = 0;
-  if (dl_iterate_phdr (find_exidx_callback, &data) <= 0)
+  if (__dl_iterate_phdr (find_exidx_callback, &data) <= 0)
     return 0;
 
   *pcount = data.exidx_len / 8;
diff --git a/sysdeps/arm/eabi/setjmp.S b/sysdeps/arm/eabi/setjmp.S
index b7d2400..835db71 100644
--- a/sysdeps/arm/eabi/setjmp.S
+++ b/sysdeps/arm/eabi/setjmp.S
@@ -1,5 +1,5 @@
 /* setjmp for ARM.
-   Copyright (C) 1997, 1998, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2005, 2006, 2008 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
@@ -94,3 +94,4 @@ Lhwcap:
 
 END (__sigsetjmp)
 
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/arm/memmove.S b/sysdeps/arm/memmove.S
index 2dd0790..eda1bcc 100644
--- a/sysdeps/arm/memmove.S
+++ b/sysdeps/arm/memmove.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    Contributed by MontaVista Software, Inc. (written by Nicolas Pitre)
@@ -66,7 +66,11 @@ ENTRY(memmove)
 
 		subs	ip, r0, r1
 		cmphi	r2, ip
+#ifdef NOT_IN_libc
 		bls	memcpy
+#else
+		bls	HIDDEN_JUMPTARGET(memcpy)
+#endif
 
 		stmfd	sp!, {r0, r4, lr}
 		add	r1, r1, r2
diff --git a/sysdeps/arm/setjmp.S b/sysdeps/arm/setjmp.S
index 2e8c694..3fff9e9 100644
--- a/sysdeps/arm/setjmp.S
+++ b/sysdeps/arm/setjmp.S
@@ -1,5 +1,5 @@
 /* setjmp for ARM.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2008 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
@@ -29,3 +29,5 @@ ENTRY (__sigsetjmp)
 	/* Make a tail call to __sigjmp_save; it takes the same args.  */
 	B	PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
 END (__sigsetjmp)
+
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/unix/sysv/linux/arm/clone.S b/sysdeps/unix/sysv/linux/arm/clone.S
index 6c8f8e8..cfd2e7e 100644
--- a/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/sysdeps/unix/sysv/linux/arm/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2005
+/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2005, 2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Pat Beirne <patb@corelcomputer.com>
@@ -100,7 +100,7 @@ ENTRY(__clone)
 	ldr 	pc, [sp], #8
 
 	@ and we are done, passing the return value through r0
-	b	PLTJMP(_exit)
+	b	PLTJMP(HIDDEN_JUMPTARGET(_exit))
 
 PSEUDO_END (__clone)
 
diff --git a/sysdeps/unix/sysv/linux/arm/ioperm.c b/sysdeps/unix/sysv/linux/arm/ioperm.c
index 1fa849d..8af1ea3 100644
--- a/sysdeps/unix/sysv/linux/arm/ioperm.c
+++ b/sysdeps/unix/sysv/linux/arm/ioperm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2003, 2005, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Phil Blundell, based on the Alpha version by
    David Mosberger.
@@ -110,14 +110,14 @@ init_iosys (void)
   static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
   size_t len = sizeof(io.base);
 
-  if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
-      && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0))
+  if (! __sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
+      && ! __sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0))
     {
       io.initdone = 1;
       return 0;
     }
 
-  n = readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
+  n = __readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
   if (n > 0)
     {
       systype[n] = '\0';
@@ -144,7 +144,7 @@ init_iosys (void)
 	  if (n == 1)
 	    break;
 	  else
-	    fgets (systype, 256, fp);
+	    fgets_unlocked (systype, 256, fp);
 	}
       fclose (fp);
 
@@ -195,7 +195,7 @@ _ioperm (unsigned long int from, unsigned long int num, int turn_on)
 	{
 	  int fd;
 
-	  fd = open ("/dev/mem", O_RDWR);
+	  fd = __open ("/dev/mem", O_RDWR);
 	  if (fd < 0)
 	    return -1;
 
@@ -203,7 +203,7 @@ _ioperm (unsigned long int from, unsigned long int num, int turn_on)
 	    (unsigned long int) __mmap (0, MAX_PORT << io.shift,
 					PROT_READ | PROT_WRITE,
 					MAP_SHARED, fd, io.io_base);
-	  close (fd);
+	  __close (fd);
 	  if ((long) io.base == -1)
 	    return -1;
 	}

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=606c1b1771ed7673a74aa97c8f1c47c64e94e5fb

commit 606c1b1771ed7673a74aa97c8f1c47c64e94e5fb
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Aug 19 15:54:50 2008 +0000

    	* sysdeps/mips/fpu_control.h (_FPU_GETCW, _FPU_SETCW): Make asms
    	volatile.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index e7aee50..409c2c9 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-08-19  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/fpu_control.h (_FPU_GETCW, _FPU_SETCW): Make asms
+	volatile.
+
 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/bits/setjmp.h (__jmp_buf): Give name to structure
diff --git a/sysdeps/mips/fpu_control.h b/sysdeps/mips/fpu_control.h
index 5712ac5..eb71928 100644
--- a/sysdeps/mips/fpu_control.h
+++ b/sysdeps/mips/fpu_control.h
@@ -1,5 +1,6 @@
 /* FPU control word bits.  Mips version.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006, 2008
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Olaf Flebbe and Ralf Baechle.
 
@@ -100,8 +101,8 @@ extern fpu_control_t __fpu_control;
 typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
 
 /* Macros for accessing the hardware control word.  */
-#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
-#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
+#define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw))
 
 /* Default control word set at startup.  */
 extern fpu_control_t __fpu_control;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d0a39e1daf2a06bada8990e352aa890f3929df1c

commit d0a39e1daf2a06bada8990e352aa890f3929df1c
Author: Andreas Schwab <schwab@suse.de>
Date:   Sun Aug 10 08:43:09 2008 +0000

    2008-08-10  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/m68k/bits/byteswap.h: Allow inclusion from <endian.h>.
    	(__bswap_constant_16): Define.
    	(__bswap_16): Allow arguments with side effects.
    	(__bswap_constant_32): Ensure result is unsigned.
    	(__bswap_32): Define as inline function in fallback case.
    	(__bswap_constant_64): Define.
    	(__bswap_64): Use it for constant arguments.
    	* sysdeps/m68k/bits/setjmp.h (__jmp_buf): Give name to structure
    	type.
    	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Only allow inclusion
    	from <math.h>.  Do not use extern inline directly.
    	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Include <bits/uio.h>.
    	(O_CLOEXEC, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WRITE,
    	SYNC_FILE_RANGE_WAIT_AFTER, SPLICE_F_MOVE, SPLICE_F_NONBLOCK,
    	SPLICE_F_MORE, SPLICE_F_GIFT): Define.
    	(sync_file_range, vmsplice, splice, tee): Declare.
    	* sysdeps/unix/sysv/linux/m68k/bits/mman.h (MADV_REMOVE): Define.
    	* sysdeps/unix/sysv/linux/m68k/bits/poll.h (POLLMSG, POLLREMOVE,
    	POLLRDHUP): Define.
    	* sysdeps/unix/sysv/linux/m68k/bits/stat.h (UTIME_NOW,
    	UTIME_OMIT): Define.
    	* sysdeps/unix/sysv/linux/m68k/kernel-features.h: New.
    	* sysdeps/unix/sysv/linux/m68k/sys/user.h: New.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index b6aa316..c399a48 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,29 @@
+2008-08-10  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/m68k/bits/byteswap.h: Allow inclusion from <endian.h>.
+	(__bswap_constant_16): Define.
+	(__bswap_16): Allow arguments with side effects.
+	(__bswap_constant_32): Ensure result is unsigned.
+	(__bswap_32): Define as inline function in fallback case.
+	(__bswap_constant_64): Define.
+	(__bswap_64): Use it for constant arguments.
+	* sysdeps/m68k/bits/setjmp.h (__jmp_buf): Give name to structure
+	type.
+	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Only allow inclusion
+	from <math.h>.  Do not use extern inline directly.
+	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Include <bits/uio.h>.
+	(O_CLOEXEC, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WRITE,
+	SYNC_FILE_RANGE_WAIT_AFTER, SPLICE_F_MOVE, SPLICE_F_NONBLOCK,
+	SPLICE_F_MORE, SPLICE_F_GIFT): Define.
+	(sync_file_range, vmsplice, splice, tee): Declare.
+	* sysdeps/unix/sysv/linux/m68k/bits/mman.h (MADV_REMOVE): Define.
+	* sysdeps/unix/sysv/linux/m68k/bits/poll.h (POLLMSG, POLLREMOVE,
+	POLLRDHUP): Define.
+	* sysdeps/unix/sysv/linux/m68k/bits/stat.h (UTIME_NOW,
+	UTIME_OMIT): Define.
+	* sysdeps/unix/sysv/linux/m68k/kernel-features.h: New.
+	* sysdeps/unix/sysv/linux/m68k/sys/user.h: New.
+
 2008-03-28  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
 	Explicitly get address of _DYNAMIC.
diff --git a/sysdeps/m68k/bits/byteswap.h b/sysdeps/m68k/bits/byteswap.h
index 41b386b..a2546c9 100644
--- a/sysdeps/m68k/bits/byteswap.h
+++ b/sysdeps/m68k/bits/byteswap.h
@@ -1,5 +1,5 @@
 /* Macros to swap the order of bytes in integer values.  m68k version.
-   Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2002, 2008 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
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
 # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
 #endif
 
@@ -27,13 +27,25 @@
 /* Swap bytes in 16 bit value.  We don't provide an assembler version
    because GCC is smart enough to generate optimal assembler output, and
    this allows for better cse.  */
-#define __bswap_16(x) \
-  ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+#define __bswap_constant_16(x) \
+     ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+
+#ifdef __GNUC__
+# define __bswap_16(x) \
+    (__extension__							      \
+     ({ unsigned short int __bsx = (x); __bswap_constant_16 (__bsx); }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+  return __bswap_constant_16 (__bsx);
+}
+#endif
 
 /* Swap bytes in 32 bit value.  */
 #define __bswap_constant_32(x) \
-  ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) | \
-   (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
+     ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >>  8) |	      \
+      (((x) & 0x0000ff00u) <<  8) | (((x) & 0x000000ffu) << 24))
 
 #if defined __GNUC__ && __GNUC__ >= 2 && !defined(__mcoldfire__)
 # define __bswap_32(x) \
@@ -49,18 +61,38 @@
 			     : "0" ((unsigned int) (x)));	\
      __bswap_32_v; })
 #else
-# define __bswap_32(x) __bswap_constant_32 (x)
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __bswap_constant_32 (__bsx);
+}
 #endif
 
 #if defined __GNUC__ && __GNUC__ >= 2
 /* Swap bytes in 64 bit value.  */
+# define __bswap_constant_64(x) \
+     ((((x) & 0xff00000000000000ull) >> 56)				      \
+      | (((x) & 0x00ff000000000000ull) >> 40)				      \
+      | (((x) & 0x0000ff0000000000ull) >> 24)				      \
+      | (((x) & 0x000000ff00000000ull) >> 8)				      \
+      | (((x) & 0x00000000ff000000ull) << 8)				      \
+      | (((x) & 0x0000000000ff0000ull) << 24)				      \
+      | (((x) & 0x000000000000ff00ull) << 40)				      \
+      | (((x) & 0x00000000000000ffull) << 56))
+
+/* Swap bytes in 64 bit value.  */
 # define __bswap_64(x) \
   __extension__								\
   ({ union { unsigned long long int __ll;				\
 	     unsigned long int __l[2]; } __bswap_64_v, __bswap_64_r;	\
-     __bswap_64_v.__ll = (x);						\
-     __bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]);		\
-     __bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]);		\
+     if (__builtin_constant_p (x))					\
+       __bswap_64_r.__ll = __bswap_constant_64 (x);			\
+     else								\
+       {								\
+	 __bswap_64_v.__ll = (x);					\
+	 __bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]);	\
+	 __bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]);	\
+       }								\
      __bswap_64_r.__ll; })
 #endif
 
diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h
index 27ec051..b2d8b2e 100644
--- a/sysdeps/m68k/bits/setjmp.h
+++ b/sysdeps/m68k/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2005,2006,2008 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
@@ -24,7 +24,7 @@
 # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
 #endif
 
-typedef struct
+typedef struct __jmp_buf_internal_tag
   {
     /* There are eight 4-byte data registers, but D0 is not saved.  */
     long int __dregs[7];
diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index acbac47..6b69f7a 100644
--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
 /* Definitions of inline math functions implemented by the m68881/2.
-   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004
+   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,6 +18,16 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifndef __extern_inline
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE __extern_inline
+#endif
+
 #ifdef	__GNUC__
 
 #ifdef __USE_ISOC99
@@ -89,11 +99,7 @@
 # define __m81_inline		static __inline
 #else
 # define __m81_u(x)		x
-# ifdef __cplusplus
-#  define __m81_inline		__inline
-# else
-#  define __m81_inline		extern __inline
-# endif
+# define __m81_inline __MATH_INLINE
 # define __M81_MATH_INLINES	1
 #endif
 
@@ -351,14 +357,14 @@ __inline_functions (long double,l)
 /* Note that there must be no whitespace before the argument passed for
    NAME, to make token pasting work correctly with -traditional.  */
 # define __inline_forward_c(rettype, name, args1, args2)	\
-extern __inline rettype __attribute__((__const__))		\
+__MATH_INLINE rettype __attribute__((__const__))		\
   name args1							\
 {								\
   return __CONCAT(__,name) args2;				\
 }
 
 # define __inline_forward(rettype, name, args1, args2)	\
-extern __inline rettype name args1			\
+__MATH_INLINE rettype name args1			\
 {							\
   return __CONCAT(__,name) args2;			\
 }
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
index 169a24b..203d5a1 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2004, 2008 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
@@ -21,8 +21,11 @@
 # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
 #endif
 
-
 #include <sys/types.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
+
 
 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
    located on an ext2 file system */
@@ -46,6 +49,7 @@
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
 # define O_DIRECT	0200000	/* Direct disk access.	*/
 # define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
@@ -181,10 +185,55 @@ struct flock64
 # define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
 #endif
 
+
+#ifdef __USE_GNU
+/* Flags for SYNC_FILE_RANGE.  */
+# define SYNC_FILE_RANGE_WAIT_BEFORE	1 /* Wait upon writeout of all pages
+					     in the range before performing the
+					     write.  */
+# define SYNC_FILE_RANGE_WRITE		2 /* Initiate writeout of all those
+					     dirty pages in the range which are
+					     not presently under writeback.  */
+# define SYNC_FILE_RANGE_WAIT_AFTER	4 /* Wait upon writeout of all pages in
+					     the range after performing the
+					     write.  */
+
+/* Flags for SPLICE and VMSPLICE.  */
+# define SPLICE_F_MOVE		1	/* Move pages instead of copying.  */
+# define SPLICE_F_NONBLOCK	2	/* Don't block on the pipe splicing
+					   (but we may still block on the fd
+					   we splice from/to).  */
+# define SPLICE_F_MORE		4	/* Expect more data.  */
+# define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+#endif
+
 __BEGIN_DECLS
 
+#ifdef __USE_GNU
+
 /* Provide kernel hint to read ahead.  */
 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
     __THROW;
 
+
+/* Selective file content synch'ing.  */
+extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+			    unsigned int __flags);
+
+
+/* Splice address range into a pipe.  */
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+			 size_t __count, unsigned int __flags);
+
+/* Splice two files together.  */
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+		       __off64_t *__offout, size_t __len,
+		       unsigned int __flags);
+
+/* In-kernel implementation of tee for pipe buffers.  */
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+		    unsigned int __flags);
+
+#endif
+
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
index fbec1a0..ab99176 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
@@ -1,5 +1,5 @@
 /* Definitions for POSIX memory map interface.  Linux/m68k version.
-   Copyright (C) 1997, 2000, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2000, 2003, 2005, 2008 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
@@ -88,6 +88,7 @@
 # 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.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
index f7a7393..bc28579 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2008 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
@@ -35,6 +35,13 @@
 # define POLLWRBAND	0x100		/* Priority data may be written.  */
 #endif
 
+#ifdef __USE_GNU
+/* These are extensions for Linux.  */
+# define POLLMSG	0x400
+# define POLLREMOVE	0x1000
+# define POLLRDHUP	0x2000
+#endif
+
 /* Event types always implicitly polled for.  These bits need not be set in
    `events', but they will appear in `revents' to indicate the status of
    the file descriptor.  */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/sysdeps/unix/sysv/linux/m68k/bits/stat.h
index dc06b13..6b69240 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -162,3 +162,9 @@ struct stat64
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
new file mode 100644
index 0000000..9a6d23d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -0,0 +1,41 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+   Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* These features were surely available with 2.4.12.  */
+#if __LINUX_KERNEL_VERSION >= 132108
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_STAT64_SYSCALL	1
+# define __ASSUME_FCNTL64		1
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* Many syscalls were added in 2.6.10 for m68k.  */
+#if __LINUX_KERNEL_VERSION >= 132618
+# define __ASSUME_TGKILL	1
+# define __ASSUME_UTIMES	1
+# define __ASSUME_FADVISE64_64_SYSCALL	1
+#endif
+
+#include_next <kernel-features.h>
+
+/* These syscalls are not implemented yet for m68k.  */
+#undef __ASSUME_PSELECT
+#undef __ASSUME_PPOLL
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/user.h b/sysdeps/unix/sysv/linux/m68k/sys/user.h
new file mode 100644
index 0000000..f8b19fc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/sys/user.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H	1
+
+/* The whole purpose of this file is for GDB and GDB only.  Don't read
+   too much into it.  Don't use it for anything other than GDB unless
+   you know what you are doing.  */
+
+struct user_m68kfp_struct {
+	unsigned long fpregs[8*3];
+	unsigned long fpcntl[3];
+};
+
+struct user_regs_struct {
+	long d1, d2, d3, d4, d5, d6, d7;
+	long a0, a1, a2, a3, a4, a5, a6;
+	long d0;
+	long usp;
+	long orig_d0;
+	short stkadj;
+	short sr;
+	long pc;
+	short fmtvec;
+	short __fill;
+};
+
+struct user {
+	struct user_regs_struct regs;
+	int u_fpvalid;
+	struct user_m68kfp_struct m68kfp;
+	unsigned long int u_tsize;
+	unsigned long int u_dsize;
+	unsigned long int u_ssize;
+	unsigned long start_code;
+	unsigned long start_stack;
+	long int signal;
+	int reserved;
+	unsigned long u_ar0;
+	struct user_m68kfp_struct *u_fpstate;
+	unsigned long magic;
+	char u_comm[32];
+};
+
+#endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5bccf6097250f388f18eca157031497b6976b883

commit 5bccf6097250f388f18eca157031497b6976b883
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Aug 7 23:52:34 2008 +0000

    2008-08-07  Helge Deller  <deller@gmx.de>
    
    	* sysdeps/unix/sysv/linux/hppa/ucontext_i.sym: New file.
    	* sysdeps/unix/sysv/linux/hppa/Makefile: New file.
    	* sysdeps/unix/sysv/linux/hppa/getcontext.S: New file.
    	* sysdeps/unix/sysv/linux/hppa/makecontext.c: New file.
    	* sysdeps/unix/sysv/linux/hppa/setcontext.S: New file.
    	* sysdeps/unix/sysv/linux/hppa/swapcontext.c: New file.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 2a4a712..3d570db 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,12 @@
+2008-08-07  Helge Deller  <deller@gmx.de>
+
+	* sysdeps/unix/sysv/linux/hppa/ucontext_i.sym: New file.
+	* sysdeps/unix/sysv/linux/hppa/Makefile: New file.
+	* sysdeps/unix/sysv/linux/hppa/getcontext.S: New file.
+	* sysdeps/unix/sysv/linux/hppa/makecontext.c: New file.
+	* sysdeps/unix/sysv/linux/hppa/setcontext.S: New file.
+	* sysdeps/unix/sysv/linux/hppa/swapcontext.c: New file.
+
 2008-06-17  Aurelian Jarno  <aurelien@aurel32.net>
 	    Carlos O'Donell  <carlos@systemhalted.org>
 
diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile
new file mode 100644
index 0000000..4c3a114
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/Makefile
@@ -0,0 +1,5 @@
+# Used by *context() functions
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
diff --git a/sysdeps/unix/sysv/linux/hppa/getcontext.S b/sysdeps/unix/sysv/linux/hppa/getcontext.S
new file mode 100644
index 0000000..f88fa03
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/getcontext.S
@@ -0,0 +1,163 @@
+/* Get current user context.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Helge Deller <deller@gmx.de>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+#include "ucontext_i.h"
+
+
+	/* Trampoline function.  */
+	/* Can not use ENTRY(__getcontext_ret) here.  */
+	.type	__getcontext_ret, @function
+	.hidden	__getcontext_ret
+__getcontext_ret:
+	.proc
+	.callinfo FRAME=0,NO_CALLS
+	copy	%r23, %r3
+	copy	%r24, %r4
+	copy	%r25, %r5
+	copy	%r26, %r6
+	bv	0(%r20)
+	copy	%r0, %ret0
+	.procend
+	.size	__getcontext_ret, .-__getcontext_ret
+
+
+ENTRY(__getcontext)
+	/* Save the registers.  */
+	stw	%r0, oR0(%r26)
+	stw	%r1, oR1(%r26)
+	/* stw	%r2, oR2(%r26) - used for trampoline.  */
+	stw	%r3, oR3(%r26)
+	stw	%r4, oR4(%r26)
+	stw	%r5, oR5(%r26)
+	stw	%r6, oR6(%r26)
+	stw	%r7, oR7(%r26)
+	stw	%r8, oR8(%r26)
+	stw	%r9, oR9(%r26)
+	stw	%r10, oR10(%r26)
+	stw	%r11, oR11(%r26)
+	stw	%r12, oR12(%r26)
+	stw	%r13, oR13(%r26)
+	stw	%r14, oR14(%r26)
+	stw	%r15, oR15(%r26)
+	stw	%r16, oR16(%r26)
+	stw	%r17, oR17(%r26)
+	stw	%r18, oR18(%r26)
+	stw	%r19, oR19(%r26)
+	/* stw	%r20, oR20(%r26) - used for trampoline.  */
+	stw	%r21, oR21(%r26)
+	stw	%r22, oR22(%r26)
+	/* stw	%r23, oR23(%r26) - used for trampoline.  */
+	/* stw	%r24, oR24(%r26) - used for trampoline.  */
+	/* stw	%r25, oR25(%r26) - used for trampoline.  */
+	/* stw	%r26, oR26(%r26) - used for trampoline.  */
+	stw	%r27, oR27(%r26)
+	stw	%r28, oR28(%r26)
+	stw	%r29, oR29(%r26)
+	ldo	-64(%sp), %r1	/* Calculate %sp in %r1.  */
+	stw	%r1, oR30(%r26)	/* Save new %sp.  */
+	stw	%r31, oR31(%r26)
+
+	stw	%r0, oUC_FLAGS(%r26)
+	/* stw	%r0, oUC_LINK(%r26) - Do not overwrite.  */
+	stw	%r1, oSS_SP(%r26)
+	stw	%r0, oSS_FLAGS(%r26)
+	stw	%r0, oSS_SIZE(%r26)
+
+	stw	%r0, oSC_FLAGS(%r26)
+
+	stw	%r0, oIASQ0(%r26)
+	stw	%r0, oIASQ1(%r26)
+	stw	%r0, oIAOQ0(%r26)
+	stw	%r0, oIAOQ1(%r26)
+	stw	%r0, oSAR(%r26) /* used as flag in swapcontext().  */
+
+
+	/* Store floating-point regs.  */
+	ldo	oFPREGS0(%r26),%r1
+	fstds,ma %fr0, 8(%r1)
+	fstds,ma %fr1, 8(%r1)
+	fstds,ma %fr2, 8(%r1)
+	fstds,ma %fr3, 8(%r1)
+	fstds,ma %fr4, 8(%r1)
+	fstds,ma %fr5, 8(%r1)
+	fstds,ma %fr6, 8(%r1)
+	fstds,ma %fr7, 8(%r1)
+	fstds,ma %fr8, 8(%r1)
+	fstds,ma %fr9, 8(%r1)
+	fstds,ma %fr10, 8(%r1)
+	fstds,ma %fr11, 8(%r1)
+	fstds,ma %fr12, 8(%r1)
+	fstds,ma %fr13, 8(%r1)
+	fstds,ma %fr14, 8(%r1)
+	fstds,ma %fr15, 8(%r1)
+	fstds,ma %fr16, 8(%r1)
+	fstds,ma %fr17, 8(%r1)
+	fstds,ma %fr18, 8(%r1)
+	fstds,ma %fr19, 8(%r1)
+	fstds,ma %fr20, 8(%r1)
+	fstds,ma %fr21, 8(%r1)
+	fstds,ma %fr22, 8(%r1)
+	fstds,ma %fr23, 8(%r1)
+	fstds,ma %fr24, 8(%r1)
+	fstds,ma %fr25, 8(%r1)
+	fstds,ma %fr26, 8(%r1)
+	fstds,ma %fr27, 8(%r1)
+	fstds,ma %fr28, 8(%r1)
+	fstds,ma %fr29, 8(%r1)
+	fstds,ma %fr30, 8(%r1)
+	fstds	 %fr31, 0(%r1)
+
+	/* Prologue */
+	stwm	%r4, 64(%r30)
+#ifdef PIC
+	stw	%r19, -32(%r30)
+#endif
+
+	/* Set up the trampoline registers.
+	   r20, r23, r24, r25, r26 and r2 are clobbered
+	   by call to getcontext() anyway. Reuse them.  */
+	stw	%r2, oR20(%r26)
+	stw	%r3, oR23(%r26)
+	stw	%r4, oR24(%r26)
+	stw	%r5, oR25(%r26)
+	stw	%r6, oR26(%r26)
+	ldil	L%__getcontext_ret, %r1
+	ldo     R%__getcontext_ret(%r1), %r1
+	stw	%r1, oR2(%r26)
+
+	/* Save the current signal mask.  */
+	/* sigprocmask(SIG_BLOCK, NULL, &ucp->uc_sigmask);  */
+	ldo	oSIGMASK(%r26), %r24
+	copy	%r0, %r25
+	bl	sigprocmask, %r2
+	ldi	SIG_BLOCK, %r26
+
+	/* Epilogue */
+	ldw	-84(%r30), %r2
+#ifdef PIC
+	ldw	-96(%r30), %r19
+#endif
+	bv	%r0(%r2)
+	ldwm	-64(%r30), %r4
+END(__getcontext)
+
+weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/hppa/makecontext.c b/sysdeps/unix/sysv/linux/hppa/makecontext.c
new file mode 100644
index 0000000..69a1813
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/makecontext.c
@@ -0,0 +1,79 @@
+/* Create new context.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Helge Deller <deller@gmx.de>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <libintl.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sysdep.h>
+#include <ucontext.h>
+
+/* XXX: This implementation only handles integer arguments.  */
+
+void
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
+{
+  unsigned int *sp;
+  va_list ap;
+  int i;
+
+  if (argc > 8)
+    {
+      fprintf (stderr, _("\
+makecontext: does not know how to handle more than 8 arguments\n"));
+      exit (-1);
+    }
+
+  /* Get stack pointer.  */
+  sp = (unsigned int *) ucp->uc_stack.ss_sp;
+
+  /* Store address to jump to.  */
+  ucp->uc_mcontext.sc_gr[2] = (unsigned long) func;
+
+  va_start (ap, argc);
+  /* Handle arguments.  */
+  for (i = 0; i < argc; ++i)
+    switch (i)
+      {
+      case 0:
+      case 1:
+      case 2:
+      case 3:
+      	ucp->uc_mcontext.sc_gr[26-i] = va_arg (ap, int);
+	break;
+      case 4:
+      case 5:
+      case 6:
+      case 7:
+	if (sizeof(unsigned long) == 4) {
+		/* 32bit: put arg7-arg4 on stack.  */
+		sp[7-i] = va_arg (ap, int);
+	} else {
+		/* 64bit: r19-r22 are arg7-arg4.  */
+		ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int);
+	}
+	break;
+      }
+  va_end (ap);
+
+}
+
+
+weak_alias(__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/hppa/setcontext.S b/sysdeps/unix/sysv/linux/hppa/setcontext.S
new file mode 100644
index 0000000..43ccf24
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/setcontext.S
@@ -0,0 +1,154 @@
+/* Install given context.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Helge Deller <deller@gmx.de>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+#include "ucontext_i.h"
+
+
+ENTRY(__setcontext)
+	/* Prologue */
+	stwm	%r3, 64(%r30)
+#ifdef PIC
+	stw	%r19, -32(%r30)
+#endif
+
+	/* Save ucp.  */
+	copy	%r26, %r3
+
+.Lagain:
+	/* Set the current signal mask.  */
+	/* sigprocmask(SIG_BLOCK, &ucp->uc_sigmask, NULL);  */
+	copy	%r0, %r24
+	ldo	oSIGMASK(%r3), %r25
+	bl	sigprocmask, %r2
+	ldi	SIG_SETMASK, %r26
+
+	comib,<>,n 0,%ret0,.Lerror
+
+	/* Save %sp, %dp.  */
+	copy	%sp, %r4
+	copy	%dp, %r5
+	copy	%r19, %r6
+
+	/* Get the registers.  */
+	ldw	oR1(%r3), %r1
+	ldw	oR2(%r3), %r2
+	/* ldw	oR3(%r3), %r3 - used for ucp pointer.	*/
+	/* ldw	oR4(%r3), %r4 - used for original %sp.	*/
+	/* ldw	oR5(%r3), %r5 - used for %dp / %r27.	*/
+	/* ldw	oR6(%r3), %r6 - used for %r19.		*/
+	ldw	oR7(%r3), %r7
+	ldw	oR8(%r3), %r8
+	ldw	oR9(%r3), %r9
+	ldw	oR10(%r3), %r10
+	ldw	oR11(%r3), %r11
+	ldw	oR12(%r3), %r12
+	ldw	oR13(%r3), %r13
+	ldw	oR14(%r3), %r14
+	ldw	oR15(%r3), %r15
+	ldw	oR16(%r3), %r16
+	ldw	oR17(%r3), %r17
+	ldw	oR18(%r3), %r18
+	ldw	oR19(%r3), %r19
+	ldw	oR20(%r3), %r20
+	ldw	oR21(%r3), %r21
+	/* ldw	oR22(%r3), %r22 - dyncall arg.  */
+	ldw	oR23(%r3), %r23
+	ldw	oR24(%r3), %r24
+	ldw	oR25(%r3), %r25
+	ldw	oR26(%r3), %r26
+	ldw	oR27(%r3), %r27
+	ldw	oR28(%r3), %r28
+	ldw	oR29(%r3), %r29
+	ldw	oR30(%r3), %r30
+	/* ldw	oR31(%r3), %r31 - dyncall scratch register */
+
+	/* Restore floating-point registers.  */
+	ldo	 oFPREGS31(%r3), %r22
+	fldds	  0(%r22), %fr31
+	fldds,mb -8(%r22), %fr30
+	fldds,mb -8(%r22), %fr29
+	fldds,mb -8(%r22), %fr28
+	fldds,mb -8(%r22), %fr27
+	fldds,mb -8(%r22), %fr26
+	fldds,mb -8(%r22), %fr25
+	fldds,mb -8(%r22), %fr24
+	fldds,mb -8(%r22), %fr23
+	fldds,mb -8(%r22), %fr22
+	fldds,mb -8(%r22), %fr21
+	fldds,mb -8(%r22), %fr20
+	fldds,mb -8(%r22), %fr19
+	fldds,mb -8(%r22), %fr18
+	fldds,mb -8(%r22), %fr17
+	fldds,mb -8(%r22), %fr16
+	fldds,mb -8(%r22), %fr15
+	fldds,mb -8(%r22), %fr14
+	fldds,mb -8(%r22), %fr13
+	fldds,mb -8(%r22), %fr12
+	fldds,mb -8(%r22), %fr11
+	fldds,mb -8(%r22), %fr10
+	fldds,mb -8(%r22), %fr9
+	fldds,mb -8(%r22), %fr8
+	fldds,mb -8(%r22), %fr7
+	fldds,mb -8(%r22), %fr6
+	fldds,mb -8(%r22), %fr5
+	fldds,mb -8(%r22), %fr4
+	fldds,mb -8(%r22), %fr3
+	fldds,mb -8(%r22), %fr2
+	fldds,mb -8(%r22), %fr1
+	fldds,mb -8(%r22), %fr0
+
+	/* Calculate new stack pointer.  */
+	ldw	oSS_SP(%r3), %sp
+	ldo	64(%sp), %sp
+
+	/* Call external function.  */
+	copy	%r2, %r22
+	bl	$$dyncall, %r31
+	copy	%r31, %r2
+
+	/* We return here. Get new ucp in %r3, reload %sp.  */
+	ldw	oUC_LINK(%r3), %r3
+	copy	%r4, %sp
+	copy	%r5, %dp
+	copy	%r6, %r19
+
+	/* Continue until ucp == NULL.  */
+	comib,<> 0,%r3,.Lagain
+	nop
+
+	/* No further context available. Exit now.  */
+	bl	_exit, %r2
+	ldi	-1, %r26
+	
+
+.Lerror:
+	/* Epilogue */
+	ldw	-84(%r30), %r2
+#ifdef PIC
+	ldw	-96(%r30), %r19
+#endif
+	bv	%r0(%r2)
+	ldwm	-64(%r30), %r3
+L(pseudo_end):
+PSEUDO_END(__setcontext)
+
+weak_alias(__setcontext, setcontext)
diff --git a/sysdeps/unix/sysv/linux/hppa/swapcontext.c b/sysdeps/unix/sysv/linux/hppa/swapcontext.c
new file mode 100644
index 0000000..8b33173
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/swapcontext.c
@@ -0,0 +1,43 @@
+/* Swap to new context.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Helge Deller <deller@gmx.de>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <ucontext.h>
+
+extern int __getcontext (ucontext_t *ucp);
+extern int __setcontext (const ucontext_t *ucp);
+
+int
+__swapcontext (ucontext_t *oucp, const ucontext_t *ucp)
+{
+  /* Save the current machine context to oucp.  */
+  __getcontext (oucp);
+
+  /* mark sc_sar flag to skip the setcontext call on reactivation.  */
+  if (oucp->uc_mcontext.sc_sar == 0) {
+  	oucp->uc_mcontext.sc_sar++;
+
+	/* Restore the machine context in ucp.  */
+  	__setcontext (ucp);
+  }
+
+  return 0;
+}
+
+weak_alias (__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/hppa/ucontext_i.sym b/sysdeps/unix/sysv/linux/hppa/ucontext_i.sym
new file mode 100644
index 0000000..ee33029
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/ucontext_i.sym
@@ -0,0 +1,59 @@
+#include <stddef.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+--
+
+SIG_BLOCK
+SIG_SETMASK
+
+#define ucontext(member)	offsetof (ucontext_t, member)
+#define mcontext(member)	ucontext (uc_mcontext.member)
+#define mreg(reg)		mcontext (sc_gr[reg])
+
+oUC_FLAGS	ucontext (uc_flags)
+oUC_LINK	ucontext (uc_link)
+oSS_SP		ucontext (uc_stack.ss_sp)
+oSS_FLAGS	ucontext (uc_stack.ss_flags)
+oSS_SIZE	ucontext (uc_stack.ss_size)
+oSC_FLAGS	mcontext (sc_flags)
+oR0		mreg (0)
+oR1		mreg (1)
+oR2		mreg (2)
+oR3		mreg (3)
+oR4		mreg (4)
+oR5		mreg (5)
+oR6		mreg (6)
+oR7		mreg (7)
+oR8		mreg (8)
+oR9		mreg (9)
+oR10		mreg (10)
+oR11		mreg (11)
+oR12		mreg (12)
+oR13		mreg (13)
+oR14		mreg (14)
+oR15		mreg (15)
+oR16		mreg (16)
+oR17		mreg (17)
+oR18		mreg (18)
+oR19		mreg (19)
+oR20		mreg (20)
+oR21		mreg (21)
+oR22		mreg (22)
+oR23		mreg (23)
+oR24		mreg (24)
+oR25		mreg (25)
+oR26		mreg (26)
+oR27		mreg (27)
+oR28		mreg (28)
+oR29		mreg (29)
+oR30		mreg (30)
+oR31		mreg (31)
+oFPREGS0	mcontext (sc_fr[0])
+oFPREGS31	mcontext (sc_fr[31])
+oIASQ0		mcontext (sc_iasq[0])
+oIASQ1		mcontext (sc_iasq[1])
+oIAOQ0		mcontext (sc_iaoq[0])
+oIAOQ1		mcontext (sc_iaoq[1])
+oSAR		mcontext (sc_sar)
+oSIGMASK	ucontext (uc_sigmask)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3428a1a18438ea3c3df78d7520d81e55b8f712fb

commit 3428a1a18438ea3c3df78d7520d81e55b8f712fb
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jul 25 04:44:10 2008 +0000

    timerfd.h header for Linux/Alpha.

diff --git a/sysdeps/unix/sysv/linux/alpha/sys/timerfd.h b/sysdeps/unix/sysv/linux/alpha/sys/timerfd.h
new file mode 100644
index 0000000..09d6ccf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/sys/timerfd.h
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_TIMERFD_H
+#define	_SYS_TIMERFD_H	1
+
+#include <time.h>
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 010000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 04
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
+enum
+  {
+    TFD_TIMER_ABSTIME = 1 << 0
+#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for new interval timer source.  */
+extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
+
+/* Set next expiration time of interval timer source UFD to UTMR.  If
+   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
+   absolute.  Optionally return the old expiration time in OTMR.  */
+extern int timerfd_settime (int __ufd, int __flags,
+			    __const struct itimerspec *__utmr,
+			    struct itimerspec *__otmr) __THROW;
+
+/* Return the next expiration time of UFD.  */
+extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timerfd.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0cf15c596cce00d9b6270d03791ff6502d379349

commit 0cf15c596cce00d9b6270d03791ff6502d379349
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jul 25 04:44:03 2008 +0000

    signalfd.h header for Linux/Alpha.

diff --git a/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h b/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
new file mode 100644
index 0000000..a820eaf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/sys/signalfd.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_SIGNALFD_H
+#define	_SYS_SIGNALFD_H	1
+
+#define __need_sigset_t
+#include <signal.h>
+#include <stdint.h>
+
+
+struct signalfd_siginfo
+{
+  uint32_t ssi_signo;
+  int32_t ssi_errno;
+  int32_t ssi_code;
+  uint32_t ssi_pid;
+  uint32_t ssi_uid;
+  int32_t ssi_fd;
+  uint32_t ssi_tid;
+  uint32_t ssi_band;
+  uint32_t ssi_overrun;
+  uint32_t ssi_trapno;
+  int32_t ssi_status;
+  int32_t ssi_int;
+  uint64_t ssi_ptr;
+  uint64_t ssi_utime;
+  uint64_t ssi_stime;
+  uint64_t ssi_addr;
+  uint8_t __pad[48];
+};
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 010000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 04
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
+
+__BEGIN_DECLS
+
+/* Request notification for delivery of signals in MASK to be
+   performed using descriptor FD.*/
+extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
+  __nonnull ((2)) __THROW;
+
+__END_DECLS
+
+#endif /* sys/signalfd.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=306d70cc922dff084691356623f30d076e5b2f26

commit 306d70cc922dff084691356623f30d076e5b2f26
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jul 25 04:43:59 2008 +0000

    inotify.h header for Linux/Alpha.

diff --git a/sysdeps/unix/sysv/linux/alpha/sys/inotify.h b/sysdeps/unix/sysv/linux/alpha/sys/inotify.h
new file mode 100644
index 0000000..d61c700
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/sys/inotify.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 2005, 2006, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_INOTIFY_H
+#define	_SYS_INOTIFY_H	1
+
+#include <stdint.h>
+
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 010000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 04
+#define IN_NONBLOCK IN_NONBLOCK
+  };
+
+
+/* Structure describing an inotify event.  */
+struct inotify_event
+{
+  int wd;		/* Watch descriptor.  */
+  uint32_t mask;	/* Watch mask.  */
+  uint32_t cookie;	/* Cookie to synchronize two events.  */
+  uint32_t len;		/* Length (including NULs) of name.  */
+  char name __flexarr;	/* Name.  */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.  */
+#define IN_ACCESS	 0x00000001	/* File was accessed.  */
+#define IN_MODIFY	 0x00000002	/* File was modified.  */
+#define IN_ATTRIB	 0x00000004	/* Metadata changed.  */
+#define IN_CLOSE_WRITE	 0x00000008	/* Writtable file was closed.  */
+#define IN_CLOSE_NOWRITE 0x00000010	/* Unwrittable file closed.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close.  */
+#define IN_OPEN		 0x00000020	/* File was opened.  */
+#define IN_MOVED_FROM	 0x00000040	/* File was moved from X.  */
+#define IN_MOVED_TO      0x00000080	/* File was moved to Y.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO) /* Moves.  */
+#define IN_CREATE	 0x00000100	/* Subfile was created.  */
+#define IN_DELETE	 0x00000200	/* Subfile was deleted.  */
+#define IN_DELETE_SELF	 0x00000400	/* Self was deleted.  */
+#define IN_MOVE_SELF	 0x00000800	/* Self was moved.  */
+
+/* Events sent by the kernel.  */
+#define IN_UNMOUNT	 0x00002000	/* Backing fs was unmounted.  */
+#define IN_Q_OVERFLOW	 0x00004000	/* Event queued overflowed.  */
+#define IN_IGNORED	 0x00008000	/* File was ignored.  */
+
+/* Helper events.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)	/* Close.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO)		/* Moves.  */
+
+/* Special flags.  */
+#define IN_ONLYDIR	 0x01000000	/* Only watch the path if it is a
+					   directory.  */
+#define IN_DONT_FOLLOW	 0x02000000	/* Do not follow a sym link.  */
+#define IN_MASK_ADD	 0x20000000	/* Add to the mask of an already
+					   existing watch.  */
+#define IN_ISDIR	 0x40000000	/* Event occurred against dir.  */
+#define IN_ONESHOT	 0x80000000	/* Only send event once.  */
+
+/* All events which a program can wait on.  */
+#define IN_ALL_EVENTS	 (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE  \
+			  | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM	      \
+			  | IN_MOVED_TO | IN_CREATE | IN_DELETE		      \
+			  | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init (void) __THROW;
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init1 (int __flags) __THROW;
+
+/* Add watch of object NAME to inotify instance FD.  Notify about
+   events specified by MASK.  */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+  __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD.  */
+extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b0ad350d1b5fbffe9935b68a83b30bae5bc8efec

commit b0ad350d1b5fbffe9935b68a83b30bae5bc8efec
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jul 25 04:43:52 2008 +0000

    eventfd.h header for Linux/Alpha.

diff --git a/sysdeps/unix/sysv/linux/alpha/sys/eventfd.h b/sysdeps/unix/sysv/linux/alpha/sys/eventfd.h
new file mode 100644
index 0000000..c8ce554
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/sys/eventfd.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_EVENTFD_H
+#define	_SYS_EVENTFD_H	1
+
+#include <stdint.h>
+
+
+/* Type for event counter.  */
+typedef uint64_t eventfd_t;
+
+/* Flags for signalfd.  */
+enum
+  {
+    EFD_CLOEXEC = 010000000,
+#define EFD_CLOEXEC EFD_CLOEXEC
+    EFD_NONBLOCK = 04
+#define EFD_NONBLOCK EFD_NONBLOCK
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for generic event channel.  Set initial
+   value to COUNT.  */
+extern int eventfd (int __count, int __flags) __THROW;
+
+/* Read event counter and possibly wait for events.  */
+extern int eventfd_read (int __fd, eventfd_t *__value);
+
+/* Increment event counter.  */
+extern int eventfd_write (int __fd, eventfd_t value);
+
+__END_DECLS
+
+#endif /* sys/eventfd.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e46adeb5b0cc2f882fd8243a135164ef025a4058

commit e46adeb5b0cc2f882fd8243a135164ef025a4058
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jul 25 04:43:46 2008 +0000

    epoll.h header for Linux/Alpha.

diff --git a/sysdeps/unix/sysv/linux/alpha/sys/epoll.h b/sysdeps/unix/sysv/linux/alpha/sys/epoll.h
new file mode 100644
index 0000000..9f983a5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/sys/epoll.h
@@ -0,0 +1,143 @@
+/* Copyright (C) 2002-2006, 2007, 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_EPOLL_H
+#define	_SYS_EPOLL_H	1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Get __sigset_t.  */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+
+/* Flags to be passed to epoll_create2.  */
+enum
+  {
+    EPOLL_CLOEXEC = 010000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 04
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
+
+
+enum EPOLL_EVENTS
+  {
+    EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+    EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+    EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+    EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+    EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+    EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+    EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+    EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+    EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+    EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+    EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
+    EPOLLONESHOT = (1 << 30),
+#define EPOLLONESHOT EPOLLONESHOT
+    EPOLLET = (1 << 31)
+#define EPOLLET EPOLLET
+  };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl().  */
+#define EPOLL_CTL_ADD 1	/* Add a file descriptor to the interface.  */
+#define EPOLL_CTL_DEL 2	/* Remove a file descriptor from the interface.  */
+#define EPOLL_CTL_MOD 3	/* Change file descriptor epoll_event structure.  */
+
+
+typedef union epoll_data
+{
+  void *ptr;
+  int fd;
+  uint32_t u32;
+  uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+  uint32_t events;	/* Epoll events */
+  epoll_data_t data;	/* User data variable */
+};
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance.  Returns an fd for the new instance.
+   The "size" parameter is a hint specifying the number of file
+   descriptors to be associated with the new instance.  The fd
+   returned by epoll_create() should be closed with close().  */
+extern int epoll_create (int __size) __THROW;
+
+/* Same as epoll_create but with an additional FLAGS parameter.  */
+extern int epoll_create2 (int __size, int __flags) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+   -1 in case of error ( the "errno" variable will contain the
+   specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+   constants defined above. The "fd" parameter is the target of the
+   operation. The "event" parameter describes which events the caller
+   is interested in and any associated user data.  */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+		      struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+   triggered events returned in "events" buffer. Or -1 in case of
+   error with the "errno" variable set to the specific error code. The
+   "events" parameter is a buffer that will contain triggered
+   events. The "maxevents" is the maximum number of events to be
+   returned ( usually size of "events" ). The "timeout" parameter
+   specifies the maximum wait time in milliseconds (-1 == infinite).
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+		       int __maxevents, int __timeout);
+
+
+/* Same as epoll_wait, but the thread's signal mask is temporarily
+   and atomically replaced with the one provided as parameter.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
+			int __maxevents, int __timeout,
+			__const __sigset_t *__ss);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e2570f301f48371a8ca7bbd94b010c4d333010b7

commit e2570f301f48371a8ca7bbd94b010c4d333010b7
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 18 13:24:21 2008 +0000

    	* sysdeps/mips/bits/setjmp.h (__jmp_buf): Give name to structure
    	type.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 8a90a3d..e7aee50 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-07-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/bits/setjmp.h (__jmp_buf): Give name to structure
+	type.
+
 2008-05-21  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Cleanup namespace.
diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h
index 4f159c4..d3ced98 100644
--- a/sysdeps/mips/bits/setjmp.h
+++ b/sysdeps/mips/bits/setjmp.h
@@ -27,7 +27,7 @@
 
 #include <sgidefs.h>
 
-typedef struct
+typedef struct __jmp_buf_internal_tag
   {
 #if _MIPS_SIM == _ABIO32
     /* Program counter.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6b3dc26c7673476400596dd8687fef8bfc2e43e2

commit 6b3dc26c7673476400596dd8687fef8bfc2e43e2
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 18 13:21:45 2008 +0000

    2008-07-18  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/arm/eabi/fgetexcptflg.c: New.
    	* sysdeps/arm/eabi/fsetexcptflg.c (__fesetexceptflag): Operate on
    	set exception flags, not on mask of enabled exceptions.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 867bec4..5cca360 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,11 @@
 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/arm/eabi/fgetexcptflg.c: New.
+	* sysdeps/arm/eabi/fsetexcptflg.c (__fesetexceptflag): Operate on
+	set exception flags, not on mask of enabled exceptions.
+
+2008-07-18  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/arm/eabi/feupdateenv.c: New.
 
 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
diff --git a/sysdeps/arm/eabi/fsetexcptflg.c b/sysdeps/arm/eabi/fgetexcptflg.c
similarity index 51%
copy from sysdeps/arm/eabi/fsetexcptflg.c
copy to sysdeps/arm/eabi/fgetexcptflg.c
index 2e05514..2259fa3 100644
--- a/sysdeps/arm/eabi/fsetexcptflg.c
+++ b/sysdeps/arm/eabi/fgetexcptflg.c
@@ -1,6 +1,7 @@
-/* Set floating-point environment exception handling.
-   Copyright (C) 1997,98,99,2000,01,05 Free Software Foundation, Inc.
+/* Store current representation for exceptions.
+   Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -12,13 +13,12 @@
    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 General Public License
-   along with GCC; see the file COPYING.  If not, write to the Free
-   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <fenv.h>
-#include <math.h>
 #include <fpu_control.h>
 
 #include <unistd.h>
@@ -27,21 +27,16 @@
 #include <sysdep.h>
 
 int
-__fesetexceptflag (const fexcept_t *flagp, int excepts)
+__fegetexceptflag (fexcept_t *flagp, int excepts)
 {
   if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
     {
-      fexcept_t temp;
+      unsigned long temp;
 
-      /* Get the current environment.  */
+      /* Get the current exceptions.  */
       _FPU_GETCW (temp);
 
-      /* Set the desired exception mask.  */
-      temp &= ~((excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT);
-      temp |= (*flagp & excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT;
-
-      /* Save state back to the FPU.  */
-      _FPU_SETCW (temp);
+      *flagp = temp & excepts & FE_ALL_EXCEPT;
 
       /* Success.  */
       return 0;
@@ -53,8 +48,7 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
 
 #include <shlib-compat.h>
 #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
-strong_alias (__fesetexceptflag, __old_fesetexceptflag)
-compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
+strong_alias (__fegetexceptflag, __old_fegetexceptflag)
+compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1);
 #endif
-
-versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
+versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
diff --git a/sysdeps/arm/eabi/fsetexcptflg.c b/sysdeps/arm/eabi/fsetexcptflg.c
index 2e05514..3dfeb2c 100644
--- a/sysdeps/arm/eabi/fsetexcptflg.c
+++ b/sysdeps/arm/eabi/fsetexcptflg.c
@@ -1,5 +1,5 @@
 /* Set floating-point environment exception handling.
-   Copyright (C) 1997,98,99,2000,01,05 Free Software Foundation, Inc.
+   Copyright (C) 1997,98,99,2000,01,05,08 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
@@ -37,8 +37,8 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
       _FPU_GETCW (temp);
 
       /* Set the desired exception mask.  */
-      temp &= ~((excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT);
-      temp |= (*flagp & excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT;
+      temp &= ~(excepts & FE_ALL_EXCEPT);
+      temp |= (*flagp & excepts & FE_ALL_EXCEPT);
 
       /* Save state back to the FPU.  */
       _FPU_SETCW (temp);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e39762f948c1aeeeba236c09ae62071d3c1196f8

commit e39762f948c1aeeeba236c09ae62071d3c1196f8
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 18 13:20:51 2008 +0000

    2008-07-18  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/arm/eabi/feupdateenv.c: New.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index ceebb11..867bec4 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,9 @@
 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/arm/eabi/feupdateenv.c: New.
+
+2008-07-18  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/arm/libm-test-ulps: Update.
 
 2008-06-01  Paul Brook  <paul@codesourcery.com>
diff --git a/sysdeps/arm/eabi/feupdateenv.c b/sysdeps/arm/eabi/feupdateenv.c
new file mode 100644
index 0000000..9769867
--- /dev/null
+++ b/sysdeps/arm/eabi/feupdateenv.c
@@ -0,0 +1,59 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#include <unistd.h>
+#include <ldsodefs.h>
+#include <dl-procinfo.h>
+#include <sysdep.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+    {
+      unsigned int temp;
+
+      /* Get the current exception state.  */
+      _FPU_GETCW (temp);
+
+      /* Install new environment.  */
+      fesetenv (envp);
+
+      /* Raise the saved exceptions.  */
+      feraiseexcept (temp & FE_ALL_EXCEPT);
+
+      /* Success.  */
+      return 0;
+    }
+
+  /* Unsupported, so fail.  */
+  return 1;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__feupdateenv, __old_feupdateenv)
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
+#endif
+
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4cbcd54d99a64b845d9e8b19ef17d83df6a855cd

commit 4cbcd54d99a64b845d9e8b19ef17d83df6a855cd
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 18 13:18:53 2008 +0000

    2008-07-18  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/arm/libm-test-ulps: Update.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 212231a..ceebb11 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2008-07-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/libm-test-ulps: Update.
+
 2008-06-01  Paul Brook  <paul@codesourcery.com>
 	    Zack Weinberg  <zack@codesourcery.com>
 	    Daniel Jacobowitz  <dan@codesourcery.com>
diff --git a/sysdeps/arm/libm-test-ulps b/sysdeps/arm/libm-test-ulps
index 6a4bcc6..4fec86e 100644
--- a/sysdeps/arm/libm-test-ulps
+++ b/sysdeps/arm/libm-test-ulps
@@ -13,10 +13,24 @@ float: 2
 idouble: 1
 ifloat: 2
 
+# atan2
+Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
+float: 1
+ifloat: 1
+Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
+float: 1
+ifloat: 1
+Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
+float: 1
+ifloat: 1
+
 # atanh
 Test "atanh (0.7) == 0.8673005276940531944":
 double: 1
 idouble: 1
+Test "atanh (0.75) == 0.972955074527656652552676371721589865":
+float: 1
+ifloat: 1
 
 # cabs
 Test "cabs (-0.7 + 12.4 i) == 12.419742348374220601176836866763271":
@@ -59,6 +73,9 @@ double: 1
 float: 3
 idouble: 1
 ifloat: 3
+Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+float: 1
+ifloat: 1
 Test "Real part of: cacosh (0.7 + 1.2 i) == 1.0927647857577371459105272080819308 + 1.1351827477151551088992008271819053 i":
 double: 1
 float: 1
@@ -74,6 +91,11 @@ ifloat: 2
 Test "Imaginary part of: casin (0.7 + 1.2 i) == 0.4356135790797415103321208644578462 + 1.0927647857577371459105272080819308 i":
 float: 1
 ifloat: 1
+Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 
 # casinh
 Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
@@ -92,6 +114,14 @@ idouble: 1
 Test "Imaginary part of: casinh (0.7 + 1.2 i) == 0.97865459559367387689317593222160964 + 0.91135418953156011567903546856170941 i":
 float: 1
 ifloat: 1
+Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 
 # catan
 Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -124,14 +154,23 @@ double: 1
 float: 6
 idouble: 1
 ifloat: 6
+Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+double: 1
+idouble: 1
 
 # cbrt
 Test "cbrt (-27.0) == -3.0":
 double: 1
 idouble: 1
+Test "cbrt (0.75) == 0.908560296416069829445605878163630251":
+double: 1
+idouble: 1
 Test "cbrt (0.970299) == 0.99":
 double: 1
 idouble: 1
+Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217":
+double: 1
+idouble: 1
 
 # ccos
 Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
@@ -143,6 +182,14 @@ idouble: 1
 Test "Imaginary part of: ccos (0.7 + 1.2 i) == 1.3848657645312111080 - 0.97242170335830028619 i":
 double: 1
 idouble: 1
+Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+float: 1
+ifloat: 1
 
 # ccosh
 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
@@ -159,6 +206,14 @@ ifloat: 1
 Test "Imaginary part of: ccosh (0.7 + 1.2 i) == 0.4548202223691477654 + 0.7070296600921537682 i":
 double: 1
 idouble: 1
+Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
+float: 1
+ifloat: 1
 
 # cexp
 Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
@@ -172,6 +227,9 @@ ifloat: 1
 Test "Imaginary part of: cexp (0.7 + 1.2 i) == 0.72969890915032360123451688642930727 + 1.8768962328348102821139467908203072 i":
 float: 1
 ifloat: 1
+Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+float: 1
+ifloat: 1
 
 # clog
 Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
@@ -179,6 +237,9 @@ double: 1
 float: 3
 idouble: 1
 ifloat: 3
+Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+float: 1
+ifloat: 1
 
 # clog10
 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -224,6 +285,9 @@ ifloat: 1
 Test "Imaginary part of: clog10 (0.7 + 1.2 i) == 0.1427786545038868803 + 0.4528483579352493248 i":
 double: 1
 idouble: 1
+Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+float: 1
+ifloat: 1
 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
 float: 1
 ifloat: 1
@@ -260,6 +324,22 @@ idouble: 0.2758
 ifloat: 0.3667
 
 # cpow
+Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+float: 1
+ifloat: 1
+Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
+double: 1
+float: 4
+idouble: 1
+ifloat: 4
+Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 double: 1
 float: 4
@@ -289,6 +369,12 @@ ifloat: 1
 Test "Imaginary part of: csinh (0.7 + 1.2 i) == 0.27487868678117583582 + 1.1698665727426565139 i":
 float: 1
 ifloat: 1
+Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
+float: 1
+ifloat: 1
 
 # csqrt
 Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
@@ -318,6 +404,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+double: 1
+idouble: 1
 
 # ctanh
 Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
@@ -338,6 +427,14 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
+double: 1
+idouble: 1
+
+# erf
+Test "erf (1.25) == 0.922900128256458230136523481197281140":
+double: 1
+idouble: 1
 
 # erfc
 Test "erfc (0.7) == 0.32219880616258152702":
@@ -351,11 +448,17 @@ ifloat: 2
 Test "erfc (2.0) == 0.0046777349810472658379":
 double: 1
 idouble: 1
+Test "erfc (2.0) == 0.00467773498104726583793074363274707139":
+double: 1
+idouble: 1
 Test "erfc (4.1) == 0.67000276540848983727e-8":
 double: 24
 float: 12
 idouble: 24
 ifloat: 12
+Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
+double: 1
+idouble: 1
 
 # exp10
 Test "exp10 (-1) == 0.1":
@@ -366,6 +469,11 @@ ifloat: 1
 Test "exp10 (0.7) == 5.0118723362727228500155418688494574":
 float: 1
 ifloat: 1
+Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "exp10 (3) == 1000":
 double: 6
 float: 2
@@ -373,6 +481,9 @@ idouble: 6
 ifloat: 2
 
 # expm1
+Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
+double: 1
+idouble: 1
 Test "expm1 (1) == M_El - 1.0":
 float: 1
 ifloat: 1
@@ -429,6 +540,19 @@ float: 1
 ifloat: 1
 
 # j0
+Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "j0 (0.75) == 0.864242275166648623555731103820923211":
+float: 1
+ifloat: 1
+Test "j0 (10.0) == -0.245935764451348335197760862485328754":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
 Test "j0 (10.0) == -0.24593576445134833520":
 double: 2
 float: 1
@@ -437,22 +561,55 @@ ifloat: 1
 Test "j0 (2.0) == 0.22389077914123566805":
 float: 2
 ifloat: 2
+Test "j0 (2.0) == 0.223890779141235668051827454649948626":
+float: 2
+ifloat: 2
+Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "j0 (8.0) == 0.17165080713755390609":
 float: 1
 ifloat: 1
+Test "j0 (8.0) == 0.171650807137553906090869407851972001":
+float: 1
+ifloat: 1
 
 # j1
+Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
+float: 2
+ifloat: 2
 Test "j1 (10.0) == 0.043472746168861436670":
 float: 2
 ifloat: 2
 Test "j1 (2.0) == 0.57672480775687338720":
 double: 1
 idouble: 1
+Test "j1 (2.0) == 0.576724807756873387202448242269137087":
+double: 1
+idouble: 1
 Test "j1 (8.0) == 0.23463634685391462438":
 double: 1
 idouble: 1
+Test "j1 (8.0) == 0.234636346853914624381276651590454612":
+double: 1
+idouble: 1
 
 # jn
+Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "jn (0, 0.75) == 0.864242275166648623555731103820923211":
+float: 1
+ifloat: 1
+Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
 Test "jn (0, 10.0) == -0.24593576445134833520":
 double: 2
 float: 1
@@ -461,47 +618,105 @@ ifloat: 1
 Test "jn (0, 2.0) == 0.22389077914123566805":
 float: 2
 ifloat: 2
+Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
+float: 2
+ifloat: 2
+Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "jn (0, 8.0) == 0.17165080713755390609":
 float: 1
 ifloat: 1
+Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
+float: 1
+ifloat: 1
+Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
+float: 2
+ifloat: 2
 Test "jn (1, 10.0) == 0.043472746168861436670":
 float: 2
 ifloat: 2
 Test "jn (1, 2.0) == 0.57672480775687338720":
 double: 1
 idouble: 1
+Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
+double: 1
+idouble: 1
 Test "jn (1, 8.0) == 0.23463634685391462438":
 double: 1
 idouble: 1
+Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
+double: 1
+idouble: 1
 Test "jn (10, 0.1) == 0.26905328954342155795e-19":
 double: 6
 float: 4
 idouble: 6
 ifloat: 4
+Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "jn (10, 0.7) == 0.75175911502153953928e-11":
 double: 3
 float: 1
 idouble: 3
 ifloat: 1
+Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
 Test "jn (10, 10.0) == 0.20748610663335885770":
 double: 4
 float: 3
 idouble: 4
 ifloat: 3
+Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+float: 4
+ifloat: 4
 Test "jn (10, 2.0) == 0.25153862827167367096e-6":
 float: 4
 ifloat: 4
 Test "jn (3, 0.1) == 0.000020820315754756261429":
 double: 1
 idouble: 1
+Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "jn (3, 0.7) == 0.0069296548267508408077":
 float: 1
 ifloat: 1
+Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
 Test "jn (3, 10.0) == 0.058379379305186812343":
 double: 3
 float: 1
 idouble: 3
 ifloat: 1
+Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
 Test "jn (3, 2.0) == 0.12894324947440205110":
 double: 1
 float: 2
@@ -533,11 +748,19 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "log10 (0.75) == -0.124938736608299953132449886193870744":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
 Test "log10 (e) == log10(e)":
 float: 1
 ifloat: 1
 
 # log1p
+Test "log1p (-0.25) == -0.287682072451780927439219005993827432":
+float: 1
+ifloat: 1
 Test "log1p (-0.3) == -0.35667494393873237891263871124118447":
 double: 1
 float: 1
@@ -567,11 +790,19 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
 double: 0.2758
 float: 0.3667
 idouble: 0.2758
 ifloat: 0.3667
+Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
+float: 1
+ifloat: 1
 Test "sincos (pi/6, &sin_res, &cos_res) puts 0.866025403784438646764 in cos_res":
 float: 1
 ifloat: 1
@@ -616,11 +847,21 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
 Test "y0 (1.0) == 0.088256964215676957983":
 double: 2
 float: 1
 idouble: 2
 ifloat: 1
+Test "y0 (1.5) == 0.382448923797758843955068554978089862":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
 Test "y0 (1.5) == 0.38244892379775884396":
 double: 2
 float: 1
@@ -629,6 +870,14 @@ ifloat: 1
 Test "y0 (10.0) == 0.055671167283599391424":
 float: 1
 ifloat: 1
+Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
+float: 1
+ifloat: 1
+Test "y0 (8.0) == 0.223521489387566220527323400498620359":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "y0 (8.0) == 0.22352148938756622053":
 double: 1
 float: 1
@@ -639,6 +888,9 @@ ifloat: 1
 Test "y1 (0.1) == -6.4589510947020269877":
 double: 1
 idouble: 1
+Test "y1 (0.125) == -5.19993611253477499595928744876579921":
+double: 1
+idouble: 1
 Test "y1 (0.7) == -1.1032498719076333697":
 double: 1
 float: 1
@@ -647,16 +899,34 @@ ifloat: 1
 Test "y1 (1.5) == -0.41230862697391129595":
 float: 1
 ifloat: 1
+Test "y1 (1.5) == -0.412308626973911295952829820633445323":
+float: 1
+ifloat: 1
 Test "y1 (10.0) == 0.24901542420695388392":
 double: 3
 float: 1
 idouble: 3
 ifloat: 1
+Test "y1 (10.0) == 0.249015424206953883923283474663222803":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+Test "y1 (2.0) == -0.107032431540937546888370772277476637":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "y1 (2.0) == -0.10703243154093754689":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "y1 (8.0) == -0.158060461731247494255555266187483550":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
 Test "y1 (8.0) == -0.15806046173124749426":
 double: 1
 float: 2
@@ -669,11 +939,21 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
 Test "yn (0, 1.0) == 0.088256964215676957983":
 double: 2
 float: 1
 idouble: 2
 ifloat: 1
+Test "yn (0, 1.5) == 0.382448923797758843955068554978089862":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
 Test "yn (0, 1.5) == 0.38244892379775884396":
 double: 2
 float: 1
@@ -682,6 +962,14 @@ ifloat: 1
 Test "yn (0, 10.0) == 0.055671167283599391424":
 float: 1
 ifloat: 1
+Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481":
+float: 1
+ifloat: 1
+Test "yn (0, 8.0) == 0.223521489387566220527323400498620359":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "yn (0, 8.0) == 0.22352148938756622053":
 double: 1
 float: 1
@@ -690,6 +978,9 @@ ifloat: 1
 Test "yn (1, 0.1) == -6.4589510947020269877":
 double: 1
 idouble: 1
+Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
+double: 1
+idouble: 1
 Test "yn (1, 0.7) == -1.1032498719076333697":
 double: 1
 float: 1
@@ -698,16 +989,34 @@ ifloat: 1
 Test "yn (1, 1.5) == -0.41230862697391129595":
 float: 1
 ifloat: 1
+Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
+float: 1
+ifloat: 1
 Test "yn (1, 10.0) == 0.24901542420695388392":
 double: 3
 float: 1
 idouble: 3
 ifloat: 1
+Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+Test "yn (1, 2.0) == -0.107032431540937546888370772277476637":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "yn (1, 2.0) == -0.10703243154093754689":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "yn (1, 8.0) == -0.158060461731247494255555266187483550":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
 Test "yn (1, 8.0) == -0.15806046173124749426":
 double: 1
 float: 2
@@ -718,17 +1027,36 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
+Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
+double: 1
+idouble: 1
 Test "yn (10, 0.7) == -0.42447194260703866924e10":
 double: 3
 idouble: 3
+Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "yn (10, 1.0) == -0.12161801427868918929e9":
 double: 1
 idouble: 1
+Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
+double: 1
+idouble: 1
 Test "yn (10, 10.0) == -0.35981415218340272205":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
+double: 2
+idouble: 2
 Test "yn (10, 2.0) == -129184.54220803928264":
 double: 2
 idouble: 2
@@ -737,16 +1065,32 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
+double: 1
+idouble: 1
 Test "yn (3, 0.7) == -15.819479052819633505":
 double: 3
 float: 1
 idouble: 3
 ifloat: 1
+Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "yn (3, 10.0) == -0.251362657183837329779204747654240998":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 Test "yn (3, 10.0) == -0.25136265718383732978":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
+double: 1
+idouble: 1
 Test "yn (3, 2.0) == -1.1277837768404277861":
 double: 1
 idouble: 1
@@ -758,9 +1102,15 @@ float: 2
 idouble: 1
 ifloat: 2
 
+Function: "atan2":
+float: 1
+ifloat: 1
+
 Function: "atanh":
 double: 1
+float: 1
 idouble: 1
+ifloat: 1
 
 Function: "cabs":
 double: 1
@@ -840,7 +1190,9 @@ idouble: 1
 
 Function: Real part of "ccos":
 double: 1
+float: 1
 idouble: 1
+ifloat: 1
 
 Function: Imaginary part of "ccos":
 double: 1
@@ -870,6 +1222,10 @@ Function: Imaginary part of "cexp":
 float: 1
 ifloat: 1
 
+Function: Real part of "clog":
+float: 1
+ifloat: 1
+
 Function: Imaginary part of "clog":
 double: 1
 float: 3
@@ -895,15 +1251,15 @@ idouble: 2
 ifloat: 1
 
 Function: Real part of "cpow":
-double: 1
+double: 2
 float: 4
-idouble: 1
+idouble: 2
 ifloat: 4
 
 Function: Imaginary part of "cpow":
-double: 1.1031
+double: 2
 float: 2
-idouble: 1.1031
+idouble: 2
 ifloat: 2
 
 Function: Imaginary part of "csin":
@@ -954,6 +1310,10 @@ float: 1
 idouble: 2
 ifloat: 1
 
+Function: "erf":
+double: 1
+idouble: 1
+
 Function: "erfc":
 double: 24
 float: 12
@@ -967,7 +1327,9 @@ idouble: 6
 ifloat: 2
 
 Function: "expm1":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 
 Function: "fmod":
@@ -1014,9 +1376,9 @@ ifloat: 1
 
 Function: "log10":
 double: 1
-float: 1
+float: 2
 idouble: 1
-ifloat: 1
+ifloat: 2
 
 Function: "log1p":
 double: 1

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2906e90e245a5b496d89906549e99eccd23fb16c

commit 2906e90e245a5b496d89906549e99eccd23fb16c
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Tue Jun 17 11:45:52 2008 +0000

    2008-06-17  Aurelian Jarno  <aurelien@aurel32.net>
    	    Carlos O'Donell  <carlos@systemhalted.org>
    
    	[BZ #6037]
    	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Check for -11
    	(-EAGAIN) instead of 11. Loop again when the kernel
    	returns -45 (-EDEADLOCK). Add back memory clobber.
    	Do not initialize lws_ret and lws_errno.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index fc76d6d..2a4a712 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,12 @@
+2008-06-17  Aurelian Jarno  <aurelien@aurel32.net>
+	    Carlos O'Donell  <carlos@systemhalted.org>
+
+	[BZ #6037]
+	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Check for -11 
+	(-EAGAIN) instead of 11. Loop again when the kernel
+	returns -45 (-EDEADLOCK). Add back memory clobber. 
+	Do not initialize lws_ret and lws_errno.
+
 2008-06-17  Guy Martin  <gmsoft@tuxicoman.be>
 
 	[BZ #5957]
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
index b8959f7..2964732 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -51,34 +51,41 @@ typedef uintmax_t uatomic_max_t;
      *addr = new;
    return prev; */
 
-/* Use the kernel atomic light weight syscalls on hppa */ 
-#define LWS "0xb0"
-#define LWS_CAS "0"
-/* Note r31 is the link register */
-#define LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31"
-#define ASM_EAGAIN "11" 
+/* Use the kernel atomic light weight syscalls on hppa.  */ 
+#define _LWS "0xb0"
+#define _LWS_CAS "0"
+/* Note r31 is the link register.  */
+#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
+/* String constant for -EAGAIN.  */
+#define _ASM_EAGAIN "-11" 
+/* String constant for -EDEADLOCK.  */
+#define _ASM_EDEADLOCK "-45"
 
 #if __ASSUME_LWS_CAS
 /* The only basic operation needed is compare and exchange.  */
 # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) 	\
   ({									\
-     volatile int lws_errno = EFAULT;					\
-     volatile int lws_ret = 0xdeadbeef;					\
+     volatile int lws_errno;						\
+     volatile int lws_ret;						\
      asm volatile(							\
 	"0:					\n\t"			\
-	"copy	%3, %%r26			\n\t"			\
-	"copy	%4, %%r25			\n\t"			\
-	"copy	%5, %%r24			\n\t"			\
-	"ble	" LWS "(%%sr2, %%r0)		\n\t"			\
-	"ldi	" LWS_CAS ", %%r20		\n\t"			\
-	"cmpib,=,n " ASM_EAGAIN ",%%r21,0b	\n\t"			\
+	"copy	%2, %%r26			\n\t"			\
+	"copy	%3, %%r25			\n\t"			\
+	"copy	%4, %%r24			\n\t"			\
+	"ble	" _LWS "(%%sr2, %%r0)		\n\t"			\
+	"ldi	" _LWS_CAS ", %%r20		\n\t"			\
+	"ldi	" _ASM_EAGAIN ", %%r24		\n\t"			\
+	"cmpb,=,n %%r24, %%r21, 0b		\n\t"			\
+	"nop					\n\t"			\
+	"ldi	" _ASM_EDEADLOCK ", %%r25	\n\t"			\
+	"cmpb,=,n %%r25, %%r21, 0b		\n\t"			\
 	"nop					\n\t"			\
 	"stw	%%r28, %0			\n\t"			\
         "sub	%%r0, %%r21, %%r21		\n\t"			\
 	"stw	%%r21, %1			\n\t"			\
-	: "=m" (lws_ret), "=m" (lws_errno), "+m" (*mem)			\
+	: "=m" (lws_ret), "=m" (lws_errno) 				\
         : "r" (mem), "r" (oldval), "r" (newval)				\
-	: LWS_CLOBBER							\
+	: _LWS_CLOBBER							\
      );									\
     									\
      if(lws_errno == EFAULT || lws_errno == ENOSYS)			\
@@ -91,7 +98,7 @@ typedef uintmax_t uatomic_max_t;
   ({									\
      int ret;								\
      ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval);	\
-     /* Return 1 if it was already acquired */				\
+     /* Return 1 if it was already acquired.  */			\
      (ret != oldval);							\
    })
 #else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6f85344ee3492c36fc01f8fe77e9802dd24a66ab

commit 6f85344ee3492c36fc01f8fe77e9802dd24a66ab
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Tue Jun 17 11:44:25 2008 +0000

    2008-06-17  Guy Martin  <gmsoft@tuxicoman.be>
    
    	[BZ #5957]
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
    	Use shared futex in lll_wait_tid().

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 67524ba..fc76d6d 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2008-06-17  Guy Martin  <gmsoft@tuxicoman.be>
+
+	[BZ #5957]
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
+	Use shared futex in lll_wait_tid().
+
 2008-05-12  Aurelien Jarno  <aurelien@aurel32.net>
 
 	[BZ #6506]
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index ec907ae..6998a91 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -325,12 +325,12 @@ extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
    thread ID while the clone is running and is reset to zero
    afterwards.	*/
 #define lll_wait_tid(tid) \
-  do						\
-    {						\
-      __typeof (tid) __tid;			\
-      while ((__tid = (tid)) != 0)		\
-        lll_futex_wait (&(tid), __tid, 0);	\
-    }						\
+  do							\
+    {							\
+      __typeof (tid) __tid;				\
+      while ((__tid = (tid)) != 0)			\
+        lll_futex_wait (&(tid), __tid, LLL_SHARED);	\
+    }							\
   while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1ba025a9a21eda65d8c36cc0dbb51d214a3ebb1a

commit 1ba025a9a21eda65d8c36cc0dbb51d214a3ebb1a
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Jun 2 01:57:03 2008 +0000

    2008-06-01  Paul Brook  <paul@codesourcery.com>
    	    Zack Weinberg  <zack@codesourcery.com>
    	    Daniel Jacobowitz  <dan@codesourcery.com>
    
    	* sysdeps/arm/nptl/pthread_spin_lock.S,
    	sysdeps/arm/nptl/pthread_spin_trylock.S: Delete.
    	* sysdeps/arm/nptl/pthread_spin_lock.c,
    	sysdeps/arm/nptl/pthread_spin_trylock.c: New files using
    	atomic_compare_and_exchange_val_acq to take spinlocks.
    	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (lll_trylock,
    	lll_cond_trylock): Use atomic_compare_and_exchange_val_acq.
    	(__lll_trylock, __lll_cond_trylock): Delete.
    	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
    	(atomic_exchange_acq): Delete.
    	(atomic_full_barrier): Define.
    	(__arch_compare_and_exchange_val_32_acq): Use named operands.
    	* sysdeps/unix/sysv/linux/arm/eabi/configure.in: Update
    	arch_minimum_kernel to 2.6.16.
    	* sysdeps/unix/sysv/linux/arm/eabi/configure: Regenerated.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index f059630..212231a 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,23 @@
+2008-06-01  Paul Brook  <paul@codesourcery.com>
+	    Zack Weinberg  <zack@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/arm/nptl/pthread_spin_lock.S,
+	sysdeps/arm/nptl/pthread_spin_trylock.S: Delete.
+	* sysdeps/arm/nptl/pthread_spin_lock.c,
+	sysdeps/arm/nptl/pthread_spin_trylock.c: New files using
+	atomic_compare_and_exchange_val_acq to take spinlocks.
+	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (lll_trylock,
+	lll_cond_trylock): Use atomic_compare_and_exchange_val_acq.
+	(__lll_trylock, __lll_cond_trylock): Delete.
+	* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
+	(atomic_exchange_acq): Delete.
+	(atomic_full_barrier): Define.
+	(__arch_compare_and_exchange_val_32_acq): Use named operands.
+	* sysdeps/unix/sysv/linux/arm/eabi/configure.in: Update
+	arch_minimum_kernel to 2.6.16.
+	* sysdeps/unix/sysv/linux/arm/eabi/configure: Regenerated.
+
 2008-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/check_pf.c: Update from generic
diff --git a/sysdeps/arm/nptl/pthread_spin_trylock.S b/sysdeps/arm/nptl/pthread_spin_lock.c
similarity index 73%
rename from sysdeps/arm/nptl/pthread_spin_trylock.S
rename to sysdeps/arm/nptl/pthread_spin_lock.c
index 8593150..1217b89 100644
--- a/sysdeps/arm/nptl/pthread_spin_trylock.S
+++ b/sysdeps/arm/nptl/pthread_spin_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2008 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
@@ -16,19 +16,15 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ERRNO_H 1
-#include <bits/errno.h>
+#include <atomic.h>
+#include "pthreadP.h"
 
-#include <sysdep.h>
+int
+pthread_spin_lock (pthread_spinlock_t *lock)
+{
+  while (atomic_compare_and_exchange_val_acq (lock, 1, 0) != 0)
+   while (*lock != 0)
+    ;
 
-	.text
-	.align	4
-
-ENTRY (pthread_spin_trylock)
-	mov	r1, #1
-	swp	r2, r1, [r0]
-	teq	r2, #0
-	moveq	r0, #0
-	movne	r0, #EBUSY
-	PSEUDO_RET_NOERRNO
-END (pthread_spin_trylock)
+  return 0;
+}
diff --git a/sysdeps/arm/nptl/pthread_spin_lock.S b/sysdeps/arm/nptl/pthread_spin_trylock.c
similarity index 76%
rename from sysdeps/arm/nptl/pthread_spin_lock.S
rename to sysdeps/arm/nptl/pthread_spin_trylock.c
index bd6adf7..fb998d2 100644
--- a/sysdeps/arm/nptl/pthread_spin_lock.S
+++ b/sysdeps/arm/nptl/pthread_spin_trylock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2008 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
@@ -16,16 +16,12 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
+#include <errno.h>
+#include <atomic.h>
+#include "pthreadP.h"
 
-	.text
-	.align	4
-
-ENTRY (pthread_spin_lock)
-	mov	r1, #1
-1:	swp	r2, r1, [r0]
-	teq	r2, #0
-	bne	1b
-	mov	r0, #0
-	PSEUDO_RET_NOERRNO
-END (pthread_spin_lock)
+int
+pthread_spin_trylock (pthread_spinlock_t *lock)
+{
+  return atomic_compare_and_exchange_val_acq (lock, 1, 0) ? EBUSY : 0;
+}
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/configure b/sysdeps/unix/sysv/linux/arm/eabi/configure
index ab83048..28fb9ef 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/configure
+++ b/sysdeps/unix/sysv/linux/arm/eabi/configure
@@ -1,5 +1,5 @@
 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/arm/eabi.
 
-arch_minimum_kernel=2.6.14
+arch_minimum_kernel=2.6.16
 libc_cv_gcc_unwind_find_fde=no
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/configure.in b/sysdeps/unix/sysv/linux/arm/eabi/configure.in
index 83aa8fc..d1fb7f4 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/configure.in
+++ b/sysdeps/unix/sysv/linux/arm/eabi/configure.in
@@ -1,5 +1,5 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/arm/eabi.
 
-arch_minimum_kernel=2.6.14
+arch_minimum_kernel=2.6.16
 libc_cv_gcc_unwind_find_fde=no
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h b/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
index 71ed714..247ddd3 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
@@ -37,22 +37,12 @@ typedef uintmax_t uatomic_max_t;
 
 void __arm_link_error (void);
 
-#define atomic_exchange_acq(mem, newvalue)				      \
-  ({ __typeof (*mem) result;						      \
-     if (sizeof (*mem) == 1)						      \
-       __asm__ __volatile__ ("swpb %0, %1, [%2]"			      \
-			     : "=&r,&r" (result)			      \
-			     : "r,0" (newvalue), "r,r" (mem) : "memory");     \
-     else if (sizeof (*mem) == 4)					      \
-       __asm__ __volatile__ ("swp %0, %1, [%2]"				      \
-			     : "=&r,&r" (result)			      \
-			     : "r,0" (newvalue), "r,r" (mem) : "memory");     \
-     else								      \
-       {								      \
-	 result = 0;							      \
-	 abort ();							      \
-       }								      \
-     result; })
+#define atomic_full_barrier() \
+     __asm__ __volatile__						      \
+	     ("mov\tip, #0xffff0fff\n\t"				      \
+	      "mov\tlr, pc\n\t"						      \
+	      "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)"			      \
+	      : : : "ip", "lr", "cc", "memory");
 
 /* Atomic compare and exchange.  This sequence relies on the kernel to
    provide a compare and exchange operation which is atomic on the
@@ -76,18 +66,19 @@ void __arm_link_error (void);
      register __typeof (oldval) a_tmp asm ("r3");			      \
      register __typeof (oldval) a_oldval2 asm ("r4") = (oldval);	      \
      __asm__ __volatile__						      \
-	     ("0:\tldr\t%1,[%3]\n\t"					      \
-	      "cmp\t%1, %4\n\t"						      \
+	     ("0:\tldr\t%[tmp],[%[ptr]]\n\t"				      \
+	      "cmp\t%[tmp], %[old2]\n\t"				      \
 	      "bne\t1f\n\t"						      \
-	      "mov\t%0, %4\n\t"						      \
-	      "mov\t%1, #0xffff0fff\n\t"				      \
+	      "mov\t%[old], %[old2]\n\t"				      \
+	      "mov\t%[tmp], #0xffff0fff\n\t"				      \
 	      "mov\tlr, pc\n\t"						      \
-	      "add\tpc, %1, #(0xffff0fc0 - 0xffff0fff)\n\t"		      \
+	      "add\tpc, %[tmp], #(0xffff0fc0 - 0xffff0fff)\n\t"		      \
 	      "bcc\t0b\n\t"						      \
-	      "mov\t%1, %4\n\t"						      \
+	      "mov\t%[tmp], %[old2]\n\t"				      \
 	      "1:"							      \
-	      : "=&r" (a_oldval), "=&r" (a_tmp)				      \
-	      : "r" (a_newval), "r" (a_ptr), "r" (a_oldval2)		      \
+	      : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp)		      \
+	      : [new] "r" (a_newval), [ptr] "r" (a_ptr),		      \
+		[old2] "r" (a_oldval2)					      \
 	      : "ip", "lr", "cc", "memory");				      \
      a_tmp; })
 
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index f48e867..889f97c 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -126,43 +126,11 @@
   })
 
 
-static inline int __attribute__((always_inline))
-__lll_trylock (int *futex)
-{
-  int flag = 1, old;
-  asm volatile (
-    "\tswp	%[old], %[flag], [%[futex]]	@ try to take the lock\n"
-    "\tcmp	%[old], #1			@ check old lock value\n"
-    "\tmovlo	%[flag], #0			@ if we got it, return 0\n"
-    "\tswphi	%[flag], %[old], [%[futex]]	@ if it was contested,\n"
-    "						@ restore the contested flag,\n"
-    "						@ and check whether that won."
-    : [futex] "+&r" (futex), [flag] "+&r" (flag), [old] "=&r" (old)
-    : : "memory" );
-
-  return flag;
-}
-#define lll_trylock(lock)	__lll_trylock (&(lock))
-
-
-static inline int __attribute__((always_inline))
-__lll_cond_trylock (int *futex)
-{
-  int flag = 2, old;
-  asm volatile (
-    "\tswp	%[old], %[flag], [%[futex]]	@ try to take the lock\n"
-    "\tcmp	%[old], #1			@ check old lock value\n"
-    "\tmovlo	%[flag], #0			@ if we got it, return 0\n"
-    "\tswphi	%[flag], %[old], [%[futex]]	@ if it was contested,\n"
-    "						@ restore the contested flag,\n"
-    "						@ and check whether that won."
-    : [futex] "+&r" (futex), [flag] "+&r" (flag), [old] "=&r" (old)
-    : : "memory" );
-
-  return flag;
-}
-#define lll_cond_trylock(lock)	__lll_cond_trylock (&(lock))
+#define lll_trylock(lock)	\
+  atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
 
+#define lll_cond_trylock(lock)	\
+  atomic_compare_and_exchange_val_acq(&(lock), 2, 0)
 
 #define __lll_robust_trylock(futex, id) \
   (atomic_compare_and_exchange_val_acq (futex, id, 0) != 0)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=83d53ff1aa05f0ca0d397f01cd20eef375514f93

commit 83d53ff1aa05f0ca0d397f01cd20eef375514f93
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 21 17:50:58 2008 +0000

    2008-05-21  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Cleanup namespace.
    	(SOCK_DCCP): Define.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 398fac9..8a90a3d 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-05-21  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Cleanup namespace.
+	(SOCK_DCCP): Define.
+
 2008-05-01  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/resource.h: Define
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 8748c0a..f3adf5f 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Linux/MIPS version.
-   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007
+   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -26,10 +26,8 @@
 #endif
 
 #define	__need_size_t
-#define __need_NULL
 #include <stddef.h>
 
-#include <limits.h>
 #include <sys/types.h>
 
 /* Type for length arguments in socket calls.  */
@@ -54,6 +52,8 @@ enum __socket_type
   SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
 				   datagrams of fixed maximum length.  */
 #define SOCK_SEQPACKET SOCK_SEQPACKET
+  SOCK_DCCP = 6,
+#define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol.  */
   SOCK_PACKET = 10		/* Linux specific way of getting packets
 				   at the dev level.  For writing rarp and
 				   other similar things on the user level. */
@@ -156,11 +156,7 @@ struct sockaddr
 
 /* Structure large enough to hold any socket address (with the historical
    exception of AF_UNIX).  We reserve 128 bytes.  */
-#if ULONG_MAX > 0xffffffff
-# define __ss_aligntype	__uint64_t
-#else
-# define __ss_aligntype	__uint32_t
-#endif
+#define __ss_aligntype	unsigned long int
 #define _SS_SIZE	128
 #define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
 
@@ -257,7 +253,7 @@ struct cmsghdr
 #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
 #define CMSG_FIRSTHDR(mhdr) \
   ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
-   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
 			 & (size_t) ~(sizeof (size_t) - 1))
 #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
@@ -301,18 +297,74 @@ enum
 #endif
   };
 
+#ifdef __USE_GNU
 /* User visible structure for SCM_CREDENTIALS message */
-
 struct ucred
 {
   pid_t pid;			/* PID of sending process.  */
   uid_t uid;			/* UID of sending process.  */
   gid_t gid;			/* GID of sending process.  */
 };
+#endif
+
+/* Ugly workaround for unclean kernel headers.  */
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifndef FIOGETOWN
+#  define __SYS_SOCKET_H_undef_FIOGETOWN
+# endif
+# ifndef FIOSETOWN
+#  define __SYS_SOCKET_H_undef_FIOSETOWN
+# endif
+# ifndef SIOCATMARK
+#  define __SYS_SOCKET_H_undef_SIOCATMARK
+# endif
+# ifndef SIOCGPGRP
+#  define __SYS_SOCKET_H_undef_SIOCGPGRP
+# endif
+# ifndef SIOCGSTAMP
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMP
+# endif
+# ifndef SIOCGSTAMPNS
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# endif
+# ifndef SIOCSPGRP
+#  define __SYS_SOCKET_H_undef_SIOCSPGRP
+# endif
+#endif
 
 /* Get socket manipulation related informations from kernel headers.  */
 #include <asm/socket.h>
 
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
+#  undef __SYS_SOCKET_H_undef_FIOGETOWN
+#  undef FIOGETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
+#  undef __SYS_SOCKET_H_undef_FIOSETOWN
+#  undef FIOSETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
+#  undef __SYS_SOCKET_H_undef_SIOCATMARK
+#  undef SIOCATMARK
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
+#  undef __SYS_SOCKET_H_undef_SIOCGPGRP
+#  undef SIOCGPGRP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMP
+#  undef SIOCGSTAMP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+#  undef SIOCGSTAMPNS
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
+#  undef __SYS_SOCKET_H_undef_SIOCSPGRP
+#  undef SIOCSPGRP
+# endif
+#endif
 
 /* Structure used to manipulate the SO_LINGER option.  */
 struct linger

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=601352feab3364f14ccfc8db193bb3dbc5ad7771

commit 601352feab3364f14ccfc8db193bb3dbc5ad7771
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Mon May 12 12:09:21 2008 +0000

    2008-05-12  Aurelien Jarno  <aurelien@aurel32.net>
    
    	[BZ #6506]
    	* sysdeps/hppa/fpu/fesetenv.c: bufptr is always read, temp is
    	read while writing back status word.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 1bc6138..67524ba 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2008-05-12  Aurelien Jarno  <aurelien@aurel32.net>
+
+	[BZ #6506]
+	* sysdeps/hppa/fpu/fesetenv.c: bufptr is always read, temp is
+	read while writing back status word.
+
 2008-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/bits/shm.h: Fix comment describing
diff --git a/sysdeps/hppa/fpu/fesetenv.c b/sysdeps/hppa/fpu/fesetenv.c
index b5753ef..1a5ca65 100644
--- a/sysdeps/hppa/fpu/fesetenv.c
+++ b/sysdeps/hppa/fpu/fesetenv.c
@@ -35,7 +35,7 @@ fesetenv (const fenv_t *envp)
   bufptr = temp.buf;
   __asm__ (
 	   "fstd,ma %%fr0,8(%1)\n"
-	   : "=m" (temp), "+r" (bufptr) : : "%r0");
+	   : "=m" (temp) : "r" (bufptr) : "%r0");
 
   temp.env.__status_word &= ~(FE_ALL_EXCEPT
 			    | (FE_ALL_EXCEPT << 27)
@@ -56,7 +56,7 @@ fesetenv (const fenv_t *envp)
      is loaded last and T-Bit is enabled. */
   __asm__ (
 	   "fldd,mb -8(%1),%%fr0\n"
-	   : "=m" (temp), "+r" (bufptr) : : "%r0" );
+	   : : "m" (temp), "r" (bufptr) : "%r0" );
 
   /* Success.  */
   return 0;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=098cab74db4db7c2a229069b9f54c55170f9a6db

commit 098cab74db4db7c2a229069b9f54c55170f9a6db
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Thu May 1 12:34:13 2008 +0000

    2008-05-01  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/mips/bits/resource.h: Define
    	RUSAGE_THREAD and RUSAGE_LWP.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index b4253d8..398fac9 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-05-01  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/resource.h: Define
+	RUSAGE_THREAD and RUSAGE_LWP.
+
 2008-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/shm.h: Fix comment describing
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index 1c8b99a..3cfdc5d 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -166,8 +166,16 @@ enum __rusage_who
 #define RUSAGE_SELF RUSAGE_SELF
 
   /* All of its terminated child processes.  */
-  RUSAGE_CHILDREN = -1
+  RUSAGE_CHILDREN = -1,
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b38a90999fdcfd6f19832ffd0112e11e126d9b02

commit b38a90999fdcfd6f19832ffd0112e11e126d9b02
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu May 1 05:37:45 2008 +0000

    Define RUSAGE_THREAD and RUSAGE_LWP.

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index 2163745..92d0199 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -158,8 +158,16 @@ enum __rusage_who
 #define RUSAGE_SELF RUSAGE_SELF
 
   /* All of its terminated child processes.  */
-  RUSAGE_CHILDREN = -1
+  RUSAGE_CHILDREN = -1,
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7272ed4e474a398b8ce1e7374cdaa8592b840e2a

commit 7272ed4e474a398b8ce1e7374cdaa8592b840e2a
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Apr 21 15:54:22 2008 +0000

    	* sysdeps/unix/sysv/linux/arm/check_pf.c: Update from generic
    	version.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 7a5ac15..f059630 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2008-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/check_pf.c: Update from generic
+	version.
+
 2008-04-21  Khem Raj  <kraj@mvista.com>
 
 	* sysdeps/unix/sysv/linux/arm/ioperm.c: Don't include asm/page.h.
diff --git a/sysdeps/unix/sysv/linux/arm/check_pf.c b/sysdeps/unix/sysv/linux/arm/check_pf.c
index dfca75d..209f364 100644
--- a/sysdeps/unix/sysv/linux/arm/check_pf.c
+++ b/sysdeps/unix/sysv/linux/arm/check_pf.c
@@ -1,5 +1,5 @@
 /* Determine protocol families for which interfaces exist.  Linux version.
-   Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007, 2008 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
@@ -35,12 +35,12 @@
 #include <kernel-features.h>
 
 
-#ifndef IFA_F_TEMPORARY
-# define IFA_F_TEMPORARY IFA_F_SECONDARY
-#endif
 #ifndef IFA_F_HOMEADDRESS
 # define IFA_F_HOMEADDRESS 0
 #endif
+#ifndef IFA_F_OPTIMISTIC
+# define IFA_F_OPTIMISTIC 0
+#endif
 
 
 static int
@@ -140,89 +140,67 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
 	      struct rtattr *rta = IFA_RTA (ifam);
 	      size_t len = nlmh->nlmsg_len - NLMSG_LENGTH (sizeof (*ifam));
 
-	      switch (ifam->ifa_family)
-		{
-		  const void *local;
-		  const void *address;
+	      if (ifam->ifa_family != AF_INET
+		  && ifam->ifa_family != AF_INET6)
+		continue;
 
-		case AF_INET:
-		  local = NULL;
-		  address = NULL;
-		  while (RTA_OK (rta, len))
+	      const void *local = NULL;
+	      const void *address = NULL;
+	      while (RTA_OK (rta, len))
+		{
+		  switch (rta->rta_type)
 		    {
-		      switch (rta->rta_type)
-			{
-			case IFA_LOCAL:
-			  local = RTA_DATA (rta);
-			  break;
-
-			case IFA_ADDRESS:
-			  address = RTA_DATA (rta);
-			  goto out_v4;
-			}
-
-		      rta = RTA_NEXT (rta, len);
+		    case IFA_LOCAL:
+		      local = RTA_DATA (rta);
+		      break;
+
+		    case IFA_ADDRESS:
+		      address = RTA_DATA (rta);
+		      goto out;
 		    }
 
-		  if (local != NULL)
+		  rta = RTA_NEXT (rta, len);
+		}
+
+	      if (local != NULL)
+		{
+		  address = local;
+		out:
+		  if (ifam->ifa_family == AF_INET)
 		    {
-		    out_v4:
-		      if (*(const in_addr_t *) (address ?: local)
+		      if (*(const in_addr_t *) address
 			  != htonl (INADDR_LOOPBACK))
 			*seen_ipv4 = true;
 		    }
-		  break;
-
-		case AF_INET6:
-		  local = NULL;
-		  address = NULL;
-		  while (RTA_OK (rta, len))
-		    {
-		      switch (rta->rta_type)
-			{
-			case IFA_LOCAL:
-			  local = RTA_DATA (rta);
-			  break;
-
-			case IFA_ADDRESS:
-			  address = RTA_DATA (rta);
-			  goto out_v6;
-			}
-
-		      rta = RTA_NEXT (rta, len);
-		    }
-
-		  if (local != NULL)
+		  else
 		    {
-		    out_v6:
-		      if (!IN6_IS_ADDR_LOOPBACK (address ?: local))
+		      if (!IN6_IS_ADDR_LOOPBACK (address))
 			*seen_ipv6 = true;
 		    }
+		}
 
-		  if (ifam->ifa_flags & (IFA_F_DEPRECATED
-					 | IFA_F_TEMPORARY
-					 | IFA_F_HOMEADDRESS))
-		    {
-		      struct in6ailist *newp = alloca (sizeof (*newp));
-		      newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
-					   ? in6ai_deprecated : 0)
-					  | ((ifam->ifa_flags
-					      & IFA_F_TEMPORARY)
-					     ? in6ai_temporary : 0)
-					  | ((ifam->ifa_flags
-					      & IFA_F_HOMEADDRESS)
-					     ? in6ai_homeaddress : 0));
-		      memcpy (newp->info.addr, address ?: local,
-			      sizeof (newp->info.addr));
-		      newp->next = in6ailist;
-		      in6ailist = newp;
-		      ++in6ailistlen;
-		    }
-		  break;
-		default:
-		  /* Ignore.  */
-		  break;
+	      struct in6ailist *newp = alloca (sizeof (*newp));
+	      newp->info.flags = (((ifam->ifa_flags
+				    & (IFA_F_DEPRECATED
+				       | IFA_F_OPTIMISTIC))
+				   ? in6ai_deprecated : 0)
+				  | ((ifam->ifa_flags
+				      & IFA_F_HOMEADDRESS)
+				     ? in6ai_homeaddress : 0));
+	      newp->info.prefixlen = ifam->ifa_prefixlen;
+	      newp->info.index = ifam->ifa_index;
+	      if (ifam->ifa_family == AF_INET)
+		{
+		  newp->info.addr[0] = 0;
+		  newp->info.addr[1] = 0;
+		  newp->info.addr[2] = htonl (0xffff);
+		  newp->info.addr[3] = *(const in_addr_t *) address;
 		}
+	      else
+		memcpy (newp->info.addr, address, sizeof (newp->info.addr));
+	      newp->next = in6ailist;
+	      in6ailist = newp;
+	      ++in6ailistlen;
 	    }
 	  else if (nlmh->nlmsg_type == NLMSG_DONE)
 	    /* We found the end, leave the loop.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=89e412f53587908cb894a98bea8966db6fe820e3

commit 89e412f53587908cb894a98bea8966db6fe820e3
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Apr 21 15:45:00 2008 +0000

    	* sysdeps/unix/sysv/linux/hppa/bits/shm.h: Fix comment describing
    	shmid_ds.
    
    	* sysdeps/unix/sysv/linux/mips/bits/shm.h: Fix comment describing
    	shmid_ds.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index d46a0e0..1bc6138 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,8 @@
+2008-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/shm.h: Fix comment describing
+	shmid_ds.
+
 2008-04-04  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Remove
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 9e8fb04..b4253d8 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/shm.h: Fix comment describing
+	shmid_ds.
+
 2008-04-21  Khem Raj  <kraj@mvista.com>
 
 	* sysdeps/unix/sysv/linux/mips/xmknod.c: Delete file.
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/shm.h b/sysdeps/unix/sysv/linux/hppa/bits/shm.h
index a91f1f5..13efced 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/shm.h
@@ -42,7 +42,7 @@
 /* Type to count number of attaches.  */
 typedef unsigned long int shmatt_t;
 
-/* Data structure describing a set of semaphores.  */
+/* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
     struct ipc_perm shm_perm;		/* operation permission struct */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h
index b308334..037980c 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/shm.h
@@ -42,7 +42,7 @@
 /* Type to count number of attaches.  */
 typedef unsigned long int shmatt_t;
 
-/* Data structure describing a set of semaphores.  */
+/* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
     struct ipc_perm shm_perm;		/* operation permission struct */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=93ae51192837ed1f2a284819640d2b08fef68436

commit 93ae51192837ed1f2a284819640d2b08fef68436
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Apr 21 15:41:06 2008 +0000

    2008-04-21  Khem Raj  <kraj@mvista.com>
    
    	* sysdeps/unix/sysv/linux/mips/xmknod.c: Delete file.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index cbc72ef..9e8fb04 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,7 @@
+2008-04-21  Khem Raj  <kraj@mvista.com>
+
+	* sysdeps/unix/sysv/linux/mips/xmknod.c: Delete file.
+
 2008-04-02  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add 
diff --git a/sysdeps/unix/sysv/linux/mips/xmknod.c b/sysdeps/unix/sysv/linux/mips/xmknod.c
deleted file mode 100644
index 2d09752..0000000
--- a/sysdeps/unix/sysv/linux/mips/xmknod.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* xmknod call using old-style Unix mknod system call.
-   Copyright (C) 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2002, 2003
-   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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/sysmacros.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-/* Create a device file named PATH, with permission and special bits MODE
-   and device number DEV (which can be constructed from major and minor
-   device numbers with the `makedev' macro above).  */
-int
-__xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
-{
-  unsigned long k_dev;
-
-  if (vers != _MKNOD_VER)
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  /* We must convert the value to dev_t type used by the kernel.  */
-  k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff);
-
-  return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode, k_dev);
-}
-
-weak_alias (__xmknod, _xmknod)
-libc_hidden_def (__xmknod)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b5af13f121890eba73405e47e0b5fbbf6ecfa0cd

commit b5af13f121890eba73405e47e0b5fbbf6ecfa0cd
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Apr 21 15:37:36 2008 +0000

    2008-04-21  Khem Raj  <kraj@mvista.com>
    
    	* sysdeps/unix/sysv/linux/arm/ioperm.c: Don't include asm/page.h.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 661a68c..7a5ac15 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2008-04-21  Khem Raj  <kraj@mvista.com>
+
+	* sysdeps/unix/sysv/linux/arm/ioperm.c: Don't include asm/page.h.
+
 2008-04-21  Mike Frysinger  <vapier@gentoo.org>
 
 	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (DOCARGS_6,
diff --git a/sysdeps/unix/sysv/linux/arm/ioperm.c b/sysdeps/unix/sysv/linux/arm/ioperm.c
index 65ec077..1fa849d 100644
--- a/sysdeps/unix/sysv/linux/arm/ioperm.c
+++ b/sysdeps/unix/sysv/linux/arm/ioperm.c
@@ -45,7 +45,6 @@
 #include <sys/mman.h>
 
 #include <linux/version.h>
-#include <asm/page.h>
 #include <sys/sysctl.h>
 
 #define PATH_ARM_SYSTYPE	"/etc/arm_systype"

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e6e41f0f4963bfb0c0e32f8263ae028b288b5453

commit e6e41f0f4963bfb0c0e32f8263ae028b288b5453
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Apr 21 15:34:31 2008 +0000

    2008-04-21  Mike Frysinger  <vapier@gentoo.org>
    
    	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (DOCARGS_6,
    	UNDOCARGS_6): Define.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 5155ce5..661a68c 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2008-04-21  Mike Frysinger  <vapier@gentoo.org>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (DOCARGS_6,
+	UNDOCARGS_6): Define.
+
 2008-04-21  Khem Raj  <kraj@mvista.com>
 
 	* sysdeps/unix/sysv/linux/arm/bits/shm.h: New file.
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 3fb2186..9c80771 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -73,6 +73,9 @@
 # define DOCARGS_5	DOCARGS_4
 # define UNDOCARGS_5	UNDOCARGS_4
 
+# define DOCARGS_6	DOCARGS_5
+# define UNDOCARGS_6	UNDOCARGS_5
+
 # ifdef IS_IN_libpthread
 #  define CENABLE	bl PLTJMP(__pthread_enable_asynccancel)
 #  define CDISABLE	bl PLTJMP(__pthread_disable_asynccancel)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e8d992d7089fab171c9c60fd6a313814f1ff58ee

commit e8d992d7089fab171c9c60fd6a313814f1ff58ee
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Apr 21 15:26:44 2008 +0000

    2008-04-21  Khem Raj  <kraj@mvista.com>
    
    	* sysdeps/unix/sysv/linux/arm/bits/shm.h: New file.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 2ed314c..5155ce5 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2008-04-21  Khem Raj  <kraj@mvista.com>
+
+	* sysdeps/unix/sysv/linux/arm/bits/shm.h: New file.
+
 2008-04-11  Paul Brook  <paul@codesourcery.com>
 	    Sandra Loosemore  <sandra@codesourcery.com>
 
diff --git a/sysdeps/unix/sysv/linux/arm/bits/shm.h b/sysdeps/unix/sysv/linux/arm/bits/shm.h
new file mode 100644
index 0000000..4faa287
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/bits/shm.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 1995,1996,1997,2000,2002,2004,2008
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget.  */
+#define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
+#define SHM_W		0200		/* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'.  */
+#define SHM_RDONLY	010000		/* attach read-only else read-write */
+#define SHM_RND		020000		/* round attach address to SHMLBA */
+#define SHM_REMAP	040000		/* take-over region on attach */
+
+/* Commands for `shmctl'.  */
+#define SHM_LOCK	11		/* lock segment (root only) */
+#define SHM_UNLOCK	12		/* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		(__getpagesize () << 2)
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches.  */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a shared memory segment.  */
+struct shmid_ds
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    size_t shm_segsz;			/* size of segment in bytes */
+    __time_t shm_atime;			/* time of last shmat() */
+    unsigned long int __unused1;
+    __time_t shm_dtime;			/* time of last shmdt() */
+    unsigned long int __unused2;
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    unsigned long int __unused3;
+    __pid_t shm_cpid;			/* pid of creator */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    shmatt_t shm_nattch;		/* number of current attaches */
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 	13
+# define SHM_INFO 	14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST	01000	/* segment will be destroyed on last detach */
+# define SHM_LOCKED	02000   /* segment will not be swapped */
+# define SHM_HUGETLB	04000	/* segment is mapped via hugetlb */
+# define SHM_NORESERVE	010000	/* don't check for reservations */
+
+struct	shminfo
+  {
+    unsigned long int shmmax;
+    unsigned long int shmmin;
+    unsigned long int shmmni;
+    unsigned long int shmseg;
+    unsigned long int shmall;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+    unsigned long int __unused3;
+    unsigned long int __unused4;
+  };
+
+struct shm_info
+  {
+    int used_ids;
+    unsigned long int shm_tot;	/* total allocated shm */
+    unsigned long int shm_rss;	/* total resident shm */
+    unsigned long int shm_swp;	/* total swapped shm */
+    unsigned long int swap_attempts;
+    unsigned long int swap_successes;
+  };
+
+#endif /* __USE_MISC */
+
+__END_DECLS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5f1d477bb4d11eef7be502c79cb8852122ec38d1

commit 5f1d477bb4d11eef7be502c79cb8852122ec38d1
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Apr 11 14:21:43 2008 +0000

    2008-04-11  Paul Brook  <paul@codesourcery.com>
    	    Sandra Loosemore  <sandra@codesourcery.com>
    
    	* sysdeps/arm/eabi/machine-gmon.h: New file.
    	* sysdeps/arm/eabi/Versions: Add __gnu_mcount_nc.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index f23b2b9..2ed314c 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2008-04-11  Paul Brook  <paul@codesourcery.com>
+	    Sandra Loosemore  <sandra@codesourcery.com>
+
+	* sysdeps/arm/eabi/machine-gmon.h: New file.
+	* sysdeps/arm/eabi/Versions: Add __gnu_mcount_nc.
+
 2007-12-21  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/profil-counter.h: Use the i386 version.
diff --git a/sysdeps/arm/eabi/Versions b/sysdeps/arm/eabi/Versions
index ca51099..5f2af29 100644
--- a/sysdeps/arm/eabi/Versions
+++ b/sysdeps/arm/eabi/Versions
@@ -14,4 +14,7 @@ libc {
     # Helper routines
     __gnu_Unwind_Find_exidx;
   }
+  GLIBC_2.8 {
+    __gnu_mcount_nc;
+  }
 }
diff --git a/sysdeps/arm/eabi/machine-gmon.h b/sysdeps/arm/eabi/machine-gmon.h
new file mode 100644
index 0000000..189a9a3
--- /dev/null
+++ b/sysdeps/arm/eabi/machine-gmon.h
@@ -0,0 +1,99 @@
+/* Machine-dependent definitions for profiling support.  ARM EABI version.
+   Copyright (C) 2008 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* GCC for the ARM cannot compile __builtin_return_address(N) for N != 0, 
+   so we must use an assembly stub.  */
+
+#include <sysdep.h>
+static void mcount_internal (u_long frompc, u_long selfpc) __attribute_used__;
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+static void mcount_internal (u_long frompc, u_long selfpc)
+
+/* Use an assembly stub with a special ABI.  The calling lr has been
+   pushed to the stack (which will be misaligned).  We should preserve
+   all registers except ip and pop a word off the stack.
+
+   NOTE: This assumes mcount_internal does not clobber any non-core
+   (coprocessor) registers.  Currently this is true, but may require
+   additional attention in the future.
+
+   The calling sequence looks something like:
+func:
+   push {lr}
+   bl __gnu_mount_nc
+   <function body>
+ */
+
+
+#define MCOUNT								\
+void __attribute__((__naked__)) __gnu_mcount_nc(void)			\
+{									\
+    asm ("push {r0, r1, r2, r3, lr}\n\t"				\
+	 "bic r1, lr, #1\n\t"						\
+	 "ldr r0, [sp, #20]\n\t"					\
+	 "bl mcount_internal\n\t"					\
+	 "pop {r0, r1, r2, r3, ip, lr}\n\t"				\
+	 "bx ip");							\
+}									\
+OLD_MCOUNT
+
+/* Provide old mcount for backwards compatibility.  This requires
+   code be compiled with APCS frame pointers.  */
+
+#ifndef NO_UNDERSCORES
+/* The asm symbols for C functions are `_function'.
+   The canonical name for the counter function is `mcount', no _.  */
+void _mcount (void) asm ("mcount");
+#else
+/* The canonical name for the function is `_mcount' in both C and asm,
+   but some old asm code might assume it's `mcount'.  */
+void _mcount (void);
+weak_alias (_mcount, mcount)
+#endif
+
+#ifdef __thumb2__
+
+#define OLD_MCOUNT							\
+void __attribute__((__naked__)) _mcount (void)				\
+{									\
+  __asm__("push		{r0, r1, r2, r3, fp, lr};"			\
+	  "movs		r0, fp;"					\
+	  "ittt		ne;"						\
+	  "ldrne	r0, [r0, #-4];"					\
+	  "movsne	r1, lr;"					\
+	  "blne		mcount_internal;"				\
+	  "pop		{r0, r1, r2, r3, fp, pc}");			\
+}
+
+#else
+
+#define OLD_MCOUNT							\
+void __attribute__((__naked__)) _mcount (void)				\
+{									\
+  __asm__("stmdb	sp!, {r0, r1, r2, r3, fp, lr};"			\
+	  "movs		fp, fp;"					\
+	  "ldrne	r0, [fp, #-4];"					\
+	  "movnes	r1, lr;"					\
+	  "blne		mcount_internal;"				\
+	  "ldmia	sp!, {r0, r1, r2, r3, fp, lr};"			\
+	  "bx		lr");						\
+}
+
+#endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f6fe80ef8d3f3ce12029ffabda3a01c465e0016b

commit f6fe80ef8d3f3ce12029ffabda3a01c465e0016b
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Apr 4 18:57:47 2008 +0000

    2008-04-04  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Remove
    	memory contraint and instead indicate that *mem is
    	written to.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index abe017e..d46a0e0 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2008-04-04  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Remove
+	memory contraint and instead indicate that *mem is
+	written to.
+
 2008-03-24  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/sys/user.h: New file.
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
index 92a309d..b8959f7 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -55,7 +55,7 @@ typedef uintmax_t uatomic_max_t;
 #define LWS "0xb0"
 #define LWS_CAS "0"
 /* Note r31 is the link register */
-#define LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
+#define LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31"
 #define ASM_EAGAIN "11" 
 
 #if __ASSUME_LWS_CAS
@@ -76,7 +76,7 @@ typedef uintmax_t uatomic_max_t;
 	"stw	%%r28, %0			\n\t"			\
         "sub	%%r0, %%r21, %%r21		\n\t"			\
 	"stw	%%r21, %1			\n\t"			\
-	: "=m" (lws_ret), "=m" (lws_errno), "=m" (*mem)			\
+	: "=m" (lws_ret), "=m" (lws_errno), "+m" (*mem)			\
         : "r" (mem), "r" (oldval), "r" (newval)				\
 	: LWS_CLOBBER							\
      );									\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7221ac034cb358fc823301b886621d36020813ab

commit 7221ac034cb358fc823301b886621d36020813ab
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Apr 2 12:58:39 2008 +0000

    2008-04-02  Aurelien Jarno  <aurelien@aurel32.net>
    
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add
    	truncate and ftruncate systems calls.
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: Make an
    	empty file.
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c: Ditto.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index a7a219e..cbc72ef 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,11 @@
+2008-04-02  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add 
+	truncate and ftruncate systems calls.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: Make an
+	empty file.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c: Ditto.
+
 2008-03-28  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h: Undefine
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c
index 42efcba..6e25b02 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c
@@ -1,28 +1 @@
-/* Copyright (C) 2003 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <sys/types.h>
-
-#include <sysdep.h>
-
-extern int ftruncate (int fd, off64_t length);
-
-int __ftruncate64 (int fd, off64_t length) {
-  return ftruncate (fd, length);
-}
-weak_alias (__ftruncate64, ftruncate64)
+/* Empty.  */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
index babdba0..2e4bed0 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
@@ -3,3 +3,5 @@
 readahead	-	readahead	i:iii	__readahead	readahead
 sync_file_range	-	sync_file_range	i:iiii	sync_file_range
 posix_fadvise	-	fadvise64	i:iiii	posix_fadvise
+ftruncate	-	ftruncate	i:ii	__ftruncate	ftruncate ftruncate64 __ftruncate64
+truncate	-	truncate	i:si	truncate	truncate64
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c
index 339023f..6e25b02 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c
@@ -1,30 +1 @@
-/* Copyright (C) 2003 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <sys/types.h>
-
-#include <sysdep.h>
-#include <bp-checks.h>
-
-extern int truncate (const char *__unbounded path, int dummy,
-		     off64_t length);
-
-int truncate64 (const char *__unbounded path, int dummy,
-		off64_t length) {
-  return truncate (path, dummy, length);
-}
+/* Empty.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=560bab76911818553f387db768b5c000b53cbbd3

commit 560bab76911818553f387db768b5c000b53cbbd3
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Mar 28 17:43:50 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h: Undefine
    	ARG_MAX if <linux/limits.h> has defined it.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 0ca16cc..a7a219e 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,4 +1,9 @@
-2008-03-27  Robin Randhawa  <robin@mips.com>
+2008-03-28  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h: Undefine
+	ARG_MAX if <linux/limits.h> has defined it.
+
+2008-03-28  Robin Randhawa  <robin@mips.com>
 
 	* sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Added memory
 	barriers to enforce strict ordering on weakly ordered systems.
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h b/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h
index 4c3f5f6..c6fae63 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h
@@ -1,5 +1,5 @@
 /* Minimum guaranteed maximum values for system limits.  MIPS Linux version.
-   Copyright (C) 1993-1998,2000,2002,2003,2004,2007
+   Copyright (C) 1993-1998,2000,2002,2003,2004,2007,2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -32,6 +32,9 @@
 #ifndef OPEN_MAX
 # define __undef_OPEN_MAX
 #endif
+#ifndef ARG_MAX
+# define __undef_ARG_MAX
+#endif
 
 /* The kernel sources contain a file with all the needed information.  */
 #include <linux/limits.h>
@@ -51,6 +54,11 @@
 # undef OPEN_MAX
 # undef __undef_OPEN_MAX
 #endif
+/* Have to remove ARG_MAX?  */
+#ifdef __undef_ARG_MAX
+# undef ARG_MAX
+# undef __undef_ARG_MAX
+#endif
 
 /* The number of data keys per process.  */
 #define _POSIX_THREAD_KEYS_MAX	128

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=625680f978077a09e210e5dcfc66e5700db26dad

commit 625680f978077a09e210e5dcfc66e5700db26dad
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Mar 28 17:41:20 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Added memory
    	barriers to enforce strict ordering on weakly ordered systems.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 711f23b..0ca16cc 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-03-27  Robin Randhawa  <robin@mips.com>
+
+	* sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Added memory
+	barriers to enforce strict ordering on weakly ordered systems.
+
 2008-03-26  David Stephenson  <david.stephenson@sicortex.com>
 	    Daniel Jacobowitz  <dan@codesourcery.com>
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/tas.h b/sysdeps/unix/sysv/linux/mips/sys/tas.h
index 309438d..b370ee4 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/tas.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/tas.h
@@ -40,17 +40,19 @@ __NTH (_test_and_set (int *p, int v))
 
   __asm__ __volatile__
     ("/* Inline test and set */\n"
-     "1:\n\t"
      ".set	push\n\t"
 #if _MIPS_SIM == _ABIO32
      ".set	mips2\n\t"
 #endif
+     "sync\n\t"
+     "1:\n\t"
      "ll	%0,%3\n\t"
      "move	%1,%4\n\t"
      "beq	%0,%4,2f\n\t"
      "sc	%1,%2\n\t"
-     ".set	pop\n\t"
      "beqz	%1,1b\n"
+     "sync\n\t"
+     ".set	pop\n\t"
      "2:\n\t"
      "/* End test and set */"
      : "=&r" (r), "=&r" (t), "=m" (*p)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=04d6ca32f128f2d5571bdeb36e34e306ec71e9f9

commit 04d6ca32f128f2d5571bdeb36e34e306ec71e9f9
Author: Andreas Schwab <schwab@suse.de>
Date:   Fri Mar 28 12:23:06 2008 +0000

    2008-03-28  Maxim Kuvyrkov  <maxim@codesourcery.com>
    
    	Explicitly get address of _DYNAMIC.
    	* sysdeps/m68k/dl-machine.h (elf_machine_dynamic): Retrieve _DYNAMIC
    	from GOT instead of assuming value at GOT pointer.

diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index 33323c6..b6aa316 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,9 @@
+2008-03-28  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+	Explicitly get address of _DYNAMIC.
+	* sysdeps/m68k/dl-machine.h (elf_machine_dynamic): Retrieve _DYNAMIC
+	from GOT instead of assuming value at GOT pointer.
+
 2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h
index fad1ef9..08a4396 100644
--- a/sysdeps/m68k/dl-machine.h
+++ b/sysdeps/m68k/dl-machine.h
@@ -33,14 +33,16 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
 }
 
 
-/* Return the link-time address of _DYNAMIC.  Conveniently, this is the
-   first element of the GOT.  This must be inlined in a function which
-   uses global data.  */
+/* Return the link-time address of _DYNAMIC.
+   This must be inlined in a function which uses global data.  */
 static inline Elf32_Addr
 elf_machine_dynamic (void)
 {
-  register Elf32_Addr *got asm ("%a5");
-  return *got;
+  Elf32_Addr addr;
+
+  asm ("move.l _DYNAMIC@GOT.w(%%a5), %0"
+       : "=a" (addr));
+  return addr;
 }
 
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=285e04f887a752cc2ad7d74f89956894ac1ac82b

commit 285e04f887a752cc2ad7d74f89956894ac1ac82b
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Mar 27 16:23:14 2008 +0000

    Remove open system call.

diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 7b3f233..de2c3ce 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -17,8 +17,6 @@ sigstack	-	sigstack	2	sigstack
 vfork		-	vfork		0	__vfork		vfork
 
 getpriority	-	getpriority	i:ii	__getpriority	getpriority
-open		-	open		Ci:siv	__libc_open	__open open !__libc_open64 __open64 open64
-open64		open	-
 
 # proper socket implementations:
 accept		-	accept		Ci:iBN	__libc_accept	__accept accept

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=595cb734b2d4daba98ce8d092b98a04fa944e447

commit 595cb734b2d4daba98ce8d092b98a04fa944e447
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Mar 27 15:19:41 2008 +0000

    Undefined ARG_MAX if <linux/limits.h> has defined it.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h b/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h
index 9b27b1f..a7c9740 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h
@@ -1,5 +1,5 @@
 /* Minimum guaranteed maximum values for system limits.  Linux/Alpha version.
-   Copyright (C) 1993-1998,2000,2002,2003,2004 Free Software Foundation, Inc.
+   Copyright (C) 1993-1998,2000,2002-2004,2008 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
@@ -31,6 +31,9 @@
 #ifndef OPEN_MAX
 # define __undef_OPEN_MAX
 #endif
+#ifndef ARG_MAX
+# define __undef_ARG_MAX
+#endif
 
 /* The kernel sources contain a file with all the needed information.  */
 #include <linux/limits.h>
@@ -50,6 +53,11 @@
 # undef OPEN_MAX
 # undef __undef_OPEN_MAX
 #endif
+/* Have to remove ARG_MAX?  */
+#ifdef __undef_ARG_MAX
+# undef ARG_MAX
+# undef __undef_ARG_MAX
+#endif
 
 /* The number of data keys per process.  */
 #define _POSIX_THREAD_KEYS_MAX	128

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=af7eda0ff6ca16406e8caab1ba2e97d03afc425e

commit af7eda0ff6ca16406e8caab1ba2e97d03afc425e
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Mar 26 13:21:26 2008 +0000

    	* sysdeps/mips/fpu/fesetround.c (fesetround): Use fpu_control_t.
    	* sysdeps/mips/fpu/fgetexcptflg.c (fegetexceptflag): Likewise.
    	* sysdeps/mips/fpu/fsetexcptflg.c (fesetexceptflag): Likewise.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 16cdc48..711f23b 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,10 @@
+2008-03-26  David Stephenson  <david.stephenson@sicortex.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/mips/fpu/fesetround.c (fesetround): Use fpu_control_t.
+	* sysdeps/mips/fpu/fgetexcptflg.c (fegetexceptflag): Likewise.
+	* sysdeps/mips/fpu/fsetexcptflg.c (fesetexceptflag): Likewise.
+
 2008-03-09  Andreas Jaeger  <aj@suse.de>
 
 	[BZ #5753]
diff --git a/sysdeps/mips/fpu/fesetround.c b/sysdeps/mips/fpu/fesetround.c
index 9477109..c28bd60 100644
--- a/sysdeps/mips/fpu/fesetround.c
+++ b/sysdeps/mips/fpu/fesetround.c
@@ -24,7 +24,7 @@
 int
 fesetround (int round)
 {
-  unsigned short int cw;
+  fpu_control_t cw;
 
   if ((round & ~0x3) != 0)
     /* ROUND is no valid rounding mode.  */
diff --git a/sysdeps/mips/fpu/fgetexcptflg.c b/sysdeps/mips/fpu/fgetexcptflg.c
index 3412159..27875b3 100644
--- a/sysdeps/mips/fpu/fgetexcptflg.c
+++ b/sysdeps/mips/fpu/fgetexcptflg.c
@@ -24,7 +24,7 @@
 int
 fegetexceptflag (fexcept_t *flagp, int excepts)
 {
-  fexcept_t temp;
+  fpu_control_t temp;
 
   /* Get the current exceptions.  */
   _FPU_GETCW (temp);
diff --git a/sysdeps/mips/fpu/fsetexcptflg.c b/sysdeps/mips/fpu/fsetexcptflg.c
index c65d793..b129375 100644
--- a/sysdeps/mips/fpu/fsetexcptflg.c
+++ b/sysdeps/mips/fpu/fsetexcptflg.c
@@ -24,7 +24,7 @@
 int
 fesetexceptflag (const fexcept_t *flagp, int excepts)
 {
-  fexcept_t temp;
+  fpu_control_t temp;
 
   /* Get the current exceptions.  */
   _FPU_GETCW (temp);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b5186f3bbabfe7348cf8d060d974f9eaf42bb715

commit b5186f3bbabfe7348cf8d060d974f9eaf42bb715
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Mon Mar 24 13:07:56 2008 +0000

    2008-03-24  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/sys/user.h: New file.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 35a273e..abe017e 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,7 @@
+2008-03-24  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/sys/user.h: New file.
+
 2008-03-14  Carlos O'Donell  <carlos@codesourcery.com>
 	    Guy Martin <gmsoft@tuxicoman.be>
 
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/user.h b/sysdeps/unix/sysv/linux/hppa/sys/user.h
new file mode 100644
index 0000000..c871f1a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sys/user.h
@@ -0,0 +1 @@
+/* This file is not needed, but in practice gdb might try to include it.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ad9393f0e1261b33e04e01cf8b01858df640c9ff

commit ad9393f0e1261b33e04e01cf8b01858df640c9ff
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Mar 14 23:40:55 2008 +0000

    2008-03-14  Carlos O'Donell  <carlos@codesourcery.com>
    	    Guy Martin <gmsoft@tuxicoman.be>
    
    	[BZ #5923]
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Pass
    	timespec and futexp.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 8a51f8e..35a273e 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,10 @@
+2008-03-14  Carlos O'Donell  <carlos@codesourcery.com>
+	    Guy Martin <gmsoft@tuxicoman.be>
+
+	[BZ #5923]
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Pass 
+	timespec and futexp.
+
 2008-02-22  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/Makefile: Remove.
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index 522380e..ec907ae 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -111,7 +111,7 @@ typedef int lll_lock_t;
   lll_private_futex_timed_wait (futex, val, NULL)
 
 #ifdef __ASSUME_PRIVATE_FUTEX
-# define lll_private_futex_timed_wait(futex, val, timeout) \
+# define lll_private_futex_timed_wait(futexp, val, timespec) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2af06d0d3e6d8dedba11aacfad136b0372d9688c

commit 2af06d0d3e6d8dedba11aacfad136b0372d9688c
Author: Andreas Jaeger <aj@suse.de>
Date:   Mon Mar 10 06:20:30 2008 +0000

    	[BZ #5753]
    	* sysdeps/mips/ieee754.h: Use protected namespace
    	__BIG_ENDIAN/__LITTLE_ENDIAN.
    	Patch by Aurelien Jarno <aurelien@aurel32.net>.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index d73b218..16cdc48 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,10 @@
+2008-03-09  Andreas Jaeger  <aj@suse.de>
+
+	[BZ #5753]
+	* sysdeps/mips/ieee754.h: Use protected namespace
+	__BIG_ENDIAN/__LITTLE_ENDIAN.
+	Patch by Aurelien Jarno <aurelien@aurel32.net>.
+
 2008-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/siginfo.h (struct siginfo):
diff --git a/sysdeps/mips/ieee754.h b/sysdeps/mips/ieee754.h
index ed13de2..912e088 100644
--- a/sysdeps/mips/ieee754.h
+++ b/sysdeps/mips/ieee754.h
@@ -83,7 +83,7 @@ union ieee754_double
 	unsigned int mantissa1:32;
 #endif				/* Big endian.  */
 #if	__BYTE_ORDER == __LITTLE_ENDIAN
-# if	__FLOAT_WORD_ORDER == BIG_ENDIAN
+# if	__FLOAT_WORD_ORDER == __BIG_ENDIAN
 	unsigned int mantissa0:20;
 	unsigned int exponent:11;
 	unsigned int negative:1;
@@ -109,7 +109,7 @@ union ieee754_double
 	unsigned int mantissa0:19;
 	unsigned int mantissa1:32;
 #else
-# if	__FLOAT_WORD_ORDER == BIG_ENDIAN
+# if	__FLOAT_WORD_ORDER == __BIG_ENDIAN
 	unsigned int mantissa0:19;
 	unsigned int quiet_nan:1;
 	unsigned int exponent:11;
@@ -203,7 +203,7 @@ union ieee854_long_double
 	unsigned int mantissa1:32;
 #endif
 #if	__BYTE_ORDER == __LITTLE_ENDIAN
-# if	__FLOAT_WORD_ORDER == BIG_ENDIAN
+# if	__FLOAT_WORD_ORDER == __BIG_ENDIAN
 	unsigned int exponent:15;
 	unsigned int negative:1;
 	unsigned int empty:16;
@@ -232,7 +232,7 @@ union ieee854_long_double
 	unsigned int mantissa1:32;
 #endif
 #if	__BYTE_ORDER == __LITTLE_ENDIAN
-# if	__FLOAT_WORD_ORDER == BIG_ENDIAN
+# if	__FLOAT_WORD_ORDER == __BIG_ENDIAN
 	unsigned int exponent:15;
 	unsigned int negative:1;
 	unsigned int empty:16;
@@ -272,7 +272,7 @@ union ieee854_long_double
 	unsigned int mantissa1:32;
 #endif				/* Big endian.  */
 #if	__BYTE_ORDER == __LITTLE_ENDIAN
-# if	__FLOAT_WORD_ORDER == BIG_ENDIAN
+# if	__FLOAT_WORD_ORDER == __BIG_ENDIAN
 	unsigned int mantissa0:20;
 	unsigned int exponent:11;
 	unsigned int negative:1;
@@ -298,7 +298,7 @@ union ieee854_long_double
 	unsigned int mantissa0:19;
 	unsigned int mantissa1:32;
 #else
-# if	__FLOAT_WORD_ORDER == BIG_ENDIAN
+# if	__FLOAT_WORD_ORDER == __BIG_ENDIAN
 	unsigned int mantissa0:19;
 	unsigned int quiet_nan:1;
 	unsigned int exponent:11;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7812cbad411364ceea15e841ca26d14602644851

commit 7812cbad411364ceea15e841ca26d14602644851
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Mar 4 19:39:30 2008 +0000

    	* sysdeps/unix/sysv/linux/mips/bits/siginfo.h (struct siginfo):
    	Reorganize to match other architectures.  Replace _timer._timer1
    	and _timer._timer2 with _timer.si_tid, _timer.si_overrun, and
    	_timer.si_sigval.  Correct the type of _sigpoll.si_band.
    	(si_timerid, si_overrun): Define.
    	(__SIGEV_PAD_SIZE): Correct for __WORDSIZE == 64.
    	(__pthread_attr_s): Remove declaration.
    	(struct sigevent): Remove XXX.  Add _tid.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index ffbc344..d73b218 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,14 @@
+2008-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/siginfo.h (struct siginfo):
+	Reorganize to match other architectures.  Replace _timer._timer1
+	and _timer._timer2 with _timer.si_tid, _timer.si_overrun, and
+	_timer.si_sigval.  Correct the type of _sigpoll.si_band.
+	(si_timerid, si_overrun): Define.
+	(__SIGEV_PAD_SIZE): Correct for __WORDSIZE == 64.
+	(__pthread_attr_s): Remove declaration.
+	(struct sigevent): Remove XXX.  Add _tid.
+
 2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
diff --git a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h b/sysdeps/unix/sysv/linux/mips/bits/siginfo.h
index 787e365..e0fc81a 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/siginfo.h
@@ -1,5 +1,5 @@
 /* siginfo_t, sigevent and constants.  Linux/MIPS version.
-   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -70,6 +70,22 @@ typedef struct siginfo
 	    __uid_t si_uid;	/* Real user ID of sending process.  */
 	  } _kill;
 
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
 	/* SIGCHLD.  */
 	struct
 	  {
@@ -89,24 +105,9 @@ typedef struct siginfo
 	/* SIGPOLL.  */
 	struct
 	  {
-	    int si_band;	/* Band event for SIGPOLL.  */
+	    long int si_band;	/* Band event for SIGPOLL.  */
 	    int si_fd;
 	  } _sigpoll;
-
-	/* POSIX.1b timers.  */
-	struct
-	  {
-	    unsigned int _timer1;
-	    unsigned int _timer2;
-	  } _timer;
-
-	/* POSIX.1b signals.  */
-	struct
-	  {
-	    __pid_t si_pid;	/* Sending process ID.  */
-	    __uid_t si_uid;	/* Real user ID of sending process.  */
-	    sigval_t si_sigval;	/* Signal value.  */
-	  } _rt;
       } _sifields;
   } siginfo_t;
 
@@ -114,6 +115,8 @@ typedef struct siginfo
 /* X/Open requires some more fields with fixed names.  */
 # define si_pid		_sifields._kill.si_pid
 # define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
 # define si_status	_sifields._sigchld.si_status
 # define si_utime	_sifields._sigchld.si_utime
 # define si_stime	_sifields._sigchld.si_stime
@@ -265,12 +268,12 @@ enum
 
 /* Structure to transport application-defined values with signals.  */
 # define __SIGEV_MAX_SIZE	64
-# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-
-/* Forward declaration of the `pthread_attr_t' type.  */
-struct __pthread_attr_s;
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
 
-/* XXX This one might need to change!!!  */
 typedef struct sigevent
   {
     sigval_t sigev_value;
@@ -281,6 +284,10 @@ typedef struct sigevent
       {
 	int _pad[__SIGEV_PAD_SIZE];
 
+	/* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+	   thread to receive the signal.  */
+	__pid_t _tid;
+
 	struct
 	  {
 	    void (*_function) (sigval_t);	/* Function to start.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9d9e47980154846164712be8c40e97e56dc775e3

commit 9d9e47980154846164712be8c40e97e56dc775e3
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Sat Feb 23 01:18:18 2008 +0000

    2008-02-22  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/hppa/Makefile: Remove.
    	* sysdeps/hppa/nptl/Makefile: Set tst-oddstacklimit-ENV.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 3654fc7..8a51f8e 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,8 +1,13 @@
+2008-02-22  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/Makefile: Remove.
+	* sysdeps/hppa/nptl/Makefile: Set tst-oddstacklimit-ENV.
+
 2007-12-05  Jeff Bailey  <jeffbailey@google.com>
 
-       * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
-         (__lll_unlock): Use define instead of inline function.
-	 (__lll_robust_unlock): Likewise.
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+	(__lll_unlock): Use define instead of inline function.
+	(__lll_robust_unlock): Likewise.
 
 2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
diff --git a/sysdeps/hppa/nptl/Makefile b/sysdeps/hppa/nptl/Makefile
index 0300693..78d8973 100644
--- a/sysdeps/hppa/nptl/Makefile
+++ b/sysdeps/hppa/nptl/Makefile
@@ -19,3 +19,9 @@
 ifeq ($(subdir),csu)
 gen-as-const-headers += tcb-offsets.sym
 endif
+
+# This sets the stack resource limit to 8193kb, which is not a multiple
+# of the page size, and therefore an odd sized stack limit. We override
+# this because the default is too small to run with. 
+tst-oddstacklimit-ENV = ; ulimit -s 8193;
+
diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile
deleted file mode 100644
index 1c93ec5..0000000
--- a/sysdeps/unix/sysv/linux/hppa/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# linux/hppa does not use -lmilli anymore
-gnulib := -lgcc

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ec5d6360c4a781658af94cda9ad3c5d68d4ef699

commit ec5d6360c4a781658af94cda9ad3c5d68d4ef699
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Jan 16 23:49:27 2008 +0000

    Fix comment describing shmid_ds.

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/shm.h b/sysdeps/unix/sysv/linux/alpha/bits/shm.h
index 35226c1..cb214e6 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/shm.h
@@ -46,7 +46,7 @@ extern int __getpagesize (void) __THROW __attribute__ ((__const__));
 /* Type to count number of attaches.  */
 typedef unsigned long int shmatt_t;
 
-/* Data structure describing a set of semaphores.  */
+/* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
     struct ipc_perm shm_perm;		/* operation permission struct */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c206ce7f956abebed6ece651551d1da041984943

commit c206ce7f956abebed6ece651551d1da041984943
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Dec 21 16:57:47 2007 +0000

    	* sysdeps/unix/sysv/linux/arm/profil-counter.h: Use the i386 version.
    	* sysdeps/unix/sysv/linux/arm/register-dump.h (register_dump): Update
    	to use ucontext.
    	(REGISTER_DUMP): Likewise.
    	* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h (SIGCONTEXT,
    	SIGCONTEXT_EXTRA_ARGS, GET_PC, GET_FRAME, GET_STACK): Likewise.
    	(sigaction, __sigaction): Define.
    	* sysdeps/unix/sysv/linux/arm/bits/armsigctx.h: Delete.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 140a789..f23b2b9 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,14 @@
+2007-12-21  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/profil-counter.h: Use the i386 version.
+	* sysdeps/unix/sysv/linux/arm/register-dump.h (register_dump): Update
+	to use ucontext.
+	(REGISTER_DUMP): Likewise.
+	* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h (SIGCONTEXT,
+	SIGCONTEXT_EXTRA_ARGS, GET_PC, GET_FRAME, GET_STACK): Likewise.
+	(sigaction, __sigaction): Define.
+	* sysdeps/unix/sysv/linux/arm/bits/armsigctx.h: Delete.
+
 2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
diff --git a/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h b/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h
deleted file mode 100644
index 4530cdb..0000000
--- a/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Definition of `struct sigcontext' for Linux/ARM
-   Copyright (C) 1996, 1997, 1998, 1999, 2000 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* The format of struct sigcontext changed between 2.0 and 2.1 kernels.
-   Fortunately 2.0 puts a magic number in the first word and this is not
-   a legal value for `trap_no', so we can tell them apart.  */
-
-/* Early 2.2 and 2.3 kernels do not have the `fault_address' member in
-   the sigcontext structure.  Unfortunately there is no reliable way
-   to test for its presence and this word will contain garbage for too-old
-   kernels.  Versions 2.2.14 and 2.3.35 (plus later versions) are known to
-   include this element.  */
-
-#ifndef __ARMSIGCTX_H
-#define __ARMSIGCTX_H	1
-
-#include <asm/ptrace.h>
-
-union k_sigcontext
-  {
-    struct
-      {
-	unsigned long int trap_no;
-	unsigned long int error_code;
-	unsigned long int oldmask;
-	unsigned long int arm_r0;
-	unsigned long int arm_r1;
-	unsigned long int arm_r2;
-	unsigned long int arm_r3;
-	unsigned long int arm_r4;
-	unsigned long int arm_r5;
-	unsigned long int arm_r6;
-	unsigned long int arm_r7;
-	unsigned long int arm_r8;
-	unsigned long int arm_r9;
-	unsigned long int arm_r10;
-	unsigned long int arm_fp;
-	unsigned long int arm_ip;
-	unsigned long int arm_sp;
-	unsigned long int arm_lr;
-	unsigned long int arm_pc;
-	unsigned long int arm_cpsr;
-	unsigned long fault_address;
-      } v21;
-    struct
-      {
-	unsigned long int magic;
-	struct pt_regs reg;
-	unsigned long int trap_no;
-	unsigned long int error_code;
-	unsigned long int oldmask;
-      } v20;
-};
-
-#define SIGCONTEXT_2_0_MAGIC	0x4B534154
-
-#endif	/* bits/armsigctx.h */
diff --git a/sysdeps/unix/sysv/linux/arm/profil-counter.h b/sysdeps/unix/sysv/linux/arm/profil-counter.h
index 7639883..8a6a0bc 100644
--- a/sysdeps/unix/sysv/linux/arm/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/arm/profil-counter.h
@@ -1,37 +1,2 @@
-/* Low-level statistical profiling support function.  Linux/ARM version.
-   Copyright (C) 1996, 1997, 1998, 2002 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <signal.h>
-#include <bits/armsigctx.h>
-
-void
-profil_counter (int signo, int _a2, int _a3, int _a4, union k_sigcontext sc)
-{
-  void *pc;
-  if (sc.v20.magic == SIGCONTEXT_2_0_MAGIC)
-    pc = (void *) sc.v20.reg.ARM_pc;
-  else
-    pc = (void *) sc.v21.arm_pc;
-  profil_count (pc);
-
-  /* This is a hack to prevent the compiler from implementing the
-     above function call as a sibcall.  The sibcall would overwrite
-     the signal context.  */
-  asm volatile ("");
-}
+/* We can use the ix86 version.  */
+#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>
diff --git a/sysdeps/unix/sysv/linux/arm/register-dump.h b/sysdeps/unix/sysv/linux/arm/register-dump.h
index 2baccb2..73ec5fe 100644
--- a/sysdeps/unix/sysv/linux/arm/register-dump.h
+++ b/sysdeps/unix/sysv/linux/arm/register-dump.h
@@ -20,7 +20,7 @@
 
 #include <sys/uio.h>
 #include <stdio-common/_itoa.h>
-#include <bits/armsigctx.h>
+#include <sys/ucontext.h>
 
 /* We will print the register dump in this format:
 
@@ -45,7 +45,7 @@ hexvalue (unsigned long int value, char *buf, size_t len)
 }
 
 static void
-register_dump (int fd, union k_sigcontext *ctx)
+register_dump (int fd, const struct ucontext *ctx)
 {
   char regs[21][8];
   struct iovec iov[97];
@@ -61,53 +61,27 @@ register_dump (int fd, union k_sigcontext *ctx)
   ++nr
 
   /* Generate strings of register contents.  */
-  if (ctx->v20.magic == SIGCONTEXT_2_0_MAGIC)
-    {
-      hexvalue (ctx->v20.reg.ARM_r0, regs[0], 8);
-      hexvalue (ctx->v20.reg.ARM_r1, regs[1], 8);
-      hexvalue (ctx->v20.reg.ARM_r2, regs[2], 8);
-      hexvalue (ctx->v20.reg.ARM_r3, regs[3], 8);
-      hexvalue (ctx->v20.reg.ARM_r4, regs[4], 8);
-      hexvalue (ctx->v20.reg.ARM_r5, regs[5], 8);
-      hexvalue (ctx->v20.reg.ARM_r6, regs[6], 8);
-      hexvalue (ctx->v20.reg.ARM_r7, regs[7], 8);
-      hexvalue (ctx->v20.reg.ARM_r8, regs[8], 8);
-      hexvalue (ctx->v20.reg.ARM_r9, regs[9], 8);
-      hexvalue (ctx->v20.reg.ARM_r10, regs[10], 8);
-      hexvalue (ctx->v20.reg.ARM_fp, regs[11], 8);
-      hexvalue (ctx->v20.reg.ARM_ip, regs[12], 8);
-      hexvalue (ctx->v20.reg.ARM_sp, regs[13], 8);
-      hexvalue (ctx->v20.reg.ARM_lr, regs[14], 8);
-      hexvalue (ctx->v20.reg.ARM_pc, regs[15], 8);
-      hexvalue (ctx->v20.reg.ARM_cpsr, regs[16], 8);
-      hexvalue (ctx->v20.trap_no, regs[17], 8);
-      hexvalue (ctx->v20.error_code, regs[18], 8);
-      hexvalue (ctx->v20.oldmask, regs[19], 8);
-    }
-  else
-    {
-      hexvalue (ctx->v21.arm_r0, regs[0], 8);
-      hexvalue (ctx->v21.arm_r1, regs[1], 8);
-      hexvalue (ctx->v21.arm_r2, regs[2], 8);
-      hexvalue (ctx->v21.arm_r3, regs[3], 8);
-      hexvalue (ctx->v21.arm_r4, regs[4], 8);
-      hexvalue (ctx->v21.arm_r5, regs[5], 8);
-      hexvalue (ctx->v21.arm_r6, regs[6], 8);
-      hexvalue (ctx->v21.arm_r7, regs[7], 8);
-      hexvalue (ctx->v21.arm_r8, regs[8], 8);
-      hexvalue (ctx->v21.arm_r9, regs[9], 8);
-      hexvalue (ctx->v21.arm_r10, regs[10], 8);
-      hexvalue (ctx->v21.arm_fp, regs[11], 8);
-      hexvalue (ctx->v21.arm_ip, regs[12], 8);
-      hexvalue (ctx->v21.arm_sp, regs[13], 8);
-      hexvalue (ctx->v21.arm_lr, regs[14], 8);
-      hexvalue (ctx->v21.arm_pc, regs[15], 8);
-      hexvalue (ctx->v21.arm_cpsr, regs[16], 8);
-      hexvalue (ctx->v21.trap_no, regs[17], 8);
-      hexvalue (ctx->v21.error_code, regs[18], 8);
-      hexvalue (ctx->v21.oldmask, regs[19], 8);
-      hexvalue (ctx->v21.fault_address, regs[20], 8);
-    }
+  hexvalue (ctx->uc_mcontext.arm_r0, regs[0], 8);
+  hexvalue (ctx->uc_mcontext.arm_r1, regs[1], 8);
+  hexvalue (ctx->uc_mcontext.arm_r2, regs[2], 8);
+  hexvalue (ctx->uc_mcontext.arm_r3, regs[3], 8);
+  hexvalue (ctx->uc_mcontext.arm_r4, regs[4], 8);
+  hexvalue (ctx->uc_mcontext.arm_r5, regs[5], 8);
+  hexvalue (ctx->uc_mcontext.arm_r6, regs[6], 8);
+  hexvalue (ctx->uc_mcontext.arm_r7, regs[7], 8);
+  hexvalue (ctx->uc_mcontext.arm_r8, regs[8], 8);
+  hexvalue (ctx->uc_mcontext.arm_r9, regs[9], 8);
+  hexvalue (ctx->uc_mcontext.arm_r10, regs[10], 8);
+  hexvalue (ctx->uc_mcontext.arm_fp, regs[11], 8);
+  hexvalue (ctx->uc_mcontext.arm_ip, regs[12], 8);
+  hexvalue (ctx->uc_mcontext.arm_sp, regs[13], 8);
+  hexvalue (ctx->uc_mcontext.arm_lr, regs[14], 8);
+  hexvalue (ctx->uc_mcontext.arm_pc, regs[15], 8);
+  hexvalue (ctx->uc_mcontext.arm_cpsr, regs[16], 8);
+  hexvalue (ctx->uc_mcontext.trap_no, regs[17], 8);
+  hexvalue (ctx->uc_mcontext.error_code, regs[18], 8);
+  hexvalue (ctx->uc_mcontext.oldmask, regs[19], 8);
+  hexvalue (ctx->uc_mcontext.fault_address, regs[20], 8);
 
   /* Generate the output.  */
   ADD_STRING ("Register dump:\n\n R0: ");
@@ -150,11 +124,8 @@ register_dump (int fd, union k_sigcontext *ctx)
   ADD_MEM (regs[18], 8);
   ADD_STRING ("   OldMask: ");
   ADD_MEM (regs[19], 8);
-  if (ctx->v20.magic != SIGCONTEXT_2_0_MAGIC)
-    {
-      ADD_STRING ("\n Addr: ");
-      ADD_MEM (regs[20], 8);
-    }
+  ADD_STRING ("\n Addr: ");
+  ADD_MEM (regs[20], 8);
 
   ADD_STRING ("\n");
 
@@ -163,4 +134,4 @@ register_dump (int fd, union k_sigcontext *ctx)
 }
 
 
-#define REGISTER_DUMP register_dump (fd, &ctx)
+#define REGISTER_DUMP register_dump (fd, ctx)
diff --git a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
index 30c2e3a..72136fd 100644
--- a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
@@ -17,35 +17,34 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <bits/armsigctx.h>
+#include <sys/ucontext.h>
 #include "kernel-features.h"
 
-#define SIGCONTEXT int _a2, int _a3, int _a4, union k_sigcontext
-#define SIGCONTEXT_EXTRA_ARGS _a2, _a3, _a4,
+#define SIGCONTEXT siginfo_t *_si, struct ucontext *
+#define SIGCONTEXT_EXTRA_ARGS _si,
 
 /* The sigcontext structure changed between 2.0 and 2.1 kernels.  On any
    modern system we should be able to assume that the "new" format will be
    in use.  */
-#if __LINUX_KERNEL_VERSION > 131328
 
-#define GET_PC(ctx)	((void *) ctx.v21.arm_pc)
-#define GET_FRAME(ctx)	ADVANCE_STACK_FRAME ((void *) ctx.v21.arm_fp)
-#define GET_STACK(ctx)	((void *) ctx.v21.arm_sp)
-
-#else
-
-#define GET_PC(ctx)	((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
-			 ctx.v20.reg.ARM_pc : ctx.v21.arm_pc))
-#define GET_FRAME(ctx)	\
-	ADVANCE_STACK_FRAME((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
-			 ctx.v20.reg.ARM_fp : ctx.v21.arm_fp))
-#define GET_STACK(ctx)	((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
-			 ctx.v20.reg.ARM_sp : ctx.v21.arm_sp))
-
-#endif
+#define GET_PC(ctx)	((void *) (ctx)->uc_mcontext.arm_pc)
+#define GET_FRAME(ctx)	ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.arm_fp)
+#define GET_STACK(ctx)	((void *) (ctx)->uc_mcontext.arm_sp)
 
 #define ADVANCE_STACK_FRAME(frm)	\
 			((struct layout *)frm - 1)
 
 #define CALL_SIGHANDLER(handler, signo, ctx) \
   (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
+/* There is no reliable way to get the sigcontext unless we use a
+   three-argument signal handler.  */
+#define __sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (__sigaction) (sig, act, oact); \
+})
+
+#define sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (sigaction) (sig, act, oact); \
+})

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9cd7e988d349280d58188725337f0a9bf1b00157

commit 9cd7e988d349280d58188725337f0a9bf1b00157
Author: Jeff Bailey <jbailey@raspberryginger.com>
Date:   Sun Dec 9 02:20:34 2007 +0000

    2007-12-05  Jeff Bailey  <jeffbailey@google.com>
    
           * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
              (__lll_unlock): Use define instead of inline function.
              (__lll_robust_unlock): Likewise.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index cb1b815..3654fc7 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2007-12-05  Jeff Bailey  <jeffbailey@google.com>
+
+       * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+         (__lll_unlock): Use define instead of inline function.
+	 (__lll_robust_unlock): Likewise.
+
 2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index ae5fc1d..522380e 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -289,22 +289,20 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
 #define lll_robust_timedlock(futex, abstime, id, private) \
   __lll_robust_timedlock (&(futex), abstime, id, private)
 
-static inline void __attribute__ ((always_inline))
-__lll_unlock (lll_lock_t *futex, int private)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1, private);
-}
+#define __lll_unlock(futex, private) \
+  (void)					\
+  ({ int val = atomic_exchange_rel (futex, 0);  \
+     if (__builtin_expect (val > 1, 0))         \
+       lll_futex_wake (futex, 1, private);      \
+  })
 #define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
-static inline void __attribute__ ((always_inline))
-__lll_robust_unlock (int *futex, int private)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val & FUTEX_WAITERS, 0))
-    lll_futex_wake (futex, 1, private);
-}
+#define  __lll_robust_unlock(futex,private) \
+  (void)                                               \
+    ({ int val = atomic_exchange_rel (futex, 0);       \
+       if (__builtin_expect (val & FUTEX_WAITERS, 0))  \
+         lll_futex_wake (futex, 1, private);           \
+    })
 #define lll_robust_unlock(futex, private) \
   __lll_robust_unlock(&(futex), private)
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7e0bd9eb99b3de736ebc420fd88b27f0916271d2

commit 7e0bd9eb99b3de736ebc420fd88b27f0916271d2
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Oct 22 13:11:49 2007 +0000

    Define F_DUPFD_CLOEXEC.

diff --git a/ChangeLog.am33 b/ChangeLog.am33
index c10f8d0..e9b19bd 100644
--- a/ChangeLog.am33
+++ b/ChangeLog.am33
@@ -1,3 +1,7 @@
+2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/am33/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
+
 2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/am33/bits/fcntl.h: Comment fix.
diff --git a/ChangeLog.arm b/ChangeLog.arm
index bc5b67e..140a789 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,7 @@
+2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
+
 2007-09-25  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Correct return value
diff --git a/ChangeLog.cris b/ChangeLog.cris
index 746c89c..810b53b 100644
--- a/ChangeLog.cris
+++ b/ChangeLog.cris
@@ -1,3 +1,7 @@
+2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/cris/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
+
 2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/cris/bits/fcntl.h: Comment fix.
diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index ff92bf2..cb1b815 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,7 @@
+2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
+
 2007-10-18  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index fb591ad..33323c6 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,7 @@
+2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
+
 2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Comment fix.
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 3ecda0c..ffbc344 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,7 @@
+2007-10-22  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
+
 2007-09-25  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Correct return value
diff --git a/sysdeps/unix/sysv/linux/am33/bits/fcntl.h b/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
index f2c88fa..9a95318 100644
--- a/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
@@ -92,6 +92,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* For F_[GET|SET]FD.  */
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index bf0321f..10d11f2 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -98,6 +98,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* For F_[GET|SET]FD.  */
diff --git a/sysdeps/unix/sysv/linux/cris/bits/fcntl.h b/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
index 270a8de..e14ca25 100644
--- a/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
@@ -94,6 +94,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* For F_[GET|SET]FD.  */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
index 80cbbf4..ffc55a5 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -95,6 +95,8 @@
 # define F_SETLEASE     1024    /* Set a lease.  */
 # define F_GETLEASE     1025    /* Enquire what lease is active.  */
 # define F_NOTIFY       1026    /* Request notfications on a directory.  */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* for F_[GET|SET]FL */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
index 733a088..169a24b 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -93,6 +93,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* For F_[GET|SET]FD.  */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index f751886..e8107d7 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -100,6 +100,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* For F_[GET|SET]FD.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a732ab4917e138732abe67e7a3992238ec82ec7e

commit a732ab4917e138732abe67e7a3992238ec82ec7e
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Oct 19 01:47:47 2007 +0000

    2007-10-18  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
    	(__lll_lock_wait): Add private argument. Pass private
    	to lll_futex_wait. Use atomic_compare_and_exchange_val_acq.
    	(__lll_lock_wait_private): New function.
    	(__lll_timedlock_wait): Add private argument. Pass private
    	to lll_futex_timed_wait.
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
    	Include kernel-features.h and tls.h.
    	(FUTEX_WAITERS): Define.
    	(FUTEX_OWNER_DIED): Define.
    	(FUTEX_TID_MASK): Define.
    	(__lll_private_flag): Define.
    	(lll_futex_timed_wait): Use __lll_private_flag.
    	(lll_futex_wake): Use __lll_private_flag.
    	(lll_futex_requeue): Use __lll_private_flag.
    	(lll_robust_mutex_dead): Rename to...
    	(lll_robust_dead): ... this. Add private argument. Pass private
    	to lll_futex_wake.
    	(lll_futex_wake_unlock): Use __lll_private_flag.
    	(__lll_mutex_trylock): Remove.
    	(lll_mutex_tryock): Remove.
    	(__lll_robust_mutex_trylock): Rename to...
    	(__lll_robust_trylock): ... this.
    	(lll_robust_mutex_trylock): Rename to...
    	(lll_robust_trylock): ... this. Call __lll_robust_trylock.
    	(__lll_mutex_cond_trylock): Rename to...
    	(__lll_cond_trylock): ... this.
    	(lll_mutex_cond_trylock): Rename to...
    	(lll_cond_trylock): ... this. Call __lll_cond_trylock.
    	(__lll_mutex_lock): Add private argument.
    	(__lll_robust_mutex_lock): Remove.
    	(lll_mutex_lock): Define.
    	(__lll_robust_lock): Define.
    	(lll_robust_mutex_lock): Remove.
    	(__lll_mutex_cond_lock): Remove.
    	(lll_robust_lock) Define.
    	(lll_robust_cond_lock): Define.
    	(lll_robust_mutex_cond_lock): Remove.
    	(__lll_cond_lock): Define.
    	(lll_cond_lock): Define.
    	(__lll_mutex_timedlock): Remove.
    	(__lll_timedlock): Define.
    	(lll_timedlock): Define.
    	(lll_robust_mutex_timedlock): Remove.
    	(lll_robust_timedlock): Define.
    	(__lll_mutex_unlock): Remove.
    	(__lll_unlock): Define.
    	(__lll_robust_mutex_unlock): Remove.
    	(__lll_robust_unlock): Define.
    	(lll_robust_mutex_unlock): Remove.
    	(lll_robust_unlock): Define.
    	(__lll_mutex_unlock_force): Remove.
    	(lll_mutex_unlock_force): Remove.
    	(lll_islocked): Remove.
    	(lll_mutex_islocked): Rename to...
    	(lll_islocked): ... this.
    	(lll_trylock): Remove.
    	(lll_unlock): Remove.
    	(lll_wait_tid): Format whitespace.
    	(lll_cond_wait): Remove.
    	(lll_cond_timedwait): Remove.
    	(lll_cond_wake): Remove.
    	(lll_cond_broadcast): Remove.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index e5b7854..ff92bf2 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,69 @@
+2007-10-18  Carlos O'Donell  <carlos@systemhalted.org>
+
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+	(__lll_lock_wait): Add private argument. Pass private
+	to lll_futex_wait. Use atomic_compare_and_exchange_val_acq.
+	(__lll_lock_wait_private): New function.
+	(__lll_timedlock_wait): Add private argument. Pass private
+	to lll_futex_timed_wait.
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
+	Include kernel-features.h and tls.h.
+	(FUTEX_WAITERS): Define.
+	(FUTEX_OWNER_DIED): Define.
+	(FUTEX_TID_MASK): Define.
+	(__lll_private_flag): Define.
+	(lll_futex_timed_wait): Use __lll_private_flag.
+	(lll_futex_wake): Use __lll_private_flag.
+	(lll_futex_requeue): Use __lll_private_flag.
+	(lll_robust_mutex_dead): Rename to...
+	(lll_robust_dead): ... this. Add private argument. Pass private
+	to lll_futex_wake.
+	(lll_futex_wake_unlock): Use __lll_private_flag.
+	(__lll_mutex_trylock): Remove.
+	(lll_mutex_tryock): Remove.
+	(__lll_robust_mutex_trylock): Rename to...
+	(__lll_robust_trylock): ... this.
+	(lll_robust_mutex_trylock): Rename to...
+	(lll_robust_trylock): ... this. Call __lll_robust_trylock.
+	(__lll_mutex_cond_trylock): Rename to...
+	(__lll_cond_trylock): ... this.
+	(lll_mutex_cond_trylock): Rename to...
+	(lll_cond_trylock): ... this. Call __lll_cond_trylock.
+	(__lll_mutex_lock): Add private argument.
+	(__lll_robust_mutex_lock): Remove.
+	(lll_mutex_lock): Define.
+	(__lll_robust_lock): Define.
+	(lll_robust_mutex_lock): Remove.
+	(__lll_mutex_cond_lock): Remove.
+	(lll_robust_lock) Define.
+	(lll_robust_cond_lock): Define.
+	(lll_robust_mutex_cond_lock): Remove.
+	(__lll_cond_lock): Define.
+	(lll_cond_lock): Define.
+	(__lll_mutex_timedlock): Remove.
+	(__lll_timedlock): Define.
+	(lll_timedlock): Define.
+	(lll_robust_mutex_timedlock): Remove.
+	(lll_robust_timedlock): Define.
+	(__lll_mutex_unlock): Remove.
+	(__lll_unlock): Define.
+	(__lll_robust_mutex_unlock): Remove.
+	(__lll_robust_unlock): Define.
+	(lll_robust_mutex_unlock): Remove.
+	(lll_robust_unlock): Define.
+	(__lll_mutex_unlock_force): Remove.
+	(lll_mutex_unlock_force): Remove.
+	(lll_islocked): Remove.
+	(lll_mutex_islocked): Rename to...
+	(lll_islocked): ... this.
+	(lll_trylock): Remove.
+	(lll_unlock): Remove.
+	(lll_wait_tid): Format whitespace.
+	(lll_cond_wait): Remove.
+	(lll_cond_timedwait): Remove.
+	(lll_cond_wake): Remove.
+	(lll_cond_broadcast): Remove.
+
 2007-10-17  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Correct return value
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
index 236d29c..9c49640 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
@@ -23,22 +23,32 @@
 #include <lowlevellock.h>
 #include <sys/time.h>
 
-
 void
-__lll_lock_wait (lll_lock_t *futex)
+__lll_lock_wait (lll_lock_t *futex, int private)
 {
   do
     {
       int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
       if (oldval != 0)
-	lll_futex_wait (futex, 2, LLL_SHARED);
+	lll_futex_wait (futex, 2, private);
     }
-  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
+  while (atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0);
 }
 
+void
+__lll_lock_wait_private (lll_lock_t *futex)
+{
+  do
+    {
+      int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
+      if (oldval != 0)
+	lll_futex_wait (futex, 2, LLL_PRIVATE);
+    }
+  while (atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0);
+}
 
 int
-__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
+__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime, int private)
 {
   /* Reject invalid timeouts.  */
   if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
@@ -68,7 +78,7 @@ __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
       /* Wait.  */
       int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
       if (oldval != 0)
-	lll_futex_timed_wait (futex, 2, &rt, LLL_SHARED);
+	lll_futex_timed_wait (futex, 2, &rt, private);
     }
   while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
   return 0;
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index f8a9555..ae5fc1d 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -24,8 +24,10 @@
 #include <bits/pthreadtypes.h>
 #include <sysdep.h>
 #include <atomic.h>
+#include <kernel-features.h>	/* Need __ASSUME_PRIVATE_FUTEX.  */
+#include <tls.h>		/* Need THREAD_*, and header.*.  */
 
-/* The hppa only has one atomic read and modify memory operation,
+/* HPPA only has one atomic read and modify memory operation,
    load and clear, so hppa uses a kernel helper routine to implement
    compare_and_exchange. See atomic.h for the userspace calling
    sequence.  */
@@ -41,6 +43,11 @@
 #define FUTEX_TRYLOCK_PI	8
 #define FUTEX_PRIVATE_FLAG	128
 
+/* Bits used in robust mutex implementation.  */
+#define FUTEX_WAITERS		0x80000000
+#define FUTEX_OWNER_DIED	0x40000000
+#define FUTEX_TID_MASK		0x3fffffff
+
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be
    reversed before passing to the system call.  */
@@ -50,30 +57,54 @@
 /* Initialize locks to zero.  */
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
 
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private.  */
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+#  define __lll_private_flag(fl, private) \
+  ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+#  define __lll_private_flag(fl, private) \
+  (__builtin_constant_p (private)					      \
+   ? ((private) == 0							      \
+      ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))	      \
+      : (fl))								      \
+   : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
+	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif	      
+#endif
 
 /* Type for lock object.  */
 typedef int lll_lock_t;
 
-
 #define lll_futex_wait(futexp, val, private) \
   lll_futex_timed_wait (futexp, val, 0, private)
 
 #define lll_futex_timed_wait(futexp, val, timespec, private) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
-    __ret;								      \
+  ({									\
+    INTERNAL_SYSCALL_DECL (__err);					\
+    long int __ret;							\
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), 		\
+			      __lll_private_flag (FUTEX_WAIT, private),	\
+			      (val), (timespec));			\
+    __ret;								\
   })
 
 #define lll_futex_wake(futexp, nr, private) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAKE, (nr), 0);		      \
-    __ret;								      \
+  ({									\
+    INTERNAL_SYSCALL_DECL (__err);					\
+    long int __ret;							\
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		\
+			      __lll_private_flag (FUTEX_WAKE, private),	\
+			      (nr), 0);					\
+    __ret;								\
   })
 
 #define lll_private_futex_wait(futex, val) \
@@ -123,194 +154,186 @@ typedef int lll_lock_t;
   })
 #endif
 
+/* 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 __ret;							      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), 		      \
+			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
+			      (nr_wake), (nr_move), (mutex), (val));	      \
+    __ret;								      \
+  })
 
-
-#define lll_robust_mutex_dead(futexv) \
+#define lll_robust_dead(futexv, private) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1, 0);					      \
+      lll_futex_wake (__futexp, 1, private);				      \
     }									      \
   while (0)
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_CMP_REQUEUE, (nr_wake),	      \
-			      (nr_move), (mutex), (val));		      \
-    __ret;								      \
-  })
-
-/* 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 __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_WAKE_OP, (nr_wake),	      \
-			      (nr_wake2), (futexp2),			      \
-			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
-    __ret;								      \
+  ({									   \
+    INTERNAL_SYSCALL_DECL (__err);					   \
+    long int __ret;							   \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		   \
+			      __lll_private_flag (FUTEX_WAKE_OP, private), \
+			      (nr_wake), (nr_wake2), (futexp2),		   \
+			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		   \
+    __ret;								   \
   })
 
-static inline int __attribute__((always_inline))
-__lll_mutex_trylock(lll_lock_t *futex)
-{
-  return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
-}
-#define lll_mutex_trylock(lock)	__lll_mutex_trylock (&(lock))
-
-static inline int __attribute__((always_inline))
-__lll_robust_mutex_trylock(int *futex, int id)
+static inline int
+__attribute__ ((always_inline))
+__lll_robust_trylock (int *futex, int id)
 {
   return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0;
 }
-#define lll_robust_mutex_trylock(lock, id) \
-  __lll_robust_mutex_trylock (&(lock), id)
-
+#define lll_robust_trylock(futex, id) \
+  __lll_robust_trylock (&(futex), id)
 
-static inline int __attribute__((always_inline))
-__lll_mutex_cond_trylock(lll_lock_t *futex)
+static inline int
+__attribute__ ((always_inline))
+__lll_cond_trylock (int *futex)
 {
   return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
 }
-#define lll_mutex_cond_trylock(lock)	__lll_mutex_cond_trylock (&(lock))
+#define lll_cond_trylock(futex) __lll_cond_trylock (&(futex))
 
+static inline int
+__attribute__ ((always_inline))
+__lll_trylock (int *futex)
+{
+  return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
+}
+#define lll_trylock(futex) __lll_trylock (&(futex))
 
-extern void __lll_lock_wait (lll_lock_t *futex) attribute_hidden;
+extern void __lll_lock_wait (lll_lock_t *futex, int private) attribute_hidden;
+extern void __lll_lock_wait_private (lll_lock_t *futex) attribute_hidden;
 
 static inline void __attribute__((always_inline))
-__lll_mutex_lock(lll_lock_t *futex)
+__lll_mutex_lock(lll_lock_t *futex, int private)
 {
-  if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-    __lll_lock_wait (futex);
+  int val = atomic_compare_and_exchange_val_acq (futex, 1, 0);
+
+  if (__builtin_expect (val != 0, 0))
+    {
+      if (__builtin_constant_p (private) && private == LLL_PRIVATE)
+	__lll_lock_wait_private (futex);
+      else
+	__lll_lock_wait (futex, private);
+    }
 }
-#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
+#define lll_mutex_lock(futex, private) __lll_mutex_lock (&(futex), private)
+#define lll_lock(lock, private)	lll_mutex_lock (lock, private)
 
-extern int __lll_robust_lock_wait (int *futex) attribute_hidden;
+extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
 
-static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_lock (int *futex, int id)
+static inline int
+__attribute__ ((always_inline))
+__lll_robust_lock (int *futex, int id, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_lock_wait (futex);
+    result = __lll_robust_lock_wait (futex, private);
   return result;
 }
-#define lll_robust_mutex_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), id)
+#define lll_robust_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), id, private)
 
-static inline void __attribute__ ((always_inline))
-__lll_mutex_cond_lock (lll_lock_t *futex)
-{
-  if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
-    __lll_lock_wait (futex);
-}
-#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
+#define lll_robust_cond_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
 
+static inline void
+__attribute__ ((always_inline))
+__lll_cond_lock (int *futex, int private)
+{
+  int val = atomic_compare_and_exchange_val_acq (futex, 2, 0);
 
-#define lll_robust_mutex_cond_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
-
+  if (__builtin_expect (val != 0, 0))
+    __lll_lock_wait (futex, private);
+}
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
 
-extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *)
-	attribute_hidden;
-extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
+extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *, 
+				 int private) attribute_hidden;
+extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
+				 int private) attribute_hidden;
 
-static inline int __attribute__ ((always_inline))
-__lll_mutex_timedlock (lll_lock_t *futex, const struct timespec *abstime)
+static inline int
+__attribute__ ((always_inline))
+__lll_timedlock (int *futex, const struct timespec *abstime, int private)
 {
+  int val = atomic_compare_and_exchange_val_acq (futex, 1, 0);
   int result = 0;
-  if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-    result = __lll_timedlock_wait (futex, abstime);
+
+  if (__builtin_expect (val != 0, 0))
+    result = __lll_timedlock_wait (futex, abstime, private);
   return result;
 }
-#define lll_mutex_timedlock(futex, abstime) \
-  __lll_mutex_timedlock (&(futex), abstime)
+#define lll_timedlock(futex, abstime, private) \
+  __lll_timedlock (&(futex), abstime, private)
 
 static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime,
-			      int id)
+__lll_robust_timedlock (int *futex, const struct timespec *abstime,
+			      int id, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_timedlock_wait (futex, abstime);
+    result = __lll_robust_timedlock_wait (futex, abstime, private);
   return result;
 }
-#define lll_robust_mutex_timedlock(futex, abstime, id) \
-  __lll_robust_mutex_timedlock (&(futex), abstime, id)
-
+#define lll_robust_timedlock(futex, abstime, id, private) \
+  __lll_robust_timedlock (&(futex), abstime, id, private)
 
 static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock (lll_lock_t *futex)
+__lll_unlock (lll_lock_t *futex, int private)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1, 0);
+    lll_futex_wake (futex, 1, private);
 }
-#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
-
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
 static inline void __attribute__ ((always_inline))
-__lll_robust_mutex_unlock (int *futex, int mask)
+__lll_robust_unlock (int *futex, int private)
 {
   int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1, 0);
-}
-#define lll_robust_mutex_unlock(futex) \
-  __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
-
-
-static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock_force (lll_lock_t *futex)
-{
-  (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1, 0);
+  if (__builtin_expect (val & FUTEX_WAITERS, 0))
+    lll_futex_wake (futex, 1, private);
 }
-#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
+#define lll_robust_unlock(futex, private) \
+  __lll_robust_unlock(&(futex), private)
 
-#define lll_mutex_islocked(futex) \
+#define lll_islocked(futex) \
   (futex != 0)
 
 /* Our internal lock implementation is identical to the binary-compatible
-   mutex implementation. */
-
+   mutex implementation.  */
 #define LLL_LOCK_INITIALIZER (0)
 #define LLL_LOCK_INITIALIZER_CONST (0)
 #define LLL_LOCK_INITIALIZER_LOCKED (1)
 
-
 #define THREAD_INIT_LOCK(PD, LOCK) \
   (PD)->LOCK = LLL_LOCK_INITIALIZER
 
 extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
 
-/* The states of a lock are:
-    0  -  untaken
-    1  -  taken by one user
-   >1  -  taken by more users */
-
-#define lll_trylock(lock)	lll_mutex_trylock (lock)
-#define lll_lock(lock)		lll_mutex_lock (lock)
-#define lll_unlock(lock)	lll_mutex_unlock (lock)
-#define lll_islocked(lock)	lll_mutex_islocked (lock)
-
 /* The kernel notifies a process which uses CLONE_CLEARTID via futex
    wakeup when the clone terminates.  The memory location contains the
    thread ID while the clone is running and is reset to zero
    afterwards.	*/
 #define lll_wait_tid(tid) \
-  do {						\
-    __typeof (tid) __tid;			\
-    while ((__tid = (tid)) != 0)		\
-      lll_futex_wait (&(tid), __tid, 0);	\
-  } while (0)
+  do						\
+    {						\
+      __typeof (tid) __tid;			\
+      while ((__tid = (tid)) != 0)		\
+        lll_futex_wait (&(tid), __tid, 0);	\
+    }						\
+  while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)
      attribute_hidden;
@@ -323,26 +346,4 @@ extern int __lll_timedwait_tid (int *, const struct timespec *)
     __res;						\
   })
 
-
-/* Conditional variable handling.  */
-
-extern void __lll_cond_wait (pthread_cond_t *cond)
-     attribute_hidden;
-extern int __lll_cond_timedwait (pthread_cond_t *cond,
-				 const struct timespec *abstime)
-     attribute_hidden;
-extern void __lll_cond_wake (pthread_cond_t *cond)
-     attribute_hidden;
-extern void __lll_cond_broadcast (pthread_cond_t *cond)
-     attribute_hidden;
-
-#define lll_cond_wait(cond) \
-  __lll_cond_wait (cond)
-#define lll_cond_timedwait(cond, abstime) \
-  __lll_cond_timedwait (cond, abstime)
-#define lll_cond_wake(cond) \
-  __lll_cond_wake (cond)
-#define lll_cond_broadcast(cond) \
-  __lll_cond_broadcast (cond)
-
 #endif	/* lowlevellock.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d3fad32baf601770a164e6367d52a3da1a566f4d

commit d3fad32baf601770a164e6367d52a3da1a566f4d
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Thu Oct 18 02:19:00 2007 +0000

    2007-10-17  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Correct return value
    	type and __THROW marker of splice, vmsplice, and tee.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 9501c49..e5b7854 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,8 @@
+2007-10-17  Carlos O'Donell  <carlos@systemhalted.org>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Correct return value
+	type and __THROW marker of splice, vmsplice, and tee.
+
 2007-09-24  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/hppa/nptl/tls.h: Fix comment.
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
index 1bf6bcb..80cbbf4 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -207,17 +207,17 @@ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
 			    unsigned int __flags);
 
 /* Splice address range into a pipe.  */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
-		     unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, 
+			 size_t __count, unsigned int __flags);
 
 /* Splice two files together.  */
-extern int splice (int __fdin, __off64_t *offin, int __fdout, 
-		   __off64_t *__offout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t splice (int __fdin, __off64_t *offin, int __fdout, 
+		       __off64_t *__offout, size_t __len,
+		       unsigned int __flags);
 
 /* In-kernel implementation of tee for pipe buffers.  */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+		    unsigned int __flags);
     
 #endif
     

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=90e90b183d262e1ea8b3154699c730db84cc2187

commit 90e90b183d262e1ea8b3154699c730db84cc2187
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Oct 17 18:55:32 2007 +0000

    Define F_DUPFD_CLOEXEC.

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index 7c93183..710bace 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -93,6 +93,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set.  */
 #endif
 
 /* for F_[GET|SET]FD */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=017cc6330d0dcb4f315b93a8d612f4f67204b2b4

commit 017cc6330d0dcb4f315b93a8d612f4f67204b2b4
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Sep 25 12:04:54 2007 +0000

    	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Correct return value
    	type and __THROW marker of splice, vmsplice, and tee.
    
    	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Correct return value
    	type and __THROW marker of splice, vmsplice, and tee.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 8554fad..bc5b67e 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2007-09-25  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Correct return value
+	type and __THROW marker of splice, vmsplice, and tee.
+
 2007-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/kernel-features.h: Undefine
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 0e8fda4..3ecda0c 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2007-09-25  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Correct return value
+	type and __THROW marker of splice, vmsplice, and tee.
+
 2007-09-12  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Pass
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index 6fcc5c0..bf0321f 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -221,17 +221,17 @@ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
 
 
 /* Splice address range into a pipe.  */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
-		     unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+			 size_t __count, unsigned int __flags);
 
 /* Splice two files together.  */
-extern int splice (int __fdin, __off64_t *__offin, int __fdout,
-		   __off64_t *__offout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+		       __off64_t *__offout, size_t __len,
+		       unsigned int __flags);
 
 /* In-kernel implementation of tee for pipe buffers.  */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+		    unsigned int __flags);
 
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index 27af9ed..f751886 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -234,17 +234,17 @@ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
 
 
 /* Splice address range into a pipe.  */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
-		     unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+			 size_t __count, unsigned int __flags);
 
 /* Splice two files together.  */
-extern int splice (int __fdin, __off64_t *__offin, int __fdout,
-		   __off64_t *__offout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+		       __off64_t *__offout, size_t __len,
+		       unsigned int __flags);
 
 /* In-kernel implementation of tee for pipe buffers.  */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+		    unsigned int __flags);
 
 #endif
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cd1530839c0847f8060dd15f57c6419fba9f45a3

commit cd1530839c0847f8060dd15f57c6419fba9f45a3
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Mon Sep 24 18:28:33 2007 +0000

    2007-09-24  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/hppa/nptl/tls.h: Fix comment.
    	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Fix comment format.
    	[__USE_GNU] (O_CLOEXEC): Define.
    	* sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Issue error
    	if the library is unsupported.
    	[ASSEMBLER && IS_IN_librt]: Define CENABLE, CDISABLE, and
    	__local_multiple_threads.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 7bb3387..9501c49 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,13 @@
+2007-09-24  Carlos O'Donell  <carlos@systemhalted.org>
+
+	* sysdeps/hppa/nptl/tls.h: Fix comment.
+	* sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Fix comment format.
+	[__USE_GNU] (O_CLOEXEC): Define.
+	* sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Issue error
+	if the library is unsupported.
+	[ASSEMBLER && IS_IN_librt]: Define CENABLE, CDISABLE, and
+	__local_multiple_threads.
+
 2007-08-03  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h:
diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h
index d2d725e..2810d71 100644
--- a/sysdeps/hppa/nptl/tls.h
+++ b/sysdeps/hppa/nptl/tls.h
@@ -170,6 +170,6 @@ static inline void __set_cr27(struct pthread *cr27)
 #define THREAD_GSCOPE_WAIT() \
   GL(dl_wait_lookup_done) ()
 
-#endif /* __ASSEMBLER__ */
+#endif /* !__ASSEMBLER__ */
 
 #endif	/* tls.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
index 328df54..1bf6bcb 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -46,10 +46,11 @@
 
 
 #ifdef __USE_GNU
-# define O_DIRECT	00040000 /* Direct disk access. */
-# define O_DIRECTORY	00010000 /* Must be a directory. */
-# define O_NOFOLLOW	00000200 /* Do not follow links. */
-# define O_NOATIME	04000000 /* Do not set atime. */
+# define O_DIRECT	000040000 /* Direct disk access.  */
+# define O_DIRECTORY	000010000 /* Must be a directory.  */
+# define O_NOFOLLOW	000000200 /* Do not follow links.  */
+# define O_NOATIME	004000000 /* Do not set atime.  */
+# define O_CLOEXEC	010000000 /* Set close_on_exec.  */
 #endif
 
 #ifdef __USE_LARGEFILE64
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
index 375f732..6cffa76 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
@@ -173,7 +173,7 @@ L(pre_end):						ASM_LINE_SEP	\
 #   define CDISABLE	.import __libc_disable_asynccancel,code ASM_LINE_SEP \
 			bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
-# else
+# elif defined IS_IN_librt
 #  ifdef PIC
 #   define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
 			bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
@@ -185,14 +185,18 @@ L(pre_end):						ASM_LINE_SEP	\
 #   define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
 			bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
+# else
+#  error Unsupported library
 # endif
 
 # ifdef IS_IN_libpthread
 #  define __local_multiple_threads __pthread_multiple_threads
 # elif !defined NOT_IN_libc
 #  define __local_multiple_threads __libc_multiple_threads
-# else
+# elif IS_IN_librt
 #  define __local_multiple_threads __librt_multiple_threads
+# else
+#  error Unsupported library
 # endif
 
 # ifndef __ASSEMBLER__

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7c13fa7cec2dede0026a4f37ac77443fdaf4a75f

commit 7c13fa7cec2dede0026a4f37ac77443fdaf4a75f
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Sep 18 16:20:44 2007 +0000

    Correct return value type __THROW marker of splice, vmsplice, and tee.

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index b4f49cf..7c93183 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -213,17 +213,17 @@ extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
 
 
 /* Splice address range into a pipe.  */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
-		     unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+			 size_t __count, unsigned int __flags);
 
 /* Splice two files together.  */
-extern int splice (int __fdin, __off64_t *__offin, int __fdout,
-		   __off64_t *__offout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+		       __off64_t *__offout, size_t __len,
+		       unsigned int __flags);
 
 /* In-kernel implementation of tee for pipe buffers.  */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+		    unsigned int __flags);
 
 #endif
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2b03bcf4bbf45416ec48e3783388e4850bb668f5

commit 2b03bcf4bbf45416ec48e3783388e4850bb668f5
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Sep 17 16:31:32 2007 +0000

    	* sysdeps/unix/sysv/linux/arm/kernel-features.h: Undefine
    	__ASSUME_PSELECT and __ASSUME_PPOLL.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index fbd399e..8554fad 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,8 @@
+2007-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h: Undefine
+	__ASSUME_PSELECT and __ASSUME_PPOLL.
+
 2007-09-12  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Use
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 0a6ab21..ea439d5 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -52,3 +52,7 @@
 #endif
 
 #include_next <kernel-features.h>
+
+/* These syscalls are not implemented yet for ARM.  */
+#undef __ASSUME_PSELECT
+#undef __ASSUME_PPOLL

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c393be3d2f0a41af10f6405104101e0e292fb5ba

commit c393be3d2f0a41af10f6405104101e0e292fb5ba
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Sep 15 02:31:47 2007 +0000

    (__MATH_INLINE): Define to __extern_inline whenever that macro is defined.

diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index 250171e..5378a18 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -23,7 +23,7 @@
 # error "Never use <bits/mathinline.h> directly; include <math.h> instead."
 #endif
 
-#ifdef __cplusplus
+#ifndef __extern_inline
 # define __MATH_INLINE __inline
 #else
 # define __MATH_INLINE __extern_inline

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8c2766740df531409c2921f1c0213dcab2494e69

commit 8c2766740df531409c2921f1c0213dcab2494e69
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Sep 12 12:57:41 2007 +0000

    	* sysdeps/mips/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Pass
    	LLL_PRIVATE argument to lll_futex_wake.
    	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (O_CLOEXEC): Define.
    	* sysdeps/unix/sysv/linux/mips/bits/socket.h (PF_UNIX): Update
    	comment.
    	(PF_IUCV, PF_RXRPC): Define.
    	(PF_MAX): Update.
    	(AF_IUCV, AF_RXRPC): Define.
    	(MSG_CMSG_CLOEXEC): Define.
    	(_EXTERN_INLINE): Define to __extern_inline.
    	* sysdeps/unix/sysv/linux/mips/bits/stat.h (UTIME_NOW,
    	UTIME_OMIT): Define.
    	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Include <tls.h>.
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
    	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Renamed all
    	lll_mutex_* resp. lll_robust_mutex_* macros to lll_*
    	resp. lll_robust_*.  Renamed all LLL_MUTEX_LOCK_* macros to
    	LLL_LOCK_*.  Include <kernel-features.h>.
    	(LLL_LOCK_INITIALIZER): Remove duplicate definition.
    	(LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
    	* sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c
    	(clear_once_control, __pthread_once): Pass LLL_PRIVATE argument to
    	lll_futex_wait.
    	(lll_futex_wait, lll_futex_timed_wait, lll_futex_wake,
    	lll_robust_dead, lll_futex_requeue, lll_futex_wake_unlock): Take
    	private arguments.
    	(__lll_robust_trylock): Convert to macro.
    	(__lll_robust_lock_wait): Add private argument.
    	(__lll_lock_wait_private, __lll_lock_wait): Declare.
    	(__lll_lock): Convert to macro.  Take private argument.
    	(__lll_cond_lock): Likewise.
    	(lll_lock, lll_cond_lock): Take private arguments.
    	(__lll_robust_lock): Take private argument.  Convert to macro.
    	(lll_robust_lock, __lll_cond_lock, lll_cond_lock,
    	lll_robust_cond_lock): Take private arguments.
    	(__lll_timedlock_wait, __lll_robust_timedlock_wait): Take private
    	arguments.
    	(__lll_timedlock, __lll_robust_timedlock): Take private arguments.
    	(lll_timedlock, lll_robust_timedlock): Take private arguments.
    	(__lll_unlock, __lll_robust_unlock): Convert to macros.  Take
    	private arguments.
    	(lll_unlock, lll_robust_unlock): Take private arguments.
    	(__lll_mutex_unlock_force, lll_mutex_unlock_force, lll_lock_t,
    	lll_trylock, lll_lock, lll_unlock, lll_islocked): Remove.
    	(lll_wait_tid): Pass LLL_SHARED to lll_futex_wait.
    	(__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
    	__lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
    	lll_cond_wake, lll_cond_broadcast): Remove.
    	* sysdeps/unix/sysv/linux/mips/sys/tas.h (_EXTERN_INLINE): Define
    	to __extern_inline.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 3216e73..0e8fda4 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,57 @@
+2007-09-12  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Pass
+	LLL_PRIVATE argument to lll_futex_wake.
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (O_CLOEXEC): Define.
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h (PF_UNIX): Update
+	comment.
+	(PF_IUCV, PF_RXRPC): Define.
+	(PF_MAX): Update.
+	(AF_IUCV, AF_RXRPC): Define.
+	(MSG_CMSG_CLOEXEC): Define.
+	(_EXTERN_INLINE): Define to __extern_inline.
+	* sysdeps/unix/sysv/linux/mips/bits/stat.h (UTIME_NOW,
+	UTIME_OMIT): Define.
+	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Include <tls.h>.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Renamed all
+	lll_mutex_* resp. lll_robust_mutex_* macros to lll_*
+	resp. lll_robust_*.  Renamed all LLL_MUTEX_LOCK_* macros to
+	LLL_LOCK_*.  Include <kernel-features.h>.
+	(LLL_LOCK_INITIALIZER): Remove duplicate definition.
+	(LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
+	* sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c
+	(clear_once_control, __pthread_once): Pass LLL_PRIVATE argument to
+	lll_futex_wait.
+	(lll_futex_wait, lll_futex_timed_wait, lll_futex_wake,
+	lll_robust_dead, lll_futex_requeue, lll_futex_wake_unlock): Take
+	private arguments.
+	(__lll_robust_trylock): Convert to macro.
+	(__lll_robust_lock_wait): Add private argument.
+	(__lll_lock_wait_private, __lll_lock_wait): Declare.
+	(__lll_lock): Convert to macro.  Take private argument.
+	(__lll_cond_lock): Likewise.
+	(lll_lock, lll_cond_lock): Take private arguments.
+	(__lll_robust_lock): Take private argument.  Convert to macro.
+	(lll_robust_lock, __lll_cond_lock, lll_cond_lock,
+	lll_robust_cond_lock): Take private arguments.
+	(__lll_timedlock_wait, __lll_robust_timedlock_wait): Take private
+	arguments.
+	(__lll_timedlock, __lll_robust_timedlock): Take private arguments.
+	(lll_timedlock, lll_robust_timedlock): Take private arguments.
+	(__lll_unlock, __lll_robust_unlock): Convert to macros.  Take
+	private arguments.
+	(lll_unlock, lll_robust_unlock): Take private arguments.
+	(__lll_mutex_unlock_force, lll_mutex_unlock_force, lll_lock_t,
+	lll_trylock, lll_lock, lll_unlock, lll_islocked): Remove.
+	(lll_wait_tid): Pass LLL_SHARED to lll_futex_wait.
+	(__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
+	__lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
+	lll_cond_wake, lll_cond_broadcast): Remove.
+	* sysdeps/unix/sysv/linux/mips/sys/tas.h (_EXTERN_INLINE): Define
+	to __extern_inline.
+
 2007-08-06  Maciej W. Rozycki  <macro@linux-mips.org>
 
 	* sysdeps/unix/sysv/linux/mips/dl-cache.h (_DL_CACHE_DEFAULT_ID):
diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h
index dbe806a..20f9f96 100644
--- a/sysdeps/mips/nptl/tls.h
+++ b/sysdeps/mips/nptl/tls.h
@@ -166,7 +166,7 @@ typedef struct
 	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
 			       THREAD_GSCOPE_FLAG_UNUSED);		     \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
-	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);   \
     }									     \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index 3404663..27af9ed 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006, 2007
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -51,6 +51,7 @@
 # define O_DIRECT	0x8000	/* Direct disk access hint.  */
 # define O_DIRECTORY	0x10000	/* Must be a directory.	 */
 # define O_NOATIME	0x40000	/* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
 
 /* For now Linux has no synchronisity options for data and read operations.
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 0e4a2be..8748c0a 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Linux/MIPS version.
-   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006
+   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -63,7 +63,7 @@ enum __socket_type
 /* Protocol families.  */
 #define	PF_UNSPEC	0	/* Unspecified.  */
 #define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
-#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_UNIX		PF_LOCAL /* POSIX name for PF_LOCAL.  */
 #define	PF_FILE		PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
 #define	PF_INET		2	/* IP protocol family.  */
 #define	PF_AX25		3	/* Amateur Radio AX.25.  */
@@ -90,7 +90,9 @@ enum __socket_type
 #define	PF_PPPOX	24	/* PPPoX sockets.  */
 #define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
 #define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
-#define	PF_MAX		32	/* For now..  */
+#define	PF_IUCV		32	/* IUCV sockets.  */
+#define PF_RXRPC	33	/* RxRPC sockets.  */
+#define	PF_MAX		34	/* For now..  */
 
 /* Address families.  */
 #define	AF_UNSPEC	PF_UNSPEC
@@ -122,6 +124,8 @@ enum __socket_type
 #define	AF_PPPOX	PF_PPPOX
 #define	AF_WANPIPE	PF_WANPIPE
 #define	AF_BLUETOOTH	PF_BLUETOOTH
+#define	AF_IUCV		PF_IUCV
+#define AF_RXRPC	PF_RXRPC
 #define	AF_MAX		PF_MAX
 
 /* Socket level values.  Others are defined in the appropriate headers.
@@ -206,8 +210,13 @@ enum
 #define	MSG_ERRQUEUE	MSG_ERRQUEUE
     MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
 #define	MSG_NOSIGNAL	MSG_NOSIGNAL
-    MSG_MORE		= 0x8000  /* Sender will send more.  */
+    MSG_MORE		= 0x8000,  /* Sender will send more.  */
 #define	MSG_MORE	MSG_MORE
+
+    MSG_CMSG_CLOEXEC	= 0x40000000	/* Set close_on_exit for file
+                                           descriptor received through
+                                           SCM_RIGHTS.  */
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
   };
 
 
@@ -259,7 +268,7 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
 				      struct cmsghdr *__cmsg) __THROW;
 #ifdef __USE_EXTERN_INLINES
 # ifndef _EXTERN_INLINE
-#  define _EXTERN_INLINE extern __inline
+#  define _EXTERN_INLINE __extern_inline
 # endif
 _EXTERN_INLINE struct cmsghdr *
 __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
index 2081978..4e0e30f 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
-	Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004,
+	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
@@ -253,3 +253,9 @@ struct stat64
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index 3c19bff..089fa9d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -22,6 +22,8 @@
 /* There is some commonality.  */
 #include <sysdeps/unix/mips/mips32/sysdep.h>
 
+#include <tls.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index b15d280..b2bbbb0 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -23,6 +23,8 @@
 /* There is some commonality.  */
 #include <sysdeps/unix/mips/mips64/n32/sysdep.h>
 
+#include <tls.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index edf8786..8862607 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -23,6 +23,8 @@
 /* There is some commonality.  */
 #include <sysdeps/unix/mips/mips64/n64/sysdep.h>
 
+#include <tls.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index 4542e5b..1cb3d9b 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
@@ -24,7 +24,7 @@
 #include <bits/pthreadtypes.h>
 #include <atomic.h>
 #include <sysdep.h>
-
+#include <kernel-features.h>
 
 #define FUTEX_WAIT		0
 #define FUTEX_WAKE		1
@@ -37,200 +37,224 @@
 #define FUTEX_TRYLOCK_PI	8
 #define FUTEX_PRIVATE_FLAG	128
 
-/* Initializer for compatibility lock.	*/
-#define LLL_MUTEX_LOCK_INITIALIZER (0)
-
-#define lll_futex_wait(futexp, val) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (long) (futexp), FUTEX_WAIT, (val), 0);	      \
-    INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;		      \
-  })
-
-#define lll_futex_timed_wait(futexp, val, timespec) \
+/* Values for 'private' parameter of locking macros.  Yes, the
+   definition seems to be backwards.  But it is not.  The bit will be
+   reversed before passing to the system call.  */
+#define LLL_PRIVATE	0
+#define LLL_SHARED	FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private.  */
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+#  define __lll_private_flag(fl, private) \
+  ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+#  define __lll_private_flag(fl, private) \
+  (__builtin_constant_p (private)					      \
+   ? ((private) == 0							      \
+      ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))	      \
+      : (fl))								      \
+   : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
+	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif	      
+#endif
+
+
+#define lll_futex_wait(futexp, val, private) \
+  lll_futex_timed_wait(futexp, val, NULL, private)
+
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (long) (futexp), FUTEX_WAIT, (val), (timespec));\
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp),		      \
+			      __lll_private_flag (FUTEX_WAIT, private),	      \
+			      (val), (timespec));			      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;		      \
   })
 
-#define lll_futex_wake(futexp, nr) \
+#define lll_futex_wake(futexp, nr, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (long) (futexp), FUTEX_WAKE, (nr), 0);	      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp),		      \
+			      __lll_private_flag (FUTEX_WAKE, private),	      \
+			      (nr), 0);	      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;		      \
   })
 
-#define lll_robust_mutex_dead(futexv) \
+#define lll_robust_dead(futexv, private) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1);					      \
+      lll_futex_wake (__futexp, 1, private);				      \
     }									      \
   while (0)
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \
+#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (long) (futexp), FUTEX_CMP_REQUEUE, (nr_wake),  \
-			      (nr_move), (mutex), (val));		      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (long) (futexp),		      \
+			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
+			      (nr_wake), (nr_move), (mutex), (val));	      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
 									      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_WAKE_OP, (nr_wake),	      \
-			      (nr_wake2), (futexp2),			      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAKE_OP, private),    \
+			      (nr_wake), (nr_wake2), (futexp2),		      \
 			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
 
 static inline int __attribute__((always_inline))
-__lll_mutex_trylock(int *futex)
+__lll_trylock(int *futex)
 {
   return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
 }
-#define lll_mutex_trylock(lock)	__lll_mutex_trylock (&(lock))
+#define lll_trylock(lock)	__lll_trylock (&(lock))
 
 
 static inline int __attribute__((always_inline))
-__lll_mutex_cond_trylock(int *futex)
+__lll_cond_trylock(int *futex)
 {
   return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
 }
-#define lll_mutex_cond_trylock(lock)	__lll_mutex_cond_trylock (&(lock))
+#define lll_cond_trylock(lock)	__lll_cond_trylock (&(lock))
 
 
 static inline int __attribute__((always_inline))
-__lll_robust_mutex_trylock(int *futex, int id)
+__lll_robust_trylock(int *futex, int id)
 {
   return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0;
 }
-#define lll_robust_mutex_trylock(lock, id) \
-  __lll_robust_mutex_trylock (&(lock), id)
-
-extern void __lll_lock_wait (int *futex) attribute_hidden;
-extern int __lll_robust_lock_wait (int *futex) attribute_hidden;
-
-static inline void __attribute__((always_inline))
-__lll_mutex_lock(int *futex)
-{
-  if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-    __lll_lock_wait (futex);
-}
-#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
-
-
-static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_lock (int *futex, int id)
-{
-  int result = 0;
-  if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_lock_wait (futex);
-  return result;
-}
-#define lll_robust_mutex_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), id)
+#define lll_robust_trylock(lock, id) \
+  __lll_robust_trylock (&(lock), id)
+
+extern void __lll_lock_wait_private (int *futex) attribute_hidden;
+extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
+extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
+
+#define __lll_lock(futex, private)					      \
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex,      \
+								1, 0), 0))    \
+      {									      \
+	if (__builtin_constant_p (private) && (private) == LLL_PRIVATE)	      \
+	  __lll_lock_wait_private (__futex);				      \
+	else								      \
+	  __lll_lock_wait (__futex, private);				      \
+      }									      \
+  }))
+#define lll_lock(futex, private) __lll_lock (&(futex), private)
+
+
+#define __lll_robust_lock(futex, id, private)				      \
+  ({									      \
+    int *__futex = (futex);						      \
+    int __val = 0;							      \
+									      \
+    if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id,  \
+								0), 0))	      \
+      __val = __lll_robust_lock_wait (__futex, private);		      \
+    __val;								      \
+  })
+#define lll_robust_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), id, private)
 
 
 static inline void __attribute__ ((always_inline))
-__lll_mutex_cond_lock (int *futex)
+__lll_cond_lock (int *futex, int private)
 {
   if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
-    __lll_lock_wait (futex);
+    __lll_lock_wait (futex, private);
 }
-#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
 
 
-#define lll_robust_mutex_cond_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
+#define lll_robust_cond_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
 
 
-extern int __lll_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
-extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
+				 int private) attribute_hidden;
+extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
+					int private) attribute_hidden;
 
 static inline int __attribute__ ((always_inline))
-__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
+__lll_timedlock (int *futex, const struct timespec *abstime, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-    result = __lll_timedlock_wait (futex, abstime);
+    result = __lll_timedlock_wait (futex, abstime, private);
   return result;
 }
-#define lll_mutex_timedlock(futex, abstime) \
-  __lll_mutex_timedlock (&(futex), abstime)
+#define lll_timedlock(futex, abstime, private) \
+  __lll_timedlock (&(futex), abstime, private)
 
 
 static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime,
-			      int id)
+__lll_robust_timedlock (int *futex, const struct timespec *abstime,
+			int id, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_timedlock_wait (futex, abstime);
+    result = __lll_robust_timedlock_wait (futex, abstime, private);
   return result;
 }
-#define lll_robust_mutex_timedlock(futex, abstime, id) \
-  __lll_robust_mutex_timedlock (&(futex), abstime, id)
+#define lll_robust_timedlock(futex, abstime, id, private) \
+  __lll_robust_timedlock (&(futex), abstime, id, private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock (int *futex)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
-}
-#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
-
-
-static inline void __attribute__ ((always_inline))
-__lll_robust_mutex_unlock (int *futex, int mask)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1);
-}
-#define lll_robust_mutex_unlock(futex) \
-  __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
+#define __lll_unlock(futex, private)					      \
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    int __val = atomic_exchange_rel (__futex, 0);			      \
+									      \
+    if (__builtin_expect (__val > 1, 0))				      \
+      lll_futex_wake (__futex, 1, private);				      \
+  }))
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock_force (int *futex)
-{
-  (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1);
-}
-#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
+#define __lll_robust_unlock(futex, private)				      \
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    int __val = atomic_exchange_rel (__futex, 0);			      \
+									      \
+    if (__builtin_expect (__val & FUTEX_WAITERS, 0))			      \
+      lll_futex_wake (__futex, 1, private);				      \
+  }))
+#define lll_robust_unlock(futex, private) \
+  __lll_robust_unlock(&(futex), private)
 
 
-#define lll_mutex_islocked(futex) \
+#define lll_islocked(futex) \
   (futex != 0)
 
 
 /* Our internal lock implementation is identical to the binary-compatible
    mutex implementation. */
 
-/* Type for lock object.  */
-typedef int lll_lock_t;
-
 /* Initializers for lock.  */
 #define LLL_LOCK_INITIALIZER		(0)
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
@@ -240,20 +264,15 @@ typedef int lll_lock_t;
     1  -  taken by one user
    >1  -  taken by more users */
 
-#define lll_trylock(lock)	lll_mutex_trylock (lock)
-#define lll_lock(lock)		lll_mutex_lock (lock)
-#define lll_unlock(lock)	lll_mutex_unlock (lock)
-#define lll_islocked(lock)	lll_mutex_islocked (lock)
-
 /* The kernel notifies a process which uses CLONE_CLEARTID via futex
    wakeup when the clone terminates.  The memory location contains the
    thread ID while the clone is running and is reset to zero
    afterwards.	*/
 #define lll_wait_tid(tid) \
-  do {					\
-    __typeof (tid) __tid;		\
-    while ((__tid = (tid)) != 0)	\
-      lll_futex_wait (&(tid), __tid);	\
+  do {							\
+    __typeof (tid) __tid;				\
+    while ((__tid = (tid)) != 0)			\
+      lll_futex_wait (&(tid), __tid, LLL_SHARED);	\
   } while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)
@@ -267,26 +286,4 @@ extern int __lll_timedwait_tid (int *, const struct timespec *)
     __res;						\
   })
 
-
-/* Conditional variable handling.  */
-
-extern void __lll_cond_wait (pthread_cond_t *cond)
-     attribute_hidden;
-extern int __lll_cond_timedwait (pthread_cond_t *cond,
-				 const struct timespec *abstime)
-     attribute_hidden;
-extern void __lll_cond_wake (pthread_cond_t *cond)
-     attribute_hidden;
-extern void __lll_cond_broadcast (pthread_cond_t *cond)
-     attribute_hidden;
-
-#define lll_cond_wait(cond) \
-  __lll_cond_wait (cond)
-#define lll_cond_timedwait(cond, abstime) \
-  __lll_cond_timedwait (cond, abstime)
-#define lll_cond_wake(cond) \
-  __lll_cond_wake (cond)
-#define lll_cond_broadcast(cond) \
-  __lll_cond_broadcast (cond)
-
 #endif	/* lowlevellock.h */
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c b/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c
index 649b752..ddfd32b 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c
+++ b/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c
@@ -30,7 +30,7 @@ clear_once_control (void *arg)
   pthread_once_t *once_control = (pthread_once_t *) arg;
 
   *once_control = 0;
-  lll_futex_wake (once_control, INT_MAX);
+  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
 }
 
 
@@ -65,7 +65,7 @@ __pthread_once (once_control, init_routine)
 	  if (((oldval ^ newval) & -4) == 0)
 	    {
 	      /* Same generation, some other thread was faster. Wait.  */
-	      lll_futex_wait (once_control, newval);
+	      lll_futex_wait (once_control, newval, LLL_PRIVATE);
 	      continue;
 	    }
 	}
@@ -84,7 +84,7 @@ __pthread_once (once_control, init_routine)
       atomic_increment (once_control);
 
       /* Wake up all other threads.  */
-      lll_futex_wake (once_control, INT_MAX);
+      lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
       break;
     }
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/tas.h b/sysdeps/unix/sysv/linux/mips/sys/tas.h
index 1183b86..309438d 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/tas.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/tas.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
 
@@ -30,7 +30,7 @@ extern int _test_and_set (int *p, int v) __THROW;
 #ifdef __USE_EXTERN_INLINES
 
 # ifndef _EXTERN_INLINE
-#  define _EXTERN_INLINE extern __inline
+#  define _EXTERN_INLINE __extern_inline
 # endif
 
 _EXTERN_INLINE int

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=713ddf8d12374aa7ddca20da1d585b4bd1b281be

commit 713ddf8d12374aa7ddca20da1d585b4bd1b281be
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Sep 12 12:57:25 2007 +0000

    	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Use
    	lll_futex_wake not lll_private_futex_wake.
    	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (O_CLOEXEC): Define.
    	* sysdeps/unix/sysv/linux/arm/eabi/sysdep.h: Include <tls.h>
    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
    	(__lll_lock_wait_private, __lll_lock_wait): New.
    	(__lll_timedlock_wait): Don't include in libc.so;  Take private
    	argument.  Use atomic_compare_and_exchange_bool_acq.
    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Renamed all
    	lll_mutex_* resp. lll_robust_mutex_* macros to lll_*
    	resp. lll_robust_*.  Renamed all LLL_MUTEX_LOCK_* macros to
    	LLL_LOCK_*.  Include <kernel-features.h>.
    	(LLL_LOCK_INITIALIZER): Remove duplicate definition.
    	(__lll_private_flag): Define.
    	(lll_futex_timed_wait): Pass private flag to syscall.
    	(lll_futex_wake): Likewise.
    	(lll_private_futex_wait, lll_private_futex_timed_wait,
    	lll_private_futex_wake): Remove.
    	(lll_robust_dead, lll_futex_requeue): Take private arguments.
    	(lll_futex_wake_unlock): Pass private flag to syscall.
    	(__lll_robust_trylock): Convert to macro.
    	(__lll_robust_lock_wait): Add private argument.
    	(__lll_lock_wait_private, __lll_lock_wait): Declare.
    	(__lll_lock): Convert to macro.  Take private argument.
    	(__lll_cond_lock): Likewise.
    	(lll_lock, lll_cond_lock): Take private arguments.
    	(__lll_robust_lock): Take private argument.
    	(__lll_timedlock_wait, __lll_robust_timedlock_wait): Take private
    	arguments.
    	(__lll_timedlock, __lll_robust_timedlock): Convert to macros.
    	Take private arguments.
    	(lll_timedlock, lll_robust_timedlock): Take private arguments.
    	(__lll_unlock, __lll_robust_unlock): Convert to macros.  Take
    	private arguments.
    	(lll_unlock, lll_robust_unlock): Take private arguments.
    	(__lll_mutex_unlock_force, lll_mutex_unlock_force, lll_lock_t,
    	lll_trylock, lll_lock, lll_unlock, lll_islocked): Remove.
    	(lll_wait_tid): Pass LLL_SHARED to lll_futex_wait.
    	(__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
    	__lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
    	lll_cond_wake, lll_cond_broadcast): Remove.
    	* sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
    	(clear_once_control, __pthread_once): Use lll_futex_wake not
    	lll_private_futex_wake.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 5a24c54..fbd399e 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,50 @@
+2007-09-12  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Use
+	lll_futex_wake not lll_private_futex_wake.
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (O_CLOEXEC): Define.
+	* sysdeps/unix/sysv/linux/arm/eabi/sysdep.h: Include <tls.h>
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
+	(__lll_lock_wait_private, __lll_lock_wait): New.
+	(__lll_timedlock_wait): Don't include in libc.so;  Take private
+	argument.  Use atomic_compare_and_exchange_bool_acq.
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Renamed all
+	lll_mutex_* resp. lll_robust_mutex_* macros to lll_*
+	resp. lll_robust_*.  Renamed all LLL_MUTEX_LOCK_* macros to
+	LLL_LOCK_*.  Include <kernel-features.h>.
+	(LLL_LOCK_INITIALIZER): Remove duplicate definition.
+	(__lll_private_flag): Define.
+	(lll_futex_timed_wait): Pass private flag to syscall.
+	(lll_futex_wake): Likewise.
+	(lll_private_futex_wait, lll_private_futex_timed_wait,
+	lll_private_futex_wake): Remove.
+	(lll_robust_dead, lll_futex_requeue): Take private arguments.
+	(lll_futex_wake_unlock): Pass private flag to syscall.
+	(__lll_robust_trylock): Convert to macro.
+	(__lll_robust_lock_wait): Add private argument.
+	(__lll_lock_wait_private, __lll_lock_wait): Declare.
+	(__lll_lock): Convert to macro.  Take private argument.
+	(__lll_cond_lock): Likewise.
+	(lll_lock, lll_cond_lock): Take private arguments.
+	(__lll_robust_lock): Take private argument.
+	(__lll_timedlock_wait, __lll_robust_timedlock_wait): Take private
+	arguments.
+	(__lll_timedlock, __lll_robust_timedlock): Convert to macros.
+	Take private arguments.
+	(lll_timedlock, lll_robust_timedlock): Take private arguments.
+	(__lll_unlock, __lll_robust_unlock): Convert to macros.  Take
+	private arguments.
+	(lll_unlock, lll_robust_unlock): Take private arguments.
+	(__lll_mutex_unlock_force, lll_mutex_unlock_force, lll_lock_t,
+	lll_trylock, lll_lock, lll_unlock, lll_islocked): Remove.
+	(lll_wait_tid): Pass LLL_SHARED to lll_futex_wait.
+	(__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
+	__lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
+	lll_cond_wake, lll_cond_broadcast): Remove.
+	* sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
+	(clear_once_control, __pthread_once): Use lll_futex_wake not
+	lll_private_futex_wake.
+
 2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Use
diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h
index e80b6b8..f257b93 100644
--- a/sysdeps/arm/nptl/tls.h
+++ b/sysdeps/arm/nptl/tls.h
@@ -142,7 +142,7 @@ typedef struct
 	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
 			       THREAD_GSCOPE_FLAG_UNUSED);		     \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
-	lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1);	     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);   \
     }									     \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index 59539e1..6fcc5c0 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-1998, 2000, 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000, 2004, 2006, 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
@@ -49,6 +50,7 @@
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
 # define O_DIRECT	0200000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h b/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
index bf9c8d7..1444f40 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006
+/* Copyright (C) 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.
@@ -25,6 +25,8 @@
 
 #include <arm/sysdep.h>
 
+#include <tls.h>
+
 #if __NR_SYSCALL_BASE != 0
 # error Kernel headers are too old
 #endif
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
index 44867ec..8ba6065 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
@@ -22,8 +22,36 @@
 #include <lowlevellock.h>
 #include <sys/time.h>
 
+void
+__lll_lock_wait_private (int *futex)
+{
+  do
+    {
+      int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
+      if (oldval != 0)
+	lll_futex_wait (futex, 2, LLL_PRIVATE);
+    }
+  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
+}
+
+
+/* These functions don't get included in libc.so  */
+#ifdef IS_IN_libpthread
+void
+__lll_lock_wait (int *futex, int private)
+{
+  do
+    {
+      int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
+      if (oldval != 0)
+	lll_futex_wait (futex, 2, private);
+    }
+  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
+}
+
+
 int
-__lll_timedlock_wait (int *futex, const struct timespec *abstime)
+__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private)
 {
   struct timespec rt;
 
@@ -56,16 +84,14 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime)
 	return ETIMEDOUT;
 
       // XYZ: Lost the lock to check whether it was private.
-      lll_futex_timed_wait (futex, 2, &rt, LLL_SHARED);
+      lll_futex_timed_wait (futex, 2, &rt, private);
     }
-  while (atomic_exchange_acq (futex, 2) != 0);
+  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
 
   return 0;
 }
 
 
-/* This function doesn't get included in libc.so  */
-#ifdef IS_IN_libpthread
 int
 __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 {
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 468fe71..f48e867 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -24,6 +24,7 @@
 #include <bits/pthreadtypes.h>
 #include <atomic.h>
 #include <sysdep.h>
+#include <kernel-features.h>
 
 #define FUTEX_WAIT		0
 #define FUTEX_WAKE		1
@@ -42,8 +43,31 @@
 #define LLL_PRIVATE	0
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
-/* Initializer for compatibility lock.	*/
-#define LLL_MUTEX_LOCK_INITIALIZER (0)
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private.  */
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+#  define __lll_private_flag(fl, private) \
+  ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+#  define __lll_private_flag(fl, private) \
+  (__builtin_constant_p (private)					      \
+   ? ((private) == 0							      \
+      ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))	      \
+      : (fl))								      \
+   : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
+	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif	      
+#endif
+
 
 #define lll_futex_wait(futexp, val, private) \
   lll_futex_timed_wait(futexp, val, NULL, private)
@@ -52,82 +76,39 @@
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
-    __ret;								      \
-  })
-
-#define lll_futex_wake(futexp, nr, private) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAKE, (nr), 0);		      \
-    __ret;								      \
-  })
-
-#define lll_private_futex_wait(futexp, val) \
-  lll_private_futex_timed_wait(futexp, val, NULL)
-
-#ifdef __ASSUME_PRIVATE_FUTEX
-#define lll_private_futex_timed_wait(futexp, val, timespec) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT | FUTEX_PRIVATE_FLAG,      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAIT, private),	      \
 			      (val), (timespec));			      \
     __ret;								      \
   })
 
-#define lll_private_futex_wake(futexp, nr) \
+#define lll_futex_wake(futexp, nr, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAKE | FUTEX_PRIVATE_FLAG,      \
-			      (nr), (0));				      \
-    __ret;								      \
-  })
-#else
-#define lll_private_futex_timed_wait(futexp, val, timespec) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret, __op;						      \
-    __op = FUTEX_WAIT | THREAD_GETMEM (THREAD_SELF, header.private_futex);    \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), __op, (val), (timespec));	      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAKE, private),	      \
+			      (nr), 0);					      \
     __ret;								      \
   })
 
-#define lll_private_futex_wake(futexp, nr) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret, __op;						      \
-    __op = FUTEX_WAKE | THREAD_GETMEM (THREAD_SELF, header.private_futex);    \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), __op, (nr), 0);			      \
-    __ret;								      \
-  })
-#endif
-
-#define lll_robust_mutex_dead(futexv) \
+#define lll_robust_dead(futexv, private) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1, 0);					      \
+      lll_futex_wake (__futexp, 1, private);				      \
     }									      \
   while (0)
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \
+#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_CMP_REQUEUE, (nr_wake),	      \
-			      (nr_move), (mutex), (val));		      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
+			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
+			      (nr_wake), (nr_move), (mutex), (val));	      \
     __ret;								      \
   })
 
@@ -137,16 +118,16 @@
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_WAKE_OP, (nr_wake),	      \
-			      (nr_wake2), (futexp2),			      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAKE_OP, private),    \
+			      (nr_wake), (nr_wake2), (futexp2),		      \
 			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
     __ret;								      \
   })
 
 
 static inline int __attribute__((always_inline))
-__lll_mutex_trylock (int *futex)
+__lll_trylock (int *futex)
 {
   int flag = 1, old;
   asm volatile (
@@ -161,11 +142,11 @@ __lll_mutex_trylock (int *futex)
 
   return flag;
 }
-#define lll_mutex_trylock(lock)	__lll_mutex_trylock (&(lock))
+#define lll_trylock(lock)	__lll_trylock (&(lock))
 
 
 static inline int __attribute__((always_inline))
-__lll_mutex_cond_trylock (int *futex)
+__lll_cond_trylock (int *futex)
 {
   int flag = 2, old;
   asm volatile (
@@ -180,135 +161,120 @@ __lll_mutex_cond_trylock (int *futex)
 
   return flag;
 }
-#define lll_mutex_cond_trylock(lock)	__lll_mutex_cond_trylock (&(lock))
-
-
-static inline int __attribute__((always_inline))
-__lll_robust_mutex_trylock(int *futex, int id)
-{
-  return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0;
-}
-#define lll_robust_mutex_trylock(lock, id) \
-  __lll_robust_mutex_trylock (&(lock), id)
-
-extern int __lll_robust_lock_wait (int *futex) attribute_hidden;
-
-static inline void __attribute__((always_inline))
-__lll_mutex_lock (int *futex)
-{
-  int val = atomic_exchange_acq (futex, 1);
-
-  if (__builtin_expect (val != 0, 0))
-    {
-      while (atomic_exchange_acq (futex, 2) != 0)
-	lll_futex_wait (futex, 2, 0);
-    }
-}
-#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
-
-
-static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_lock (int *futex, int id)
-{
-  int result = 0;
-  if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_lock_wait (futex);
-  return result;
-}
-#define lll_robust_mutex_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), id)
-
-
-static inline void __attribute__ ((always_inline))
-__lll_mutex_cond_lock (int *futex)
-{
-  int val = atomic_exchange_acq (futex, 2);
-
-  if (__builtin_expect (val != 0, 0))
-    {
-      while (atomic_exchange_acq (futex, 2) != 0)
-	lll_futex_wait (futex, 2, 0);
-    }
-}
-#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
+#define lll_cond_trylock(lock)	__lll_cond_trylock (&(lock))
+
+
+#define __lll_robust_trylock(futex, id) \
+  (atomic_compare_and_exchange_val_acq (futex, id, 0) != 0)
+#define lll_robust_trylock(lock, id) \
+  __lll_robust_trylock (&(lock), id)
+
+extern void __lll_lock_wait_private (int *futex) attribute_hidden;
+extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
+extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
+
+#define __lll_lock(futex, private)					      \
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex,       \
+								1, 0), 0))    \
+      {									      \
+	if (__builtin_constant_p (private) && (private) == LLL_PRIVATE)	      \
+	  __lll_lock_wait_private (__futex);				      \
+	else								      \
+	  __lll_lock_wait (__futex, private);				      \
+      }									      \
+  }))
+#define lll_lock(futex, private) __lll_lock (&(futex), private)
+
+
+#define __lll_robust_lock(futex, id, private)				      \
+  ({									      \
+    int *__futex = (futex);						      \
+    int __val = 0;							      \
+									      \
+    if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id,  \
+								0), 0))	      \
+      __val = __lll_robust_lock_wait (__futex, private);		      \
+    __val;								      \
+  })
+#define lll_robust_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), id, private)
 
 
-#define lll_robust_mutex_cond_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
+#define __lll_cond_lock(futex, private)					      \
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0))		      \
+      __lll_lock_wait (__futex, private);				      \
+  }))
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
 
 
-extern int __lll_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
-extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
+#define lll_robust_cond_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
 
-static inline int __attribute__ ((always_inline))
-__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
-{
-  int result = 0;
-  int val = atomic_exchange_acq (futex, 1);
 
-  if (__builtin_expect (val != 0, 0))
-    result = __lll_timedlock_wait (futex, abstime);
-  return result;
-}
-#define lll_mutex_timedlock(futex, abstime) \
-  __lll_mutex_timedlock (&(futex), abstime)
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
+				 int private) attribute_hidden;
+extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
+					int private) attribute_hidden;
 
-
-static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime,
-			      int id)
-{
-  int result = 0;
-  if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_timedlock_wait (futex, abstime);
-  return result;
-}
-#define lll_robust_mutex_timedlock(futex, abstime, id) \
-  __lll_robust_mutex_timedlock (&(futex), abstime, id)
+#define __lll_timedlock(futex, abstime, private)			      \
+  ({									      \
+     int *__futex = (futex);						      \
+     int __val = 0;							      \
+									      \
+     if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0))	      \
+       __val = __lll_timedlock_wait (__futex, abstime, private);	      \
+     __val;								      \
+  })
+#define lll_timedlock(futex, abstime, private) \
+  __lll_timedlock (&(futex), abstime, private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock (int *futex)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1, 0);
-}
-#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
+#define __lll_robust_timedlock(futex, abstime, id, private)		      \
+  ({									      \
+    int *__futex = (futex);						      \
+    int __val = 0;							      \
+									      \
+    if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id,  \
+								0), 0))	      \
+      __val = __lll_robust_timedlock_wait (__futex, abstime, private);	      \
+    __val;								      \
+  })
+#define lll_robust_timedlock(futex, abstime, id, private) \
+  __lll_robust_timedlock (&(futex), abstime, id, private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_robust_mutex_unlock (int *futex, int mask)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1, 0);
-}
-#define lll_robust_mutex_unlock(futex) \
-  __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
+#define __lll_unlock(futex, private) \
+  (void)							\
+    ({ int *__futex = (futex);					\
+       int __oldval = atomic_exchange_rel (__futex, 0);		\
+       if (__builtin_expect (__oldval > 1, 0))			\
+	 lll_futex_wake (__futex, 1, private);			\
+    })
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock_force (int *futex)
-{
-  (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1, 0);
-}
-#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
+#define __lll_robust_unlock(futex, private) \
+  (void)							\
+    ({ int *__futex = (futex);					\
+       int __oldval = atomic_exchange_rel (__futex, 0);		\
+       if (__builtin_expect (__oldval & FUTEX_WAITERS, 0))	\
+	 lll_futex_wake (__futex, 1, private);			\
+    })
+#define lll_robust_unlock(futex, private) \
+  __lll_robust_unlock(&(futex), private)
 
 
-#define lll_mutex_islocked(futex) \
+#define lll_islocked(futex) \
   (futex != 0)
 
 
 /* Our internal lock implementation is identical to the binary-compatible
    mutex implementation. */
 
-/* Type for lock object.  */
-typedef int lll_lock_t;
-
 /* Initializers for lock.  */
 #define LLL_LOCK_INITIALIZER		(0)
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
@@ -318,11 +284,6 @@ typedef int lll_lock_t;
     1  -  taken by one user
    >1  -  taken by more users */
 
-#define lll_trylock(lock)	lll_mutex_trylock (lock)
-#define lll_lock(lock)		lll_mutex_lock (lock)
-#define lll_unlock(lock)	lll_mutex_unlock (lock)
-#define lll_islocked(lock)	lll_mutex_islocked (lock)
-
 /* The kernel notifies a process which uses CLONE_CLEARTID via futex
    wakeup when the clone terminates.  The memory location contains the
    thread ID while the clone is running and is reset to zero
@@ -331,7 +292,7 @@ typedef int lll_lock_t;
   do {					\
     __typeof (tid) __tid;		\
     while ((__tid = (tid)) != 0)	\
-      lll_futex_wait (&(tid), __tid, 0);\
+      lll_futex_wait (&(tid), __tid, LLL_SHARED);\
   } while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)
@@ -345,26 +306,4 @@ extern int __lll_timedwait_tid (int *, const struct timespec *)
     __res;						\
   })
 
-
-/* Conditional variable handling.  */
-
-extern void __lll_cond_wait (pthread_cond_t *cond)
-     attribute_hidden;
-extern int __lll_cond_timedwait (pthread_cond_t *cond,
-				 const struct timespec *abstime)
-     attribute_hidden;
-extern void __lll_cond_wake (pthread_cond_t *cond)
-     attribute_hidden;
-extern void __lll_cond_broadcast (pthread_cond_t *cond)
-     attribute_hidden;
-
-#define lll_cond_wait(cond) \
-  __lll_cond_wait (cond)
-#define lll_cond_timedwait(cond, abstime) \
-  __lll_cond_timedwait (cond, abstime)
-#define lll_cond_wake(cond) \
-  __lll_cond_wake (cond)
-#define lll_cond_broadcast(cond) \
-  __lll_cond_broadcast (cond)
-
 #endif	/* lowlevellock.h */
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c b/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
index 909e832..d81ecd4 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
@@ -27,7 +27,7 @@ clear_once_control (void *arg)
   pthread_once_t *once_control = (pthread_once_t *) arg;
 
   *once_control = 0;
-  lll_private_futex_wake (once_control, INT_MAX);
+  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
 }
 
 int
@@ -66,7 +66,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
 	break;
 
       /* Same generation, some other thread was faster. Wait.  */
-      lll_private_futex_wait (once_control, oldval);
+      lll_futex_wait (once_control, oldval, LLL_PRIVATE);
     }
 
   /* This thread is the first here.  Do the initialization.
@@ -82,7 +82,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
   *once_control = __fork_generation | 2;
 
   /* Wake up all other threads.  */
-  lll_private_futex_wake (once_control, INT_MAX);
+  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
 
   return 0;
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ce7a1add4e1be2b9e80a95eaa4f3e62e56c24612

commit ce7a1add4e1be2b9e80a95eaa4f3e62e56c24612
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Aug 29 20:34:36 2007 +0000

    	* sysdeps/powerpc/nofpu/fsetexcptflg.c (__fesetexceptflag): Do not
    	clobber other exceptions.
    	* sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Raise new
    	exceptions.
    	* sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Handle
    	multiple new exceptions if some are disabled.
    	* sysdeps/powerpc/nofpu/sim-full.c (__simulate_exceptions): Likewise.

diff --git a/ChangeLog.powerpc b/ChangeLog.powerpc
index c775ee0..463dd29 100644
--- a/ChangeLog.powerpc
+++ b/ChangeLog.powerpc
@@ -1,3 +1,13 @@
+2007-08-29  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/powerpc/nofpu/fsetexcptflg.c (__fesetexceptflag): Do not
+	clobber other exceptions.
+	* sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Raise new
+	exceptions.
+	* sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Handle
+	multiple new exceptions if some are disabled.
+	* sysdeps/powerpc/nofpu/sim-full.c (__simulate_exceptions): Likewise.
+
 2007-07-13  Steven Munroe  <sjmunroe@us.ibm.com>
 
 	* sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.
diff --git a/sysdeps/powerpc/nofpu/feupdateenv.c b/sysdeps/powerpc/nofpu/feupdateenv.c
index 5073776..17af8d3 100644
--- a/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -21,12 +21,12 @@
 
 #include "soft-fp.h"
 #include "soft-supp.h"
+#include <signal.h>
 #include <bp-sym.h>
 
 int
 __feupdateenv (const fenv_t *envp)
 {
-  fenv_union_t u;
   int saved_exceptions;
 
   /* Save currently set exceptions.  */
@@ -37,6 +37,8 @@ __feupdateenv (const fenv_t *envp)
 
   /* Raise old exceptions.  */
   __sim_exceptions |= saved_exceptions;
+  if (saved_exceptions & ~__sim_disabled_exceptions)
+    raise (SIGFPE);
 
   return 0;
 }
diff --git a/sysdeps/powerpc/nofpu/fraiseexcpt.c b/sysdeps/powerpc/nofpu/fraiseexcpt.c
index cd91502..5d3a87f 100644
--- a/sysdeps/powerpc/nofpu/fraiseexcpt.c
+++ b/sysdeps/powerpc/nofpu/fraiseexcpt.c
@@ -28,10 +28,7 @@ int
 __feraiseexcept (int x)
 {
   __sim_exceptions |= x;
-  if (x == 0 || __sim_disabled_exceptions & x)
-    /* Ignore exception.  */
-    ;
-  else
+  if (x & ~__sim_disabled_exceptions)
     raise (SIGFPE);
   return 0;
 }
diff --git a/sysdeps/powerpc/nofpu/fsetexcptflg.c b/sysdeps/powerpc/nofpu/fsetexcptflg.c
index 85fd88f..2faeb1f 100644
--- a/sysdeps/powerpc/nofpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/nofpu/fsetexcptflg.c
@@ -26,7 +26,7 @@ int
 __fesetexceptflag(const fexcept_t *flagp, int excepts)
 {
   /* Ignore exceptions not listed in 'excepts'.  */
-  __sim_exceptions = *flagp & excepts;
+  __sim_exceptions = (__sim_exceptions & ~excepts) | (*flagp & excepts);
 
   return 0;
 }
diff --git a/sysdeps/powerpc/nofpu/sim-full.c b/sysdeps/powerpc/nofpu/sim-full.c
index d018240..d5ee007 100644
--- a/sysdeps/powerpc/nofpu/sim-full.c
+++ b/sysdeps/powerpc/nofpu/sim-full.c
@@ -37,9 +37,6 @@ void
 __simulate_exceptions (int x)
 {
   __sim_exceptions |= x;
-  if (x == 0 || __sim_disabled_exceptions & x)
-    /* Ignore exception.  */
-    ;
-  else
+  if (x & ~__sim_disabled_exceptions)
     raise (SIGFPE);
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ceb34e81f0b53ffc48189c2fd9f0c00335552d69

commit ceb34e81f0b53ffc48189c2fd9f0c00335552d69
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 21 08:07:28 2007 +0000

    	* sysdeps/unix/sysv/linux/alpha/sysdep.h: Include tls.h.

diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
index a22da71..f0661d1 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004
+/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
@@ -29,6 +29,8 @@
 /* There is some commonality.  */
 #include <sysdeps/unix/alpha/sysdep.h>
 
+#include <tls.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fc256454b9c4f9bf5d8dda29b3d3f14f706fdc53

commit fc256454b9c4f9bf5d8dda29b3d3f14f706fdc53
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 21 08:05:34 2007 +0000

    	* sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
    	Add private argument.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 9fa321c..9318823 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -94,12 +94,12 @@
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
   })
 
-#define lll_robust_dead(futexv) \
+#define lll_robust_dead(futexv, private) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1, LLL_SHARED);				      \
+      lll_futex_wake (__futexp, 1, private);				      \
     }									      \
   while (0)
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=957df4294eacc0b24816986e1fea88d67d993131

commit 957df4294eacc0b24816986e1fea88d67d993131
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Aug 16 21:03:08 2007 +0000

    	* sysdeps/unix/sysv/linux/alpha/lowlevellock.h
    	(__lll_robust_timedlock): Pass private as last argument to
    	__lll_robust_timedlock_wait.
    	(__lll_unlock): Fix a pasto.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 4487607..9fa321c 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -219,7 +219,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_timedlock_wait (futex, abstime);
+    result = __lll_robust_timedlock_wait (futex, abstime, private);
   return result;
 }
 #define lll_robust_timedlock(futex, abstime, id, private) \
@@ -229,7 +229,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
 #define __lll_unlock(futex, private) \
   (void)							\
     ({ int *__futex = (futex);					\
-    ({ int __oldval = atomic_exchange_rel (__futex, 0);		\
+       int __oldval = atomic_exchange_rel (__futex, 0);		\
        if (__builtin_expect (__oldval > 1, 0))			\
 	 lll_futex_wake (__futex, 1, private);			\
     })

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a6b427ce224665ef5152182efb06a23482366cdf

commit a6b427ce224665ef5152182efb06a23482366cdf
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 14 19:37:50 2007 +0000

    	* sysdeps/ieee754/ldbl-64-128/strtold_l.c (__STRTOF): Declare.
    	Add libc_hidden_proto.
    	(STRTOF): Add libc_hidden_proto.
    	(___new_strtold_l, ___new_wcstold_l): New weak aliases.
    	(strtold_l, wcstold_l): Use them as second argument for
    	long_double_symbol.
    nptl/
    	* sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
    	__lll_robust_unlock): Rewrite as macros instead of inline functions.
    	* sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
    	__lll_robust_unlock, __lll_wait_tid): Likewise.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 4f67964..4487607 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -226,23 +226,23 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
   __lll_robust_timedlock (&(futex), abstime, id, private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_unlock (int *futex, int private)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1, private);
-}
+#define __lll_unlock(futex, private) \
+  (void)							\
+    ({ int *__futex = (futex);					\
+    ({ int __oldval = atomic_exchange_rel (__futex, 0);		\
+       if (__builtin_expect (__oldval > 1, 0))			\
+	 lll_futex_wake (__futex, 1, private);			\
+    })
 #define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
 
-static inline void __attribute__ ((always_inline))
-__lll_robust_unlock (int *futex, int private)
-{
-  int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val & FUTEX_WAITERS, 0))
-    lll_futex_wake (futex, 1, private);
-}
+#define __lll_robust_unlock(futex, private) \
+  (void)							\
+    ({ int *__futex = (futex);					\
+       int __oldval = atomic_exchange_rel (__futex, 0);		\
+       if (__builtin_expect (__oldval & FUTEX_WAITERS, 0))	\
+	 lll_futex_wake (__futex, 1, private);			\
+    })
 #define lll_robust_unlock(futex, private) \
   __lll_robust_unlock(&(futex), private)
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=639aa6011e81384ae88d0356682e8ef20e1de6ab

commit 639aa6011e81384ae88d0356682e8ef20e1de6ab
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Aug 13 18:33:00 2007 +0000

    Include kernel-features.h.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index ab829ad..4f67964 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -24,6 +24,7 @@
 #include <bits/pthreadtypes.h>
 #include <atomic.h>
 #include <sysdep.h>
+#include <kernel-features.h>
 
 
 #define __NR_futex		394

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5f9107929d0b9dbf46cb45735620eae3f1566278

commit 5f9107929d0b9dbf46cb45735620eae3f1566278
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Aug 12 19:39:31 2007 +0000

    (pthread_rwlock_t): Renamed __pad1 element to __shared, adjust names of
    other padding elements.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h
index 41a54d4..41c0be1 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h
@@ -1,5 +1,5 @@
 /* Machine-specific pthread type layouts.  Alpha version.
-   Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 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
@@ -126,9 +126,9 @@ typedef union
     unsigned int __nr_readers_queued;
     unsigned int __nr_writers_queued;
     int __writer;
-    int __pad1;
+    int __shared;
+    unsigned long int __pad1;
     unsigned long int __pad2;
-    unsigned long int __pad3;
     /* FLAGS must stay at this position in the structure to maintain
        binary compatibility.  */
     unsigned int __flags;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=78727e1194372d2fde23946ee5adc23ba2eb765e

commit 78727e1194372d2fde23946ee5adc23ba2eb765e
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Aug 11 18:47:31 2007 +0000

    (lll_futex_requeue, lll_futex_wake_unlock): Add private argument, use
    __lll_private_flag macro.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index f3f2919..ab829ad 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -103,24 +103,24 @@
   while (0)
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \
+#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_CMP_REQUEUE, (nr_wake),	      \
-			      (nr_move), (mutex), (val));		      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
+			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
+			      (nr_wake), (nr_move), (mutex), (val));	      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 6,				      \
-			      (futexp), FUTEX_WAKE_OP, (nr_wake),	      \
-			      (nr_wake2), (futexp2),			      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAKE_OP, private),    \
+			      (nr_wake), (nr_wake2), (futexp2),		      \
 			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1bf120f61eae0d9c10ae43a4101783ee02de0c10

commit 1bf120f61eae0d9c10ae43a4101783ee02de0c10
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Aug 10 01:44:09 2007 +0000

    (O_CLOEXEC): Define.

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index f17dc2b..b4f49cf 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-2000, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000,2004,2005,2006,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
@@ -50,6 +50,7 @@
 # define O_NOFOLLOW	0200000	/* Do not follow links.  */
 # define O_DIRECT	02000000 /* Direct disk access.  */
 # define O_NOATIME	04000000 /* Do not set atime.  */
+# define O_CLOEXEC      010000000 /* Set close_on_exec.  */
 #endif
 
 #ifdef __USE_LARGEFILE64

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d45a63687733a9e9029d8a336c3918d19a320a7b

commit d45a63687733a9e9029d8a336c3918d19a320a7b
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Mon Aug 6 17:45:09 2007 +0000

    	* sysdeps/unix/sysv/linux/mips/dl-cache.h (_DL_CACHE_DEFAULT_ID):
    	New macros for the (n)64 and n32 ABIs.
    	(_dl_cache_check_flags): Define if _DL_CACHE_DEFAULT_ID has been.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 43aadf8..3216e73 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2007-08-06  Maciej W. Rozycki  <macro@linux-mips.org>
+
+	* sysdeps/unix/sysv/linux/mips/dl-cache.h (_DL_CACHE_DEFAULT_ID):
+	New macros for the (n)64 and n32 ABIs.
+	(_dl_cache_check_flags): Define if _DL_CACHE_DEFAULT_ID has been.
+
 2007-07-13  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* sysdeps/mips/bits/wordsize.h [_MIPS_SIM == _ABI64]:
diff --git a/sysdeps/unix/sysv/linux/mips/dl-cache.h b/sysdeps/unix/sysv/linux/mips/dl-cache.h
index 4fa5d3a..9f0e4d2 100644
--- a/sysdeps/unix/sysv/linux/mips/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/mips/dl-cache.h
@@ -1,5 +1,5 @@
 /* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   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
@@ -17,6 +17,20 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <ldconfig.h>
+
+/* Redefine the cache ID for new ABIs; o32 keeps using the generic check.  */
+#if _MIPS_SIM == _ABI64
+# define _DL_CACHE_DEFAULT_ID	(FLAG_MIPS64_LIBN64 | FLAG_ELF_LIBC6)
+#elif _MIPS_SIM == _ABIN32
+# define _DL_CACHE_DEFAULT_ID	(FLAG_MIPS64_LIBN32 | FLAG_ELF_LIBC6)
+#endif
+
+#ifdef _DL_CACHE_DEFAULT_ID
+# define _dl_cache_check_flags(flags) \
+  ((flags) == _DL_CACHE_DEFAULT_ID)
+#endif
+
 #define add_system_dir(dir) \
   do								\
     {								\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=57165d450fbbdeb38c80d19bc96c20d3b4ecf581

commit 57165d450fbbdeb38c80d19bc96c20d3b4ecf581
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Aug 3 22:58:57 2007 +0000

    2007-08-03  Aurelien Jarno  <aurelien@aurel32.net>
    
    	* sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h:
    	(__local_multiple_threads): Declare as hidden only in libc and
    	in libpthread.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index ff0a7a4..7bb3387 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2007-08-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h:
+	(__local_multiple_threads): Declare as hidden only in libc and
+	in libpthread.
+
 2007-07-28  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h: Remove.
diff --git a/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h
index e01936a..51d6cf3 100644
--- a/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h
@@ -206,7 +206,11 @@ L(pre_end):						ASM_LINE_SEP	\
 # endif
 
 # ifndef __ASSEMBLER__
- extern int __local_multiple_threads attribute_hidden;
+#  if !defined NOT_IN_libc || defined IS_IN_libpthread
+extern int __local_multiple_threads attribute_hidden;
+#  else
+extern int __local_multiple_threads;
+#  endif
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 # else
 /* This ALT version requires newer kernel support */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5cfc3d44a502385d891820c7c5b17252eff994fa

commit 5cfc3d44a502385d891820c7c5b17252eff994fa
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Aug 1 04:21:31 2007 +0000

    Renamed all lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
    lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
    inline functions to __lll_* resp. __lll_robust_*.
    (LLL_MUTEX_LOCK_INITIALIZER): Remove.
    (lll_mutex_dead): Add private argument.
    (__lll_lock_wait_private): New prototype.
    (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
    __lll_robust_lock_timedwait): Add private argument to prototypes.
    (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
    call __lll_lock_wait_private, otherwise pass private to
    __lll_lock_wait.
    (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
    __lll_robust_timedlock): Add private argument, pass it to
    __lll_*wait functions.
    (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
    call __lll_unlock_wake_private, otherwise pass private to
    __lll_unlock_wake.
    (__lll_robust_unlock): Add private argument, pass it to
    __lll_robust_unlock_wake.
    (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
    lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
    argument, pass it through to __lll_* inline function.
    (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
    (lll_lock_t): Remove.
    (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
    __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
    lll_cond_wake, lll_cond_broadcast): Remove.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 5f08673..f3f2919 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -70,9 +70,6 @@
 #endif
 
 
-/* Initializer for compatibility lock.	*/
-#define LLL_MUTEX_LOCK_INITIALIZER (0)
-
 #define lll_futex_wait(futexp, val, private) \
   lll_futex_timed_wait (futexp, val, NULL, private)
 
@@ -96,7 +93,7 @@
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
   })
 
-#define lll_robust_mutex_dead(futexv) \
+#define lll_robust_dead(futexv) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
@@ -132,149 +129,130 @@
 
 
 static inline int __attribute__((always_inline))
-__lll_mutex_trylock(int *futex)
+__lll_trylock(int *futex)
 {
   return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
 }
-#define lll_mutex_trylock(lock)	__lll_mutex_trylock (&(lock))
+#define lll_trylock(lock)	__lll_trylock (&(lock))
 
 
 static inline int __attribute__((always_inline))
-__lll_mutex_cond_trylock(int *futex)
+__lll_cond_trylock(int *futex)
 {
   return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
 }
-#define lll_mutex_cond_trylock(lock)	__lll_mutex_cond_trylock (&(lock))
+#define lll_cond_trylock(lock)	__lll_cond_trylock (&(lock))
 
 
 static inline int __attribute__((always_inline))
-__lll_robust_mutex_trylock(int *futex, int id)
+__lll_robust_trylock(int *futex, int id)
 {
   return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0;
 }
-#define lll_robust_mutex_trylock(lock, id) \
-  __lll_robust_mutex_trylock (&(lock), id)
+#define lll_robust_trylock(lock, id) \
+  __lll_robust_trylock (&(lock), id)
 
-extern void __lll_lock_wait (int *futex) attribute_hidden;
-extern int __lll_robust_lock_wait (int *futex) attribute_hidden;
+extern void __lll_lock_wait_private (int *futex) attribute_hidden;
+extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
+extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
 
 static inline void __attribute__((always_inline))
-__lll_mutex_lock(int *futex)
+__lll_lock(int *futex, int private)
 {
   if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-    __lll_lock_wait (futex);
+    {
+      if (__builtin_constant_p (private) && private == LLL_PRIVATE)
+	__lll_lock_wait_private (futex);
+      else
+	__lll_lock_wait (futex, private);
+    }
 }
-#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
+#define lll_lock(futex, private) __lll_lock (&(futex), private)
 
 
 static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_lock (int *futex, int id)
+__lll_robust_lock (int *futex, int id, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
-    result = __lll_robust_lock_wait (futex);
+    result = __lll_robust_lock_wait (futex, private);
   return result;
 }
-#define lll_robust_mutex_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), id)
+#define lll_robust_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), id, private)
 
 
 static inline void __attribute__ ((always_inline))
-__lll_mutex_cond_lock (int *futex)
+__lll_cond_lock (int *futex, int private)
 {
   if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
-    __lll_lock_wait (futex);
+    __lll_lock_wait (futex, private);
 }
-#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
 
 
-#define lll_robust_mutex_cond_lock(futex, id) \
-  __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
+#define lll_robust_cond_lock(futex, id, private) \
+  __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
 
 
-extern int __lll_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
-extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
-	attribute_hidden;
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
+				 int private) attribute_hidden;
+extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
+					int private) attribute_hidden;
 
 static inline int __attribute__ ((always_inline))
-__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
+__lll_timedlock (int *futex, const struct timespec *abstime, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-    result = __lll_timedlock_wait (futex, abstime);
+    result = __lll_timedlock_wait (futex, abstime, private);
   return result;
 }
-#define lll_mutex_timedlock(futex, abstime) \
-  __lll_mutex_timedlock (&(futex), abstime)
+#define lll_timedlock(futex, abstime, private) \
+  __lll_timedlock (&(futex), abstime, private)
 
 
 static inline int __attribute__ ((always_inline))
-__lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime,
-			      int id)
+__lll_robust_timedlock (int *futex, const struct timespec *abstime,
+			int id, int private)
 {
   int result = 0;
   if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
     result = __lll_robust_timedlock_wait (futex, abstime);
   return result;
 }
-#define lll_robust_mutex_timedlock(futex, abstime, id) \
-  __lll_robust_mutex_timedlock (&(futex), abstime, id)
+#define lll_robust_timedlock(futex, abstime, id, private) \
+  __lll_robust_timedlock (&(futex), abstime, id, private)
 
 
 static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock (int *futex)
+__lll_unlock (int *futex, int private)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1, LLL_SHARED);
+    lll_futex_wake (futex, 1, private);
 }
-#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
 
 static inline void __attribute__ ((always_inline))
-__lll_robust_mutex_unlock (int *futex, int mask)
+__lll_robust_unlock (int *futex, int private)
 {
   int val = atomic_exchange_rel (futex, 0);
-  if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1, LLL_SHARED);
+  if (__builtin_expect (val & FUTEX_WAITERS, 0))
+    lll_futex_wake (futex, 1, private);
 }
-#define lll_robust_mutex_unlock(futex) \
-  __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
-
+#define lll_robust_unlock(futex, private) \
+  __lll_robust_unlock(&(futex), private)
 
-static inline void __attribute__ ((always_inline))
-__lll_mutex_unlock_force (int *futex)
-{
-  (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1, LLL_SHARED);
-}
-#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
 
-
-#define lll_mutex_islocked(futex) \
+#define lll_islocked(futex) \
   (futex != 0)
 
-
-/* Our internal lock implementation is identical to the binary-compatible
-   mutex implementation. */
-
-/* Type for lock object.  */
-typedef int lll_lock_t;
-
 /* Initializers for lock.  */
 #define LLL_LOCK_INITIALIZER		(0)
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
 
-/* The states of a lock are:
-    0  -  untaken
-    1  -  taken by one user
-   >1  -  taken by more users */
-
-#define lll_trylock(lock)	lll_mutex_trylock (lock)
-#define lll_lock(lock)		lll_mutex_lock (lock)
-#define lll_unlock(lock)	lll_mutex_unlock (lock)
-#define lll_islocked(lock)	lll_mutex_islocked (lock)
 
 /* The kernel notifies a process which uses CLONE_CLEARTID via futex
    wakeup when the clone terminates.  The memory location contains the
@@ -298,26 +276,4 @@ extern int __lll_timedwait_tid (int *, const struct timespec *)
     __res;						\
   })
 
-
-/* Conditional variable handling.  */
-
-extern void __lll_cond_wait (pthread_cond_t *cond)
-     attribute_hidden;
-extern int __lll_cond_timedwait (pthread_cond_t *cond,
-				 const struct timespec *abstime)
-     attribute_hidden;
-extern void __lll_cond_wake (pthread_cond_t *cond)
-     attribute_hidden;
-extern void __lll_cond_broadcast (pthread_cond_t *cond)
-     attribute_hidden;
-
-#define lll_cond_wait(cond) \
-  __lll_cond_wait (cond)
-#define lll_cond_timedwait(cond, abstime) \
-  __lll_cond_timedwait (cond, abstime)
-#define lll_cond_wake(cond) \
-  __lll_cond_wake (cond)
-#define lll_cond_broadcast(cond) \
-  __lll_cond_broadcast (cond)
-
 #endif	/* lowlevellock.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b599860dc82a3a3eb2744d6ba4917ef2a2f5ba47

commit b599860dc82a3a3eb2744d6ba4917ef2a2f5ba47
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Sat Jul 28 21:26:44 2007 +0000

    2007-07-28  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h: Remove.
    	* sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
    	(pthread_rwlock_t): Split __flags into __pad2, __pad1, __shared,
    	and __flags. Update comments. Update copyright.
    	* sysdeps/hppa/nptl/tls.h: Define THREAD_GSCOPE_FLAG_UNUSED,
    	THREAD_GSCOPE_FLAG_USED, THREAD_GSOPE_FLAG_WAIT,
    	THREAD_GSCOPE_RSEET_FLAG, THREAD_GSCOPE_SET_FLAG, THREAD_GSCOPE_WAIT.
    	Update copyright.
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c: Update copyright.
    	(__lll_lock_wait): Call lll_futex_wait with LLL_SHARED.
    	(__lll_timedlock_wait): Call lll_futex_timed_wait with LLL_SHARED.
    	(lll_unlock_Wake_cb): Use lll_private_futex_wake.
    	(___lll_timedwait_tid): Call lll_futex_timed_wait with LLL_SAHRED.
    	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define
    	FUTEX_PRIVATE_FLAG, LLL_PRIVATE, LLL_SHARED, lll_private_futex_wait,
    	lll_private_futex_timed_wait, lll_private_Futex_wake. Add private
    	argument to lll_futex_wait, lll_futex_timed_wait, lll_futex_wake,
    	lll_futex_wake_unlock.
    	* sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c: Update copyright.
    	(clear_once_control): Use lll_private_futex_wake.
    	(__pthread_once): Use lll_private_futex_wait, and
    	lll_private_futex_wake.
    
    2007-07-28  Randolph Chung  <tausq@debian.org>
    
    	* sysdeps/hppa/nptl/tls.h (DB_THREAD_SELF): Fix definition.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 967dadf..ff0a7a4 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,4 +1,33 @@
-2006-07-16  Jeff Bailey  <jbailey@raspberryginger.com>
+2007-07-28  Carlos O'Donell  <carlos@systemhalted.org>
+
+	* sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h: Remove.
+	* sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
+	(pthread_rwlock_t): Split __flags into __pad2, __pad1, __shared,
+	and __flags. Update comments. Update copyright.
+	* sysdeps/hppa/nptl/tls.h: Define THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSOPE_FLAG_WAIT,
+	THREAD_GSCOPE_RSEET_FLAG, THREAD_GSCOPE_SET_FLAG, THREAD_GSCOPE_WAIT.
+	Update copyright.
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c: Update copyright.
+	(__lll_lock_wait): Call lll_futex_wait with LLL_SHARED.
+	(__lll_timedlock_wait): Call lll_futex_timed_wait with LLL_SHARED.
+	(lll_unlock_Wake_cb): Use lll_private_futex_wake.
+	(___lll_timedwait_tid): Call lll_futex_timed_wait with LLL_SAHRED.
+	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Define
+	FUTEX_PRIVATE_FLAG, LLL_PRIVATE, LLL_SHARED, lll_private_futex_wait,
+	lll_private_futex_timed_wait, lll_private_Futex_wake. Add private
+	argument to lll_futex_wait, lll_futex_timed_wait, lll_futex_wake,
+	lll_futex_wake_unlock.
+	* sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c: Update copyright.
+	(clear_once_control): Use lll_private_futex_wake.
+	(__pthread_once): Use lll_private_futex_wait, and
+	lll_private_futex_wake.
+
+2007-07-28  Randolph Chung  <tausq@debian.org>
+
+	* sysdeps/hppa/nptl/tls.h (DB_THREAD_SELF): Fix definition.
+
+2007-06-16  Jeff Bailey  <jbailey@raspberryginger.com>
 
 	* sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Don't
 	include	asm/elf.h.  Declare elf_greg_t, elf_gregset_t,
diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h
index 0759aec..d2d725e 100644
--- a/sysdeps/hppa/nptl/tls.h
+++ b/sysdeps/hppa/nptl/tls.h
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/hppa version.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 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
@@ -117,11 +117,12 @@ typedef struct
    	__self - 1;				\
    })
 
-/* FIXME */
-/* Magic for libthread_db to know how to do THREAD_SELF.  */
+/* Magic for libthread_db to know how to do THREAD_SELF.
+   Our thread pointer is stored in cr27.  See asm/elf.h for the offset into
+   elf_gregset_t.  The thread descriptor is sizeof (struct pthread) away.  */
 # define DB_THREAD_SELF \
-  REGISTER (32, 32, 32 * 4, -sizeof (struct pthread))
-
+  REGISTER (32, 32, 53 * 4, -sizeof (struct pthread))
+ 
 /* Access to data in the thread descriptor is easy.  */
 # define THREAD_GETMEM(descr, member) \
   descr->member
@@ -146,6 +147,29 @@ static inline void __set_cr27(struct pthread *cr27)
 	: : "r" (cr27) : "r26" );
 }
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1);	     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
index e1c5325..62fc80c 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 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
@@ -19,13 +19,14 @@
 #ifndef _BITS_PTHREADTYPES_H
 #define _BITS_PTHREADTYPES_H	1
 
-/* Linuxthread type sizes:
+/* Linuxthread type sizes (bytes):
    sizeof(pthread_attr_t) = 0x24 (36)
    sizeof(pthread_mutex_t) = 0x30 (48)
    sizeof(pthread_mutexattr_t) = 0x4 (4)
    sizeof(pthread_cond_t) = 0x30 (48)
-   	= Grew to 64 bytes in NPTL.
-   No pthread_cond_compat_t ...
+	= Expanded to 64 bytes in NPTL. 
+   sizeof(pthread_cond_compat_t) = 0xc (12)
+	= Did not exist in Linuxthreads.
    sizeof(pthread_condattr_t) = 0x4 (4)
    sizeof(pthread_rwlock_t) = 0x40 (64)
    sizeof(pthread_rwlockattr_t) = 0x8 (8)
@@ -52,9 +53,9 @@ typedef unsigned long int pthread_t;
    implementation. For NPTL we use LWS Compare and 
    Exchange to implement primitives. */
 #if 0
-typedef struct {
+typedef volatile struct {
 	int lock[4];
-} __atomic_lock_t;
+} __attribute__ ((aligned(16))) __atomic_lock_t;
 #endif
 
 typedef union
@@ -149,7 +150,10 @@ typedef union
     unsigned int __nr_writers_queued;
     /* FLAGS must stay at this position in the structure to maintain
        binary compatibility.  */
-    unsigned int __flags;
+    unsigned char __pad2;
+    unsigned char __pad1;
+    unsigned char __shared;
+    unsigned char __flags;
     int __writer;
   } __data;
   char __size[__SIZEOF_PTHREAD_RWLOCK_T];
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h b/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h
deleted file mode 100644
index 528c2a7..0000000
--- a/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
-
-   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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef _INTERNALTYPES_H
-#define _INTERNALTYPES_H	1
-
-#include <stdint.h>
-
-
-struct pthread_attr
-{
-  /* Scheduler parameters and priority.  */
-  struct sched_param schedparam;
-  int schedpolicy;
-  /* Various flags like detachstate, scope, etc.  */
-  int flags;
-  /* Size of guard area.  */
-  size_t guardsize;
-  /* Stack handling.  */
-  void *stackaddr;
-  size_t stacksize;
-  /* Affinity map.  */
-  cpu_set_t *cpuset;
-  size_t cpusetsize;
-};
-
-#define ATTR_FLAG_DETACHSTATE		0x0001
-#define ATTR_FLAG_NOTINHERITSCHED	0x0002
-#define ATTR_FLAG_SCOPEPROCESS		0x0004
-#define ATTR_FLAG_STACKADDR		0x0008
-#define ATTR_FLAG_OLDATTR		0x0010
-#define ATTR_FLAG_SCHED_SET		0x0020
-#define ATTR_FLAG_POLICY_SET		0x0040
-
-
-/* Mutex attribute data structure.  */
-struct pthread_mutexattr
-{
-  /* Identifier for the kind of mutex.
-
-     Bit 31 is set if the mutex is to be shared between processes.
-
-     Bit 0 to 30 contain one of the PTHREAD_MUTEX_ values to identify
-     the type of the mutex.  */
-  int mutexkind;
-};
-
-
-/* Conditional variable attribute data structure.  */
-struct pthread_condattr
-{
-  /* Combination of values:
-
-     Bit 0  : flag whether coditional variable will be shareable between
-	      processes.
-
-     Bit 1-7: clock ID.  */
-  int value;
-};
-
-
-/* The __NWAITERS field is used as a counter and to house the number
-   of bits which represent the clock.  COND_CLOCK_BITS is the number
-   of bits reserved for the clock.  */
-#define COND_CLOCK_BITS	1
-
-
-/* Read-write lock variable attribute data structure.  */
-struct pthread_rwlockattr
-{
-  int lockkind;
-  int pshared;
-};
-
-
-/* Barrier data structure.  */
-struct pthread_barrier
-{
-  unsigned int curr_event;
-  int lock;
-  unsigned int left;
-  unsigned int init_count;
-};
-
-
-/* Barrier variable attribute data structure.  */
-struct pthread_barrierattr
-{
-  int pshared;
-};
-
-
-/* Thread-local data handling.  */
-struct pthread_key_struct
-{
-  /* Sequence numbers.  Even numbers indicated vacant entries.  Note
-     that zero is even.  We use uintptr_t to not require padding on
-     32- and 64-bit machines.  On 64-bit machines it helps to avoid
-     wrapping, too.  */
-  uintptr_t seq;
-
-  /* Destructor for the data.  */
-  void (*destr) (void *);
-};
-
-/* Check whether an entry is unused.  */
-#define KEY_UNUSED(p) (((p) & 1) == 0)
-/* Check whether a key is usable.  We cannot reuse an allocated key if
-   the sequence counter would overflow after the next destroy call.
-   This would mean that we potentially free memory for a key with the
-   same sequence.  This is *very* unlikely to happen, A program would
-   have to create and destroy a key 2^31 times (on 32-bit platforms,
-   on 64-bit platforms that would be 2^63).  If it should happen we
-   simply don't use this specific key anymore.  */
-#define KEY_USABLE(p) (((uintptr_t) (p)) < ((uintptr_t) ((p) + 2)))
-
-
-/* Handling of read-write lock data.  */
-// XXX For now there is only one flag.  Maybe more in future.
-#define RWLOCK_RECURSIVE(rwlock) ((rwlock)->__data.__flags != 0)
-
-
-/* Semaphore variable structure.  */
-struct sem
-{
-  unsigned int count;
-};
-
-
-/* Compatibility type for old conditional variable interfaces.  */
-typedef struct
-{
-  pthread_cond_t *cond;
-} pthread_cond_2_0_t;
-
-#endif	/* internaltypes.h */
-
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
index d2919ee..236d29c 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
@@ -1,5 +1,5 @@
 /* low level locking for pthread library.  Generic futex-using version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
 
@@ -31,7 +31,7 @@ __lll_lock_wait (lll_lock_t *futex)
     {
       int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
       if (oldval != 0)
-	lll_futex_wait (futex, 2);
+	lll_futex_wait (futex, 2, LLL_SHARED);
     }
   while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
 }
@@ -68,7 +68,7 @@ __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
       /* Wait.  */
       int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
       if (oldval != 0)
-	lll_futex_timed_wait (futex, 2, &rt);
+	lll_futex_timed_wait (futex, 2, &rt, LLL_SHARED);
     }
   while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
   return 0;
@@ -83,7 +83,7 @@ lll_unlock_wake_cb (lll_lock_t *futex)
   int val = atomic_exchange_rel (futex, 0);
 
   if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
+    lll_private_futex_wake (futex, 1);
   return 0;
 }
 
@@ -119,7 +119,7 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 	return ETIMEDOUT;
 
       /* Wait until thread terminates.  */
-      if (lll_futex_timed_wait (tidp, tid, &rt) == -ETIMEDOUT)
+      if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT)
 	return ETIMEDOUT;
     }
 
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index 3b2b0f1..f8a9555 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 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
@@ -39,6 +39,13 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_PRIVATE_FLAG	128
+
+/* Values for 'private' parameter of locking macros.  Yes, the
+   definition seems to be backwards.  But it is not.  The bit will be
+   reversed before passing to the system call.  */
+#define LLL_PRIVATE	0
+#define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 /* Initialize locks to zero.  */
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
@@ -48,39 +55,82 @@
 typedef int lll_lock_t;
 
 
-#define lll_futex_wait(futexp, val) \
+#define lll_futex_wait(futexp, val, private) \
+  lll_futex_timed_wait (futexp, val, 0, private)
+
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
     __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), 0);		      \
+			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
     __ret;								      \
   })
 
-#define lll_futex_timed_wait(futexp, val, timespec) \
+#define lll_futex_wake(futexp, nr, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
     __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
+			      (futexp), FUTEX_WAKE, (nr), 0);		      \
     __ret;								      \
   })
 
-#define lll_futex_wake(futexp, nr) \
+#define lll_private_futex_wait(futex, val) \
+  lll_private_futex_timed_wait (futex, val, NULL)
+
+#ifdef __ASSUME_PRIVATE_FUTEX
+# define lll_private_futex_timed_wait(futex, val, timeout) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
     __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAKE, (nr), 0);		      \
+			      (futexp), FUTEX_WAIT | FUTEX_PRIVATE_FLAG,      \
+			      (val), (timespec));			      \
     __ret;								      \
   })
 
+# define lll_private_futex_wake(futexp, nr) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret;							      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
+			      (futexp), FUTEX_WAKE | FUTEX_PRIVATE_FLAG,      \
+			      (nr), 0);					      \
+    __ret;								      \
+  })
+
+#else
+
+# define lll_private_futex_timed_wait(futexp, val, timespec) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret, __op;						      \
+    __op = FUTEX_WAIT | THREAD_GETMEM (THREAD_SELF, header.private_futex);    \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
+			      (futexp), __op, (val), (timespec));	      \
+    __ret;								      \
+  })
+
+# define lll_private_futex_wake(futexp, nr) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret, __op;						      \
+    __op = FUTEX_WAKE | THREAD_GETMEM (THREAD_SELF, header.private_futex);    \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
+			      (futexp), __op, (nr), 0);			      \
+    __ret;								      \
+  })
+#endif
+
+
+
 #define lll_robust_mutex_dead(futexv) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1);					      \
+      lll_futex_wake (__futexp, 1, 0);					      \
     }									      \
   while (0)
 
@@ -96,7 +146,7 @@ typedef int lll_lock_t;
   })
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
@@ -201,7 +251,7 @@ __lll_mutex_unlock (lll_lock_t *futex)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
+    lll_futex_wake (futex, 1, 0);
 }
 #define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
 
@@ -211,7 +261,7 @@ __lll_robust_mutex_unlock (int *futex, int mask)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1);
+    lll_futex_wake (futex, 1, 0);
 }
 #define lll_robust_mutex_unlock(futex) \
   __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
@@ -221,7 +271,7 @@ static inline void __attribute__ ((always_inline))
 __lll_mutex_unlock_force (lll_lock_t *futex)
 {
   (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1);
+  lll_futex_wake (futex, 1, 0);
 }
 #define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
 
@@ -256,10 +306,10 @@ extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
    thread ID while the clone is running and is reset to zero
    afterwards.	*/
 #define lll_wait_tid(tid) \
-  do {					\
-    __typeof (tid) __tid;		\
-    while ((__tid = (tid)) != 0)	\
-      lll_futex_wait (&(tid), __tid);	\
+  do {						\
+    __typeof (tid) __tid;			\
+    while ((__tid = (tid)) != 0)		\
+      lll_futex_wait (&(tid), __tid, 0);	\
   } while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c
index 649b752..b89e40c 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -30,7 +30,7 @@ clear_once_control (void *arg)
   pthread_once_t *once_control = (pthread_once_t *) arg;
 
   *once_control = 0;
-  lll_futex_wake (once_control, INT_MAX);
+  lll_private_futex_wake (once_control, INT_MAX);
 }
 
 
@@ -65,7 +65,7 @@ __pthread_once (once_control, init_routine)
 	  if (((oldval ^ newval) & -4) == 0)
 	    {
 	      /* Same generation, some other thread was faster. Wait.  */
-	      lll_futex_wait (once_control, newval);
+	      lll_private_futex_wait (once_control, newval);
 	      continue;
 	    }
 	}
@@ -84,7 +84,7 @@ __pthread_once (once_control, init_routine)
       atomic_increment (once_control);
 
       /* Wake up all other threads.  */
-      lll_futex_wake (once_control, INT_MAX);
+      lll_private_futex_wake (once_control, INT_MAX);
       break;
     }
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=42cca94a7485d62a2594e0f2c95c85eb36982814

commit 42cca94a7485d62a2594e0f2c95c85eb36982814
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Jul 28 19:31:35 2007 +0000

    (FUTEX_PRIVATE_FLAG,
    LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
    (lll_futex_wait): Add private argument, define as wrapper around
    lll_futex_timed_wait.
    (lll_futex_timed_wait, lll_futex_wake): Add private argument,
    use __lll_private_flag macro.
    (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
    __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 04ac006..5f08673 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -36,34 +36,63 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_PRIVATE_FLAG	128
+
+/* Values for 'private' parameter of locking macros.  Yes, the
+   definition seems to be backwards.  But it is not.  The bit will be
+   reversed before passing to the system call.  */
+#define LLL_PRIVATE	0
+#define LLL_SHARED	FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private.  */
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+#  define __lll_private_flag(fl, private) \
+  ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+#  define __lll_private_flag(fl, private) \
+  (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+#  define __lll_private_flag(fl, private) \
+  (__builtin_constant_p (private)					      \
+   ? ((private) == 0							      \
+      ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))	      \
+      : (fl))								      \
+   : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
+	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif	      
+#endif
+
 
 /* Initializer for compatibility lock.	*/
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
 
-#define lll_futex_wait(futexp, val) \
-  ({									      \
-    INTERNAL_SYSCALL_DECL (__err);					      \
-    long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), 0);		      \
-    INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
-  })
+#define lll_futex_wait(futexp, val, private) \
+  lll_futex_timed_wait (futexp, val, NULL, private)
 
-#define lll_futex_timed_wait(futexp, val, timespec) \
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAIT, private),	      \
+			      (val), (timespec));			      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
   })
 
-#define lll_futex_wake(futexp, nr) \
+#define lll_futex_wake(futexp, nr, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
-    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAKE, (nr), 0);		      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp),		      \
+			      __lll_private_flag (FUTEX_WAKE, private),	      \
+			      (nr), 0);					      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;		      \
   })
 
@@ -72,7 +101,7 @@
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1);					      \
+      lll_futex_wake (__futexp, 1, LLL_SHARED);				      \
     }									      \
   while (0)
 
@@ -198,7 +227,7 @@ __lll_mutex_unlock (int *futex)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
+    lll_futex_wake (futex, 1, LLL_SHARED);
 }
 #define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
 
@@ -208,7 +237,7 @@ __lll_robust_mutex_unlock (int *futex, int mask)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1);
+    lll_futex_wake (futex, 1, LLL_SHARED);
 }
 #define lll_robust_mutex_unlock(futex) \
   __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
@@ -218,7 +247,7 @@ static inline void __attribute__ ((always_inline))
 __lll_mutex_unlock_force (int *futex)
 {
   (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1);
+  lll_futex_wake (futex, 1, LLL_SHARED);
 }
 #define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
 
@@ -252,10 +281,10 @@ typedef int lll_lock_t;
    thread ID while the clone is running and is reset to zero
    afterwards.	*/
 #define lll_wait_tid(tid) \
-  do {					\
-    __typeof (tid) __tid;		\
-    while ((__tid = (tid)) != 0)	\
-      lll_futex_wait (&(tid), __tid);	\
+  do {							\
+    __typeof (tid) __tid;				\
+    while ((__tid = (tid)) != 0)			\
+      lll_futex_wait (&(tid), __tid, LLL_SHARED);	\
   } while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2b54437c2f4f116442a52861100339aa36783f8f

commit 2b54437c2f4f116442a52861100339aa36783f8f
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Jul 28 19:31:17 2007 +0000

    (clear_once_control, __pthread_once): Add LLL_PRIVATE as last argument
    to lll_futex_*.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c b/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c
index 79a3c47..0e7e979 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 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
@@ -28,7 +28,7 @@ clear_once_control (void *arg)
   pthread_once_t *once_control = (pthread_once_t *) arg;
 
   *once_control = 0;
-  lll_futex_wake (once_control, INT_MAX);
+  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
 }
 
 int
@@ -72,7 +72,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
 	break;
 
       /* Same generation, some other thread was faster. Wait.  */
-      lll_futex_wait (once_control, oldval);
+      lll_futex_wait (once_control, oldval, LLL_PRIVATE);
     }
 
   /* This thread is the first here.  Do the initialization.
@@ -88,7 +88,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
   atomic_increment (once_control);
 
   /* Wake up all other threads.  */
-  lll_futex_wake (once_control, INT_MAX);
+  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
 
   return 0;
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=83ab449d4156bb3d1c0e0ce22113164dad4cf151

commit 83ab449d4156bb3d1c0e0ce22113164dad4cf151
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Jul 28 19:30:20 2007 +0000

    Replace lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).

diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
index 388a399..e77b1ff 100644
--- a/sysdeps/alpha/nptl/tls.h
+++ b/sysdeps/alpha/nptl/tls.h
@@ -131,7 +131,7 @@ typedef struct
 	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
 			       THREAD_GSCOPE_FLAG_UNUSED);		     \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
-	lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1);	     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);   \
     }									     \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=391da2016b6daffbb764589bc1e64cd10820249a

commit 391da2016b6daffbb764589bc1e64cd10820249a
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 13 12:48:34 2007 +0000

    2007-07-13  Carlos O'Donell  <carlos@codesourcery.com>
    
    	* sysdeps/mips/bits/wordsize.h [_MIPS_SIM == _ABI64]:
    	Define __WORDSIZE_COMPAT32 as 1.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 32e0580..43aadf8 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2007-07-13  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* sysdeps/mips/bits/wordsize.h [_MIPS_SIM == _ABI64]:
+	Define __WORDSIZE_COMPAT32 as 1.
+
 2007-07-13  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h: Copy from
diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h
index 666c7ad..06967e5 100644
--- a/sysdeps/mips/bits/wordsize.h
+++ b/sysdeps/mips/bits/wordsize.h
@@ -17,3 +17,6 @@
    02111-1307 USA.  */
 
 #define __WORDSIZE	_MIPS_SZPTR
+#if _MIPS_SIM == _ABI64
+# define __WORDSIZE_COMPAT32	1
+#endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e9f19437e2da14c26d964d19e3f945229825dd00

commit e9f19437e2da14c26d964d19e3f945229825dd00
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 13 12:46:28 2007 +0000

    Update date.

diff --git a/ChangeLog.powerpc b/ChangeLog.powerpc
index 619866e..c775ee0 100644
--- a/ChangeLog.powerpc
+++ b/ChangeLog.powerpc
@@ -1,4 +1,4 @@
-2007-06-07  Steven Munroe  <sjmunroe@us.ibm.com>
+2007-07-13  Steven Munroe  <sjmunroe@us.ibm.com>
 
 	* sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2b4095f39492ea7788110960273e209d190ca3c2

commit 2b4095f39492ea7788110960273e209d190ca3c2
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 13 12:46:12 2007 +0000

    2007-07-13  Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h: Copy from
    	libc/nptl/sysdeps/unix/sysv/linux/bits/local_lim.h.  Increase
    	PTHREAD_STACK_MIN.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 3ea63cd..32e0580 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2007-07-13  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h: Copy from
+	libc/nptl/sysdeps/unix/sysv/linux/bits/local_lim.h.  Increase
+	PTHREAD_STACK_MIN.
+
 2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Comment fix.
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h b/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h
new file mode 100644
index 0000000..4c3f5f6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h
@@ -0,0 +1,93 @@
+/* Minimum guaranteed maximum values for system limits.  MIPS Linux version.
+   Copyright (C) 1993-1998,2000,2002,2003,2004,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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+   and defines LINK_MAX although filesystems have different maxima.  A
+   similar thing is true for OPEN_MAX: the limit can be changed at
+   runtime and therefore the macro must not be defined.  Remove this
+   after including the header if necessary.  */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information.  */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN?  */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX?  */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX?  */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process.  */
+#define _POSIX_THREAD_KEYS_MAX	128
+/* This is the value this implementation supports.  */
+#define PTHREAD_KEYS_MAX	1024
+
+/* Controlling the iterations of destructors for thread-specific data.  */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
+/* Number of iterations this implementation does.  */
+#define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process.  */
+#define _POSIX_THREAD_THREADS_MAX	64
+/* We have no predefined limit on the number of threads.  */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+   priority level.  */
+#define AIO_PRIO_DELTA_MAX	20
+
+/* Minimum size for a thread.  At least two pages with 64k pages.  */
+#define PTHREAD_STACK_MIN	131072
+
+/* Maximum number of timer expiration overruns.  */
+#define DELAYTIMER_MAX	2147483647
+
+/* Maximum tty name length.  */
+#define TTY_NAME_MAX		32
+
+/* Maximum login name length.  This is arbitrary.  */
+#define LOGIN_NAME_MAX		256
+
+/* Maximum host name length.  */
+#define HOST_NAME_MAX		64
+
+/* Maximum message queue priority level.  */
+#define MQ_PRIO_MAX		32768
+
+/* Maximum value the semaphore can have.  */
+#define SEM_VALUE_MAX   (2147483647)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=19584095cc78af7b4911f4957d3215d631283cf3

commit 19584095cc78af7b4911f4957d3215d631283cf3
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Fri Jul 13 12:43:40 2007 +0000

    	* sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.

diff --git a/ChangeLog.powerpc b/ChangeLog.powerpc
index 1ea6746..619866e 100644
--- a/ChangeLog.powerpc
+++ b/ChangeLog.powerpc
@@ -1,3 +1,7 @@
+2007-06-07  Steven Munroe  <sjmunroe@us.ibm.com>
+
+	* sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.
+
 2007-05-23  Steven Munroe  <sjmunroe@us.ibm.com>
 
 	* sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Disable
diff --git a/sysdeps/powerpc/nofpu/Makefile b/sysdeps/powerpc/nofpu/Makefile
index c91acd9..6bdff45 100644
--- a/sysdeps/powerpc/nofpu/Makefile
+++ b/sysdeps/powerpc/nofpu/Makefile
@@ -6,7 +6,7 @@ sysdep_routines += $(gcc-single-routines) $(gcc-double-routines) \
 endif
 
 ifeq ($(subdir),math)
-libm-support += fenv_const fe_nomask
+libm-support += fenv_const
 CPPFLAGS += -I../soft-fp/
 # The follow CFLAGS are a work around for GCC Bugzilla Bug 29253
 # "expand_abs wrong default code for floating point"

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8323b1abc6a9f7a4a2458be35bd4cc941da725af

commit 8323b1abc6a9f7a4a2458be35bd4cc941da725af
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Tue Jul 10 13:35:30 2007 +0000

    	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Use
    	lll_private_futex_wake.
    	* sysdeps/unix/sysv/linux/arm/check_pf.c: Update from generic version.
    	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
    	(pthread_cancel_init): Add noinline and barriers.
    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
    	(__lll_timedlock_wait): Update call to lll_futex_timed_wait.
    	(__lll_timedwait_tid): Likewise.
    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h (LLL_PRIVATE,
    	LLL_SHARED): Define.
    	(lll_futex_wait): Use lll_futex_timed_wait.
    	(lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Take a
    	PRIVATE argument.
    	(lll_private_futex_wait, lll_private_futex_timed_wait,
    	lll_private_futex_wake): New.
    	(lll_robust_mutex_dead,  __lll_mutex_lock, __lll_mutex_cond_lock,
    	__lll_mutex_unlock, __lll_robust_mutex_unlock,
    	__lll_mutex_unlock_force, lll_wait_tid): Update calls.
    	* sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c (clear_once_control,
    	__pthread_once): Use private futexes.
    	* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
    	(pthread_cancel_init): Add noinline and barriers.
    
    	* sysdeps/unix/sysv/aix/bits/fcntl.h,
    	sysdeps/unix/sysv/linux/am33/bits/fcntl.h,
    	sysdeps/unix/sysv/linux/arm/bits/fcntl.h,
    	sysdeps/unix/sysv/linux/cris/bits/fcntl.h,
    	sysdeps/unix/sysv/linux/m68k/bits/fcntl.h,
    	sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Comment fix.
    
    	* sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h (SEM_VALUE_MAX):
    	Delete.
    	* sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h (SEM_VALUE_MAX):
    	Delete.

diff --git a/ChangeLog.aix b/ChangeLog.aix
index 5305d33..3e3e4df 100644
--- a/ChangeLog.aix
+++ b/ChangeLog.aix
@@ -1,3 +1,7 @@
+2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/aix/bits/fcntl.h: Comment fix.
+
 2005-12-27  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/unix/sysv/aix/bits/setjmp.h (_JMPBUF_UNWINDS): Take third
diff --git a/ChangeLog.am33 b/ChangeLog.am33
index f794cc5..c10f8d0 100644
--- a/ChangeLog.am33
+++ b/ChangeLog.am33
@@ -1,3 +1,7 @@
+2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/am33/bits/fcntl.h: Comment fix.
+
 2006-01-12  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/am33/jmpbuf-unwind.h: Include <jmpbuf-offsets.h>.
diff --git a/ChangeLog.arm b/ChangeLog.arm
index 39e14dc..5a24c54 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,33 @@
+2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_RESET_FLAG): Use
+	lll_private_futex_wake.
+	* sysdeps/unix/sysv/linux/arm/check_pf.c: Update from generic version.
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+	(pthread_cancel_init): Add noinline and barriers.
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
+	(__lll_timedlock_wait): Update call to lll_futex_timed_wait.
+	(__lll_timedwait_tid): Likewise.
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h (LLL_PRIVATE,
+	LLL_SHARED): Define.
+	(lll_futex_wait): Use lll_futex_timed_wait.
+	(lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Take a
+	PRIVATE argument.
+	(lll_private_futex_wait, lll_private_futex_timed_wait,
+	lll_private_futex_wake): New.
+	(lll_robust_mutex_dead,  __lll_mutex_lock, __lll_mutex_cond_lock,
+	__lll_mutex_unlock, __lll_robust_mutex_unlock,
+	__lll_mutex_unlock_force, lll_wait_tid): Update calls.
+	* sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c (clear_once_control,
+	__pthread_once): Use private futexes.
+	* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+	(pthread_cancel_init): Add noinline and barriers.
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Comment fix.
+
+	* sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h (SEM_VALUE_MAX):
+	Delete.
+
 2007-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
diff --git a/ChangeLog.cris b/ChangeLog.cris
index af91a1d..746c89c 100644
--- a/ChangeLog.cris
+++ b/ChangeLog.cris
@@ -1,3 +1,7 @@
+2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/cris/bits/fcntl.h: Comment fix.
+
 2005-12-27  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/cris/bits/setjmp.h (_JMPBUF_UNWINDS): Take third argument
diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index 51f6dfa..fb591ad 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,7 @@
+2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Comment fix.
+
 2006-11-28  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/unix/sysv/linux/m68k/sysdep.h (DOARGS_6, _DOARGS_6)
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 346237f..3ea63cd 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,10 @@
+2007-07-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Comment fix.
+
+	* sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h (SEM_VALUE_MAX):
+	Delete.
+
 2007-06-07  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (ARGIFY): New.
diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h
index ae2aecc..e80b6b8 100644
--- a/sysdeps/arm/nptl/tls.h
+++ b/sysdeps/arm/nptl/tls.h
@@ -142,7 +142,7 @@ typedef struct
 	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
 			       THREAD_GSCOPE_FLAG_UNUSED);		     \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
-	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+	lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1);	     \
     }									     \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
diff --git a/sysdeps/unix/sysv/aix/bits/fcntl.h b/sysdeps/unix/sysv/aix/bits/fcntl.h
index c65b8be..d53c0f7 100644
--- a/sysdeps/unix/sysv/aix/bits/fcntl.h
+++ b/sysdeps/unix/sysv/aix/bits/fcntl.h
@@ -79,7 +79,7 @@
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
 
-/* For F_[GET|SET]FL.  */
+/* For F_[GET|SET]FD.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/am33/bits/fcntl.h b/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
index 4c276c5..f2c88fa 100644
--- a/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
@@ -94,7 +94,7 @@
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
 #endif
 
-/* For F_[GET|SET]FL.  */
+/* For F_[GET|SET]FD.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index 7c7b7c2..59539e1 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -98,7 +98,7 @@
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
 #endif
 
-/* For F_[GET|SET]FL.  */
+/* For F_[GET|SET]FD.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/arm/check_pf.c b/sysdeps/unix/sysv/linux/arm/check_pf.c
index ee13d80..dfca75d 100644
--- a/sysdeps/unix/sysv/linux/arm/check_pf.c
+++ b/sysdeps/unix/sysv/linux/arm/check_pf.c
@@ -1,5 +1,5 @@
-/* Determine protocol families for which interfaces exist.  ARM Linux version.
-   Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+/* Determine protocol families for which interfaces exist.  Linux version.
+   Copyright (C) 2003, 2006, 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
@@ -69,17 +69,38 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
   memset (&nladdr, '\0', sizeof (nladdr));
   nladdr.nl_family = AF_NETLINK;
 
+#ifdef PAGE_SIZE
+  /* Help the compiler optimize out the malloc call if PAGE_SIZE
+     is constant and smaller or equal to PTHREAD_STACK_MIN/4.  */
+  const size_t buf_size = PAGE_SIZE;
+#else
+  const size_t buf_size = __getpagesize ();
+#endif
+  bool use_malloc = false;
+  char *buf;
+
+  if (__libc_use_alloca (buf_size))
+    buf = alloca (buf_size);
+  else
+    {
+      buf = malloc (buf_size);
+      if (buf != NULL)
+	use_malloc = true;
+      else
+	goto out_fail;
+    }
+
+  struct iovec iov = { buf, buf_size };
+
   if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
 				    (struct sockaddr *) &nladdr,
 				    sizeof (nladdr))) < 0)
-    return -1;
+    goto out_fail;
 
   *seen_ipv4 = false;
   *seen_ipv6 = false;
 
   bool done = false;
-  char buf[4096];
-  struct iovec iov = { buf, sizeof (buf) };
   struct in6ailist
   {
     struct in6addrinfo info;
@@ -99,10 +120,10 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
 
       ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
       if (read_len < 0)
-	return -1;
+	goto out_fail;
 
       if (msg.msg_flags & MSG_TRUNC)
-	return -1;
+	goto out_fail;
 
       struct nlmsghdr *nlmh;
       for (nlmh = (struct nlmsghdr *) buf;
@@ -116,40 +137,72 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
 	  if (nlmh->nlmsg_type == RTM_NEWADDR)
 	    {
 	      struct ifaddrmsg *ifam = (struct ifaddrmsg *) NLMSG_DATA (nlmh);
+	      struct rtattr *rta = IFA_RTA (ifam);
+	      size_t len = nlmh->nlmsg_len - NLMSG_LENGTH (sizeof (*ifam));
 
 	      switch (ifam->ifa_family)
 		{
+		  const void *local;
+		  const void *address;
+
 		case AF_INET:
-		  *seen_ipv4 = true;
+		  local = NULL;
+		  address = NULL;
+		  while (RTA_OK (rta, len))
+		    {
+		      switch (rta->rta_type)
+			{
+			case IFA_LOCAL:
+			  local = RTA_DATA (rta);
+			  break;
+
+			case IFA_ADDRESS:
+			  address = RTA_DATA (rta);
+			  goto out_v4;
+			}
+
+		      rta = RTA_NEXT (rta, len);
+		    }
+
+		  if (local != NULL)
+		    {
+		    out_v4:
+		      if (*(const in_addr_t *) (address ?: local)
+			  != htonl (INADDR_LOOPBACK))
+			*seen_ipv4 = true;
+		    }
 		  break;
+
 		case AF_INET6:
-		  *seen_ipv6 = true;
+		  local = NULL;
+		  address = NULL;
+		  while (RTA_OK (rta, len))
+		    {
+		      switch (rta->rta_type)
+			{
+			case IFA_LOCAL:
+			  local = RTA_DATA (rta);
+			  break;
+
+			case IFA_ADDRESS:
+			  address = RTA_DATA (rta);
+			  goto out_v6;
+			}
+
+		      rta = RTA_NEXT (rta, len);
+		    }
+
+		  if (local != NULL)
+		    {
+		    out_v6:
+		      if (!IN6_IS_ADDR_LOOPBACK (address ?: local))
+			*seen_ipv6 = true;
+		    }
 
 		  if (ifam->ifa_flags & (IFA_F_DEPRECATED
 					 | IFA_F_TEMPORARY
 					 | IFA_F_HOMEADDRESS))
 		    {
-		      struct rtattr *rta = IFA_RTA (ifam);
-		      size_t len = (nlmh->nlmsg_len
-				    - NLMSG_LENGTH (sizeof (*ifam)));
-		      void *local = NULL;
-		      void *address = NULL;
-		      while (RTA_OK (rta, len))
-			{
-			  switch (rta->rta_type)
-			    {
-			    case IFA_LOCAL:
-			      local = RTA_DATA (rta);
-			      break;
-
-			    case IFA_ADDRESS:
-			      address = RTA_DATA (rta);
-			      break;
-			    }
-
-			  rta = RTA_NEXT (rta, len);
-			}
-
 		      struct in6ailist *newp = alloca (sizeof (*newp));
 		      newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
 					   ? in6ai_deprecated : 0)
@@ -180,11 +233,11 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
 
   close_not_cancel_no_status (fd);
 
-  if (in6ailist != NULL)
+  if (*seen_ipv6 && in6ailist != NULL)
     {
       *in6ai = malloc (in6ailistlen * sizeof (**in6ai));
       if (*in6ai == NULL)
-	return -1;
+	goto out_fail;
 
       *in6ailen = in6ailistlen;
 
@@ -196,7 +249,14 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
       while (in6ailist != NULL);
     }
 
+  if (use_malloc)
+    free (buf);
   return 0;
+
+out_fail:
+  if (use_malloc)
+    free (buf);
+  return -1;
 }
 
 
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
index ca1cc8d..24ce61b 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
@@ -30,13 +30,18 @@ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
 static _Unwind_Word (*libgcc_s_getcfa) (struct _Unwind_Context *);
 
 void
+__attribute_noinline__
 pthread_cancel_init (void)
 {
   void *resume, *personality, *forcedunwind, *getcfa;
   void *handle;
 
   if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
-    return;
+    {
+      /* Force gcc to reload all values.  */
+      asm volatile ("" ::: "memory");
+      return;
+    }
 
   handle = __libc_dlopen ("libgcc_s.so.1");
 
@@ -55,6 +60,10 @@ pthread_cancel_init (void)
   libgcc_s_resume = resume;
   libgcc_s_personality = personality;
   libgcc_s_forcedunwind = forcedunwind;
+  /* Make sure libgcc_s_getcfa is written last.  Otherwise,
+     pthread_cancel_init might return early even when the pointer the
+     caller is interested in is not initialized yet.  */
+  atomic_write_barrier ();
   libgcc_s_getcfa = getcfa;
 }
 
@@ -92,6 +101,7 @@ __gcc_personality_v0 (_Unwind_State state,
 {
   if (__builtin_expect (libgcc_s_personality == NULL, 0))
     pthread_cancel_init ();
+
   return libgcc_s_personality (state, ue_header, context);
 }
 
@@ -101,6 +111,7 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
 {
   if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0))
     pthread_cancel_init ();
+
   return libgcc_s_forcedunwind (exc, stop, stop_argument);
 }
 
@@ -109,5 +120,6 @@ _Unwind_GetCFA (struct _Unwind_Context *context)
 {
   if (__builtin_expect (libgcc_s_getcfa == NULL, 0))
     pthread_cancel_init ();
+
   return libgcc_s_getcfa (context);
 }
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h b/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h
index 3fc647d..dadfac2 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005, 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
@@ -27,9 +27,6 @@
 /* Value returned if `sem_open' failed.  */
 #define SEM_FAILED      ((sem_t *) 0)
 
-/* Maximum value the semaphore can have.  */
-#define SEM_VALUE_MAX   ((int) ((~0u) >> 1))
-
 
 typedef union
 {
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
index 66a4d7b..44867ec 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
@@ -55,7 +55,8 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime)
       if (rt.tv_sec < 0)
 	return ETIMEDOUT;
 
-      lll_futex_timed_wait (futex, 2, &rt);
+      // XYZ: Lost the lock to check whether it was private.
+      lll_futex_timed_wait (futex, 2, &rt, LLL_SHARED);
     }
   while (atomic_exchange_acq (futex, 2) != 0);
 
@@ -96,7 +97,8 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 	return ETIMEDOUT;
 
       /* Wait until thread terminates.  */
-      if (lll_futex_timed_wait (tidp, tid, &rt) == -ETIMEDOUT)
+      // XYZ: Lost the lock to check whether it was private.
+      if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT)
 	return ETIMEDOUT;
     }
 
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 15cf147..468fe71 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -12,7 +12,7 @@
    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 Libr	\ary; if not, write to the Free
+   License along with the GNU C Library; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
@@ -36,42 +36,87 @@
 #define FUTEX_TRYLOCK_PI	8
 #define FUTEX_PRIVATE_FLAG	128
 
+/* Values for 'private' parameter of locking macros.  Yes, the
+   definition seems to be backwards.  But it is not.  The bit will be
+   reversed before passing to the system call.  */
+#define LLL_PRIVATE	0
+#define LLL_SHARED	FUTEX_PRIVATE_FLAG
+
 /* Initializer for compatibility lock.	*/
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
 
-#define lll_futex_wait(futexp, val) \
+#define lll_futex_wait(futexp, val, private) \
+  lll_futex_timed_wait(futexp, val, NULL, private)
+
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
     __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), 0);		      \
+			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
     __ret;								      \
   })
 
-#define lll_futex_timed_wait(futexp, val, timespec) \
+#define lll_futex_wake(futexp, nr, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
     __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAIT, (val), (timespec));	      \
+			      (futexp), FUTEX_WAKE, (nr), 0);		      \
     __ret;								      \
   })
 
-#define lll_futex_wake(futexp, nr) \
+#define lll_private_futex_wait(futexp, val) \
+  lll_private_futex_timed_wait(futexp, val, NULL)
+
+#ifdef __ASSUME_PRIVATE_FUTEX
+#define lll_private_futex_timed_wait(futexp, val, timespec) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
     __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
-			      (futexp), FUTEX_WAKE, (nr), 0);		      \
+			      (futexp), FUTEX_WAIT | FUTEX_PRIVATE_FLAG,      \
+			      (val), (timespec));			      \
+    __ret;								      \
+  })
+
+#define lll_private_futex_wake(futexp, nr) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret;							      \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
+			      (futexp), FUTEX_WAKE | FUTEX_PRIVATE_FLAG,      \
+			      (nr), (0));				      \
+    __ret;								      \
+  })
+#else
+#define lll_private_futex_timed_wait(futexp, val, timespec) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret, __op;						      \
+    __op = FUTEX_WAIT | THREAD_GETMEM (THREAD_SELF, header.private_futex);    \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
+			      (futexp), __op, (val), (timespec));	      \
+    __ret;								      \
+  })
+
+#define lll_private_futex_wake(futexp, nr) \
+  ({									      \
+    INTERNAL_SYSCALL_DECL (__err);					      \
+    long int __ret, __op;						      \
+    __op = FUTEX_WAKE | THREAD_GETMEM (THREAD_SELF, header.private_futex);    \
+    __ret = INTERNAL_SYSCALL (futex, __err, 4,				      \
+			      (futexp), __op, (nr), 0);			      \
     __ret;								      \
   })
+#endif
 
 #define lll_robust_mutex_dead(futexv) \
   do									      \
     {									      \
       int *__futexp = &(futexv);					      \
       atomic_or (__futexp, FUTEX_OWNER_DIED);				      \
-      lll_futex_wake (__futexp, 1);					      \
+      lll_futex_wake (__futexp, 1, 0);					      \
     }									      \
   while (0)
 
@@ -88,7 +133,7 @@
 
 
 /* Returns non-zero if error happened, zero if success.  */
-#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
   ({									      \
     INTERNAL_SYSCALL_DECL (__err);					      \
     long int __ret;							      \
@@ -156,7 +201,7 @@ __lll_mutex_lock (int *futex)
   if (__builtin_expect (val != 0, 0))
     {
       while (atomic_exchange_acq (futex, 2) != 0)
-	lll_futex_wait (futex, 2);
+	lll_futex_wait (futex, 2, 0);
     }
 }
 #define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
@@ -182,7 +227,7 @@ __lll_mutex_cond_lock (int *futex)
   if (__builtin_expect (val != 0, 0))
     {
       while (atomic_exchange_acq (futex, 2) != 0)
-	lll_futex_wait (futex, 2);
+	lll_futex_wait (futex, 2, 0);
     }
 }
 #define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
@@ -229,7 +274,7 @@ __lll_mutex_unlock (int *futex)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
+    lll_futex_wake (futex, 1, 0);
 }
 #define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
 
@@ -239,7 +284,7 @@ __lll_robust_mutex_unlock (int *futex, int mask)
 {
   int val = atomic_exchange_rel (futex, 0);
   if (__builtin_expect (val & mask, 0))
-    lll_futex_wake (futex, 1);
+    lll_futex_wake (futex, 1, 0);
 }
 #define lll_robust_mutex_unlock(futex) \
   __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
@@ -249,7 +294,7 @@ static inline void __attribute__ ((always_inline))
 __lll_mutex_unlock_force (int *futex)
 {
   (void) atomic_exchange_rel (futex, 0);
-  lll_futex_wake (futex, 1);
+  lll_futex_wake (futex, 1, 0);
 }
 #define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
 
@@ -286,7 +331,7 @@ typedef int lll_lock_t;
   do {					\
     __typeof (tid) __tid;		\
     while ((__tid = (tid)) != 0)	\
-      lll_futex_wait (&(tid), __tid);	\
+      lll_futex_wait (&(tid), __tid, 0);\
   } while (0)
 
 extern int __lll_timedwait_tid (int *, const struct timespec *)
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c b/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
index c892581..909e832 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
@@ -27,7 +27,7 @@ clear_once_control (void *arg)
   pthread_once_t *once_control = (pthread_once_t *) arg;
 
   *once_control = 0;
-  lll_futex_wake (once_control, INT_MAX);
+  lll_private_futex_wake (once_control, INT_MAX);
 }
 
 int
@@ -66,7 +66,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
 	break;
 
       /* Same generation, some other thread was faster. Wait.  */
-      lll_futex_wait (once_control, oldval);
+      lll_private_futex_wait (once_control, oldval);
     }
 
   /* This thread is the first here.  Do the initialization.
@@ -82,7 +82,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
   *once_control = __fork_generation | 2;
 
   /* Wake up all other threads.  */
-  lll_futex_wake (once_control, INT_MAX);
+  lll_private_futex_wake (once_control, INT_MAX);
 
   return 0;
 }
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index ba5327a..b281963 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -33,6 +33,7 @@ static void (*libgcc_s_sjlj_register) (struct SjLj_Function_Context *);
 static void (*libgcc_s_sjlj_unregister) (struct SjLj_Function_Context *);
 
 void
+__attribute_noinline__
 pthread_cancel_init (void)
 {
   void *resume, *personality, *forcedunwind, *getcfa;
@@ -40,7 +41,11 @@ pthread_cancel_init (void)
   void *sjlj_register, *sjlj_unregister;
 
   if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
-    return;
+    {
+      /* Force gcc to reload all values.  */
+      asm volatile ("" ::: "memory");
+      return;
+    }
 
   handle = __libc_dlopen ("libgcc_s.so.1");
 
@@ -58,9 +63,13 @@ pthread_cancel_init (void)
   libgcc_s_resume = resume;
   libgcc_s_personality = personality;
   libgcc_s_forcedunwind = forcedunwind;
-  libgcc_s_getcfa = getcfa;
   libgcc_s_sjlj_register = sjlj_register;
   libgcc_s_sjlj_unregister = sjlj_unregister;
+  /* Make sure libgcc_s_getcfa is written last.  Otherwise,
+     pthread_cancel_init might return early even when the pointer the
+     caller is interested in is not initialized yet.  */
+  atomic_write_barrier ();
+  libgcc_s_getcfa = getcfa;
 }
 
 void
@@ -68,6 +77,7 @@ _Unwind_Resume (struct _Unwind_Exception *exc)
 {
   if (__builtin_expect (libgcc_s_resume == NULL, 0))
     pthread_cancel_init ();
+
   libgcc_s_resume (exc);
 }
 
@@ -79,6 +89,7 @@ __gcc_personality_v0 (int version, _Unwind_Action actions,
 {
   if (__builtin_expect (libgcc_s_personality == NULL, 0))
     pthread_cancel_init ();
+
   return libgcc_s_personality (version, actions, exception_class,
 			       ue_header, context);
 }
@@ -89,6 +100,7 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
 {
   if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0))
     pthread_cancel_init ();
+
   return libgcc_s_forcedunwind (exc, stop, stop_argument);
 }
 
@@ -97,6 +109,7 @@ _Unwind_GetCFA (struct _Unwind_Context *context)
 {
   if (__builtin_expect (libgcc_s_getcfa == NULL, 0))
     pthread_cancel_init ();
+
   return libgcc_s_getcfa (context);
 }
 
@@ -105,6 +118,7 @@ _Unwind_SjLj_Register (struct SjLj_Function_Context *fc)
 {
   if (__builtin_expect (libgcc_s_sjlj_register == NULL, 0))
     pthread_cancel_init ();
+
   libgcc_s_sjlj_register (fc);
 }
 
@@ -113,5 +127,6 @@ _Unwind_SjLj_Unregister (struct SjLj_Function_Context *fc)
 {
   if (__builtin_expect (libgcc_s_sjlj_unregister == NULL, 0))
     pthread_cancel_init ();
+
   libgcc_s_sjlj_unregister (fc);
 }
diff --git a/sysdeps/unix/sysv/linux/cris/bits/fcntl.h b/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
index 36799aa..270a8de 100644
--- a/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/cris/bits/fcntl.h
@@ -96,7 +96,7 @@
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
 #endif
 
-/* For F_[GET|SET]FL.  */
+/* For F_[GET|SET]FD.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
index 90c0a48..733a088 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -95,7 +95,7 @@
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
 #endif
 
-/* For F_[GET|SET]FL.  */
+/* For F_[GET|SET]FD.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index d40b4b6..3404663 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -101,7 +101,7 @@
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
 #endif
 
-/* For F_[GET|SET]FL.  */
+/* For F_[GET|SET]FD.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h b/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h
index c4440f9..af43a60 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005, 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
@@ -29,9 +29,6 @@
 /* Value returned if `sem_open' failed.  */
 #define SEM_FAILED      ((sem_t *) 0)
 
-/* Maximum value the semaphore can have.  */
-#define SEM_VALUE_MAX   (2147483647)
-
 
 typedef union
 {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e8955bf40901b7e785cfbe44ec83313fe9da61c6

commit e8955bf40901b7e785cfbe44ec83313fe9da61c6
Author: Jeff Bailey <jbailey@raspberryginger.com>
Date:   Sat Jun 16 16:36:53 2007 +0000

    2006-07-16  Jeff Bailey  <jbailey@raspberryginger.com>
    
            * sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Don't
            include asm/elf.h.  Declare elf_greg_t, elf_gregset_t,
            elf_fpreg_t, and elf_fpregset_t.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 541cb9b..967dadf 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2006-07-16  Jeff Bailey  <jbailey@raspberryginger.com>
+
+	* sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Don't
+	include	asm/elf.h.  Declare elf_greg_t, elf_gregset_t,
+	elf_fpreg_t, and elf_fpregset_t.
+
 2007-06-16  Jeff Bailey  <jbailey@raspberryginger.com>
 
 	* sysdeps/unix/sysv/linux/hppa/nptl/configure.in: Require
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
index 2e6d109..ca35489 100644
--- a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2000, 2006 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
@@ -34,10 +34,18 @@
 #include <sys/types.h>
 #include <sys/ucontext.h>
 #include <sys/user.h>
-#include <asm/elf.h>
 
 __BEGIN_DECLS
 
+typedef unsigned long elf_greg_t;
+#define ELF_NGREG 80    /* We only need 64 at present, but leave space
+			                              for expansion. */
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+#define ELF_NFPREG 32
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
 struct elf_siginfo
   {
     int si_signo;			/* Signal number.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=370d74b5df15639950c320d23ee61769fef46e42

commit 370d74b5df15639950c320d23ee61769fef46e42
Author: Jeff Bailey <jbailey@raspberryginger.com>
Date:   Sat Jun 16 15:38:21 2007 +0000

    2007-06-16  Jeff Bailey  <jbailey@raspberryginger.com>
    
            * sysdeps/unix/sysv/linux/hppa/nptl/configure.in: Require
            at least kernel 2.6.9.
            * sysdeps/unix/sysv/linux/hppa/nptl/configure: Rebuilt.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 3ee76d9..541cb9b 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2007-06-16  Jeff Bailey  <jbailey@raspberryginger.com>
+
+	* sysdeps/unix/sysv/linux/hppa/nptl/configure.in: Require
+	at least kernel 2.6.9.
+	* sysdeps/unix/sysv/linux/hppa/nptl/configure: Rebuilt.
+
 2007-05-17  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h 
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/configure b/sysdeps/unix/sysv/linux/hppa/nptl/configure
new file mode 100644
index 0000000..a418c54
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/configure
@@ -0,0 +1,5 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/hppa/nptl.
+
+# Needed for LWS CAS
+arch_minimum_kernel=2.6.9
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/configure.in b/sysdeps/unix/sysv/linux/hppa/nptl/configure.in
new file mode 100644
index 0000000..1c7102e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/configure.in
@@ -0,0 +1,5 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/hppa/nptl.
+
+# Needed for LWS CAS
+arch_minimum_kernel=2.6.9

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a34f2176e57b9e56302f44521a8718f9619bfa24

commit a34f2176e57b9e56302f44521a8718f9619bfa24
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jun 8 02:47:50 2007 +0000

    Adjust use of lll_futex_* macros.

diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
index 64ddcd5..388a399 100644
--- a/sysdeps/alpha/nptl/tls.h
+++ b/sysdeps/alpha/nptl/tls.h
@@ -131,7 +131,7 @@ typedef struct
 	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
 			       THREAD_GSCOPE_FLAG_UNUSED);		     \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
-	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+	lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1);	     \
     }									     \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ffd3982334fb2ce907d8741080ad93dbc7a466fb

commit ffd3982334fb2ce907d8741080ad93dbc7a466fb
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Thu Jun 7 14:40:24 2007 +0000

    	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (ARGIFY): New.
    	(internal_syscall1, internal_syscall2, internal_syscall3,
    	internal_syscall4, internal_syscall5, internal_syscall6): Use it.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index a99e165..346237f 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2007-06-07  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (ARGIFY): New.
+	(internal_syscall1, internal_syscall2, internal_syscall3,
+	internal_syscall4, internal_syscall5, internal_syscall6): Use it.
+
 2007-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/mips/nptl/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index d263598..b15d280 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -44,6 +44,10 @@
 
 #else   /* ! __ASSEMBLER__ */
 
+/* Convert X to a long long, without losing any bits if it is one
+   already or warning if it is a 32-bit pointer.  */
+#define ARGIFY(X) ((long long) (__typeof__ ((X) - (X))) (X))
+
 /* Define a macro which expands into the inline wrapper code for a system
    call.  */
 #undef INLINE_SYSCALL
@@ -102,7 +106,7 @@
 									\
 	{								\
 	register long long __v0 asm("$2") ncs_init;			\
-	register long long __a0 asm("$4") = (long long) arg1; 		\
+	register long long __a0 asm("$4") = ARGIFY (arg1); 		\
 	register long long __a3 asm("$7"); 				\
 	__asm__ volatile ( 						\
 	".set\tnoreorder\n\t" 						\
@@ -124,8 +128,8 @@
 									\
 	{								\
 	register long long __v0 asm("$2") ncs_init;			\
-	register long long __a0 asm("$4") = (long long) arg1; 		\
-	register long long __a1 asm("$5") = (long long) arg2; 		\
+	register long long __a0 asm("$4") = ARGIFY (arg1); 		\
+	register long long __a1 asm("$5") = ARGIFY (arg2); 		\
 	register long long __a3 asm("$7"); 				\
 	__asm__ volatile ( 						\
 	".set\tnoreorder\n\t" 						\
@@ -147,9 +151,9 @@
 									\
 	{								\
 	register long long __v0 asm("$2") ncs_init;			\
-	register long long __a0 asm("$4") = (long long) arg1; 		\
-	register long long __a1 asm("$5") = (long long) arg2; 		\
-	register long long __a2 asm("$6") = (long long) arg3; 		\
+	register long long __a0 asm("$4") = ARGIFY (arg1); 		\
+	register long long __a1 asm("$5") = ARGIFY (arg2); 		\
+	register long long __a2 asm("$6") = ARGIFY (arg3); 		\
 	register long long __a3 asm("$7"); 				\
 	__asm__ volatile ( 						\
 	".set\tnoreorder\n\t" 						\
@@ -171,10 +175,10 @@
 									\
 	{								\
 	register long long __v0 asm("$2") ncs_init;			\
-	register long long __a0 asm("$4") = (long long) arg1; 		\
-	register long long __a1 asm("$5") = (long long) arg2; 		\
-	register long long __a2 asm("$6") = (long long) arg3; 		\
-	register long long __a3 asm("$7") = (long long) arg4; 		\
+	register long long __a0 asm("$4") = ARGIFY (arg1); 		\
+	register long long __a1 asm("$5") = ARGIFY (arg2); 		\
+	register long long __a2 asm("$6") = ARGIFY (arg3); 		\
+	register long long __a3 asm("$7") = ARGIFY (arg4); 		\
 	__asm__ volatile ( 						\
 	".set\tnoreorder\n\t" 						\
 	cs_init								\
@@ -195,11 +199,11 @@
 									\
 	{								\
 	register long long __v0 asm("$2") ncs_init;			\
-	register long long __a0 asm("$4") = (long long) arg1; 		\
-	register long long __a1 asm("$5") = (long long) arg2; 		\
-	register long long __a2 asm("$6") = (long long) arg3; 		\
-	register long long __a3 asm("$7") = (long long) arg4; 		\
-	register long long __a4 asm("$8") = (long long) arg5; 		\
+	register long long __a0 asm("$4") = ARGIFY (arg1); 		\
+	register long long __a1 asm("$5") = ARGIFY (arg2); 		\
+	register long long __a2 asm("$6") = ARGIFY (arg3); 		\
+	register long long __a3 asm("$7") = ARGIFY (arg4); 		\
+	register long long __a4 asm("$8") = ARGIFY (arg5); 		\
 	__asm__ volatile ( 						\
 	".set\tnoreorder\n\t" 						\
 	cs_init								\
@@ -220,12 +224,12 @@
 									\
 	{								\
 	register long long __v0 asm("$2") ncs_init;			\
-	register long long __a0 asm("$4") = (long long) arg1; 		\
-	register long long __a1 asm("$5") = (long long) arg2; 		\
-	register long long __a2 asm("$6") = (long long) arg3; 		\
-	register long long __a3 asm("$7") = (long long) arg4; 		\
-	register long long __a4 asm("$8") = (long long) arg5; 		\
-	register long long __a5 asm("$9") = (long long) arg6; 		\
+	register long long __a0 asm("$4") = ARGIFY (arg1); 		\
+	register long long __a1 asm("$5") = ARGIFY (arg2); 		\
+	register long long __a2 asm("$6") = ARGIFY (arg3); 		\
+	register long long __a3 asm("$7") = ARGIFY (arg4); 		\
+	register long long __a4 asm("$8") = ARGIFY (arg5); 		\
+	register long long __a5 asm("$9") = ARGIFY (arg6); 		\
 	__asm__ volatile ( 						\
 	".set\tnoreorder\n\t" 						\
 	cs_init								\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=30efab519e242a2c8f4894a7259a2ffbd5f3827a

commit 30efab519e242a2c8f4894a7259a2ffbd5f3827a
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed Jun 6 17:27:04 2007 +0000

    	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
    	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT): Define.
    	(THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
    	THREAD_GSCOPE_WAIT): Define.
    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
    	(lll_unlock_wake_cb): Delete.
    	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
    	(FUTEX_PRIVATE_FLAG): Define.
    	(lll_unlock_wake_cb): Delete prototype.
    	* sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h: Include
    	<endian.h>.
    	(pthread_rwlock_t): Shrink __flags and add __shared.
    	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
    	(RTLD_SINGLE_THREAD_P): Define.
    
    	* sysdeps/mips/nptl/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
    	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT): Define.
    	(THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
    	THREAD_GSCOPE_WAIT): Define.
    	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
    	(FUTEX_PRIVATE_FLAG): Define.
    	(lll_unlock_wake_cb): Delete prototype.
    	* sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h: Include
    	<endian.h>.
    	(pthread_rwlock_t): Shrink __flags and add __shared.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index e733cb6..39e14dc 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,20 @@
+2007-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/arm/nptl/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT): Define.
+	(THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
+	(lll_unlock_wake_cb): Delete.
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+	(FUTEX_PRIVATE_FLAG): Define.
+	(lll_unlock_wake_cb): Delete prototype.
+	* sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h: Include
+	<endian.h>.
+	(pthread_rwlock_t): Shrink __flags and add __shared.
+	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+	(RTLD_SINGLE_THREAD_P): Define.
+
 2007-05-23  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/kernel-features.h
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 34e2561..a99e165 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,16 @@
+2007-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* sysdeps/mips/nptl/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT): Define.
+	(THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+	(FUTEX_PRIVATE_FLAG): Define.
+	(lll_unlock_wake_cb): Delete prototype.
+	* sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h: Include
+	<endian.h>.
+	(pthread_rwlock_t): Shrink __flags and add __shared.
+
 2007-05-24  Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
 
 	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h
index 26ef709..ae2aecc 100644
--- a/sysdeps/arm/nptl/tls.h
+++ b/sysdeps/arm/nptl/tls.h
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/ARM version.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 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
@@ -132,6 +132,29 @@ typedef struct
    is not available.  */
 #define TLS_INIT_TP_EXPENSIVE 1
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */
diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h
index 1cef161..dbe806a 100644
--- a/sysdeps/mips/nptl/tls.h
+++ b/sysdeps/mips/nptl/tls.h
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/MIPS version.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 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
@@ -156,6 +156,29 @@ typedef struct
    different value to mean unset l_tls_offset.  */
 # define NO_TLS_OFFSET		-1
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h
index ea8d6a2..e1b115c 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h
@@ -19,6 +19,8 @@
 #ifndef _BITS_PTHREADTYPES_H
 #define _BITS_PTHREADTYPES_H	1
 
+#include <endian.h>
+
 #define __SIZEOF_PTHREAD_ATTR_T 36
 #define __SIZEOF_PTHREAD_MUTEX_T 24
 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4
@@ -126,9 +128,21 @@ typedef union
     unsigned int __writer_wakeup;
     unsigned int __nr_readers_queued;
     unsigned int __nr_writers_queued;
+#if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned char __pad1;
+    unsigned char __pad2;
+    unsigned char __shared;
+    /* FLAGS must stay at this position in the structure to maintain
+       binary compatibility.  */
+    unsigned char __flags;
+#else
     /* FLAGS must stay at this position in the structure to maintain
        binary compatibility.  */
-    unsigned int __flags;
+    unsigned char __flags;
+    unsigned char __shared;
+    unsigned char __pad1;
+    unsigned char __pad2;
+#endif
     int __writer;
   } __data;
   char __size[__SIZEOF_PTHREAD_RWLOCK_T];
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
index e0643a9..66a4d7b 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
@@ -1,5 +1,5 @@
 /* low level locking for pthread library.  Generic futex-using version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 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
@@ -63,21 +63,9 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime)
 }
 
 
-/* These don't get included in libc.so  */
+/* This function doesn't get included in libc.so  */
 #ifdef IS_IN_libpthread
 int
-lll_unlock_wake_cb (int *futex)
-{
-  int val = atomic_exchange_rel (futex, 0);
-
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
-
-  return 0;
-}
-
-
-int
 __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 {
   int tid;
@@ -114,5 +102,4 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 
   return 0;
 }
-
 #endif
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 4bae953..15cf147 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 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
@@ -34,6 +34,7 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_PRIVATE_FLAG	128
 
 /* Initializer for compatibility lock.	*/
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
@@ -267,8 +268,6 @@ typedef int lll_lock_t;
 #define LLL_LOCK_INITIALIZER		(0)
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index a44ee95..3fb2186 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -126,3 +126,9 @@ extern int __local_multiple_threads attribute_hidden;
 # define NO_CANCELLATION 1
 
 #endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+				   header.multiple_threads) == 0, 1)
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h
index eda0a2f..166a6c6 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h
@@ -20,6 +20,8 @@
 #ifndef _BITS_PTHREADTYPES_H
 #define _BITS_PTHREADTYPES_H	1
 
+#include <endian.h>
+
 #if _MIPS_SIM == _ABI64
 # define __SIZEOF_PTHREAD_ATTR_T 56
 # define __SIZEOF_PTHREAD_MUTEX_T 40
@@ -157,9 +159,9 @@ typedef union
     unsigned int __nr_readers_queued;
     unsigned int __nr_writers_queued;
     int __writer;
-    int __pad1;
+    int __shared;
+    unsigned long int __pad1;
     unsigned long int __pad2;
-    unsigned long int __pad3;
     /* FLAGS must stay at this position in the structure to maintain
        binary compatibility.  */
     unsigned int __flags;
@@ -173,9 +175,21 @@ typedef union
     unsigned int __writer_wakeup;
     unsigned int __nr_readers_queued;
     unsigned int __nr_writers_queued;
+#if __BYTE_ORDER == __BIG_ENDIAN
+    unsigned char __pad1;
+    unsigned char __pad2;
+    unsigned char __shared;
     /* FLAGS must stay at this position in the structure to maintain
        binary compatibility.  */
-    unsigned int __flags;
+    unsigned char __flags;
+#else
+    /* FLAGS must stay at this position in the structure to maintain
+       binary compatibility.  */
+    unsigned char __flags;
+    unsigned char __shared;
+    unsigned char __pad1;
+    unsigned char __pad2;
+#endif
     int __writer;
   } __data;
 # endif
diff --git a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index 36a20f1..4542e5b 100644
--- a/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2006, 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
@@ -35,6 +35,7 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_PRIVATE_FLAG	128
 
 /* Initializer for compatibility lock.	*/
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
@@ -234,8 +235,6 @@ typedef int lll_lock_t;
 #define LLL_LOCK_INITIALIZER		(0)
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d3d5bc25404ba37d81fd19f827fa3da06e189861

commit d3d5bc25404ba37d81fd19f827fa3da06e189861
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed May 30 04:44:55 2007 +0000

    Remove all traces of lll_unlock_wake_cb.

diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index 58b4806..04ac006 100644
--- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 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
@@ -237,8 +237,6 @@ typedef int lll_lock_t;
 #define LLL_LOCK_INITIALIZER		(0)
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6f02480c593ca9b68f0a548d53366e5ad71c38e8

commit 6f02480c593ca9b68f0a548d53366e5ad71c38e8
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon May 28 16:40:52 2007 +0000

    (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
    THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
    THREAD_GSCOPE_WAIT): Define.

diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
index be2430f..64ddcd5 100644
--- a/sysdeps/alpha/nptl/tls.h
+++ b/sysdeps/alpha/nptl/tls.h
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/Alpha version.
-   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2006, 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
@@ -121,6 +121,29 @@ typedef struct
 #define THREAD_SETMEM_NC(descr, member, idx, value) \
   descr->member[idx] = (value)
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=92fa63ee309705aab0d8ef00807e9a6212460cf8

commit 92fa63ee309705aab0d8ef00807e9a6212460cf8
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Thu May 24 16:18:27 2007 +0000

    	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
    	(posix_fadvise): Fix high word of len argument.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 3ef0903..34e2561 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2007-05-24  Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
+	(posix_fadvise): Fix high word of len argument.
+
 2007-05-23  Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
 
 	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file.
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
index 24cbdf2..04c952d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
@@ -31,7 +31,7 @@ posix_fadvise (int fd, off_t offset, off_t len, int advise)
   INTERNAL_SYSCALL_DECL (err);
   int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
 			      __LONG_LONG_PAIR (offset >> 31, offset),
-			      __LONG_LONG_PAIR (offset >> 31, len),
+			      __LONG_LONG_PAIR (len >> 31, len),
 			      advise);
   if (INTERNAL_SYSCALL_ERROR_P (ret, err))
     return INTERNAL_SYSCALL_ERRNO (ret, err);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0012a8520baa9192c6244f9714969e776c10a0ac

commit 0012a8520baa9192c6244f9714969e776c10a0ac
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 23 17:45:14 2007 +0000

    	* sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Disable
    	exceptions.  Use the updated env in fesetenv().
    	Add libm_hidden_def.

diff --git a/ChangeLog.powerpc b/ChangeLog.powerpc
index 015c95c..1ea6746 100644
--- a/ChangeLog.powerpc
+++ b/ChangeLog.powerpc
@@ -1,3 +1,9 @@
+2007-05-23  Steven Munroe  <sjmunroe@us.ibm.com>
+
+	* sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Disable
+	exceptions.  Use the updated env in fesetenv().
+	Add libm_hidden_def.
+
 2007-01-23  Steven Munroe  <sjmunroe@us.ibm.com>
 
 	[BZ #2749]
diff --git a/sysdeps/powerpc/nofpu/feholdexcpt.c b/sysdeps/powerpc/nofpu/feholdexcpt.c
index 786c691..ade9d19 100644
--- a/sysdeps/powerpc/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/nofpu/feholdexcpt.c
@@ -1,6 +1,6 @@
 /* Store current floating-point environment and clear exceptions
    (soft-float edition).
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
    This file is part of the GNU C Library.
 
@@ -33,11 +33,12 @@ feholdexcept (fenv_t *envp)
   u.fenv = *envp;
   /* Clear everything except the rounding mode.  */
   u.l[0] &= 0x3;
-
-  /* ?? Should we clear the disabled exceptions as well ?? */
+  /* Disable exceptions */
+  u.l[1] = FE_ALL_EXCEPT;
 
   /* Put the new state in effect.  */
-  fesetenv (envp);
+  fesetenv (&u.fenv);
 
   return 0;
 }
+libm_hidden_def (feholdexcept)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=99e5e16c5ca03499787fd0dedc5220ca15ba8401

commit 99e5e16c5ca03499787fd0dedc5220ca15ba8401
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 23 17:33:17 2007 +0000

    	* sysdeps/unix/sysv/linux/arm/kernel-features.h
    	(__ASSUME_SIGFRAME_V2): Define for 2.6.18 and later.
    	* sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
    	(__default_sa_restorer): Rename to __default_sa_restorer_v1.
    	Don't define if __ASSUME_SIGFRAME_V2.
    	(__default_rt_sa_restorer): Rename to
    	__default_rt_sa_restorer_v1.  Don't define if
    	__ASSUME_SIGFRAME_V2.
    	(__default_sa_restorer_v2, __default_rt_sa_restorer_v2): New.
    	* sysdeps/unix/sysv/linux/arm/nptl/Versions
    	(__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
    	__default_sa_restorer_v2, __default_rt_sa_restorer_v2): Add to
    	GLIBC_PRIVATE.
    	* sysdeps/unix/sysv/linux/arm/sigaction.c [__ARM_EABI__]
    	(__default_sa_restorer_v1, __default_sa_restorer_v2,
    	__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2):
    	Declare.
    	(__default_sa_restorer, __default_rt_sa_restorer): Define as
    	macros depending on kernel version.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index ebad07a..e733cb6 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,25 @@
+2007-05-23  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h
+	(__ASSUME_SIGFRAME_V2): Define for 2.6.18 and later.
+	* sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+	(__default_sa_restorer): Rename to __default_sa_restorer_v1.
+	Don't define if __ASSUME_SIGFRAME_V2.
+	(__default_rt_sa_restorer): Rename to
+	__default_rt_sa_restorer_v1.  Don't define if
+	__ASSUME_SIGFRAME_V2.
+	(__default_sa_restorer_v2, __default_rt_sa_restorer_v2): New.
+	* sysdeps/unix/sysv/linux/arm/nptl/Versions
+	(__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
+	__default_sa_restorer_v2, __default_rt_sa_restorer_v2): Add to
+	GLIBC_PRIVATE.
+	* sysdeps/unix/sysv/linux/arm/sigaction.c [__ARM_EABI__]
+	(__default_sa_restorer_v1, __default_sa_restorer_v2,
+	__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2):
+	Declare.
+	(__default_sa_restorer, __default_rt_sa_restorer): Define as
+	macros depending on kernel version.
+
 2007-01-23  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/arm/sysdep.h (PTR_MANGLE, PTR_DEMANGLE):
diff --git a/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S b/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
index 543d48c..cc06a55 100644
--- a/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+++ b/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
@@ -29,24 +29,49 @@
 
    Start the unwind tables at least one instruction before the signal
    trampoline, because the unwinder will assume we are returning after
-   a call site.  */
+   a call site.
 
+   Because the signal frame layout changed in 2.6.18, we provide two
+   copies of these functions with different unwind information.  */
+
+#ifndef __ASSUME_SIGFRAME_V2
 	.fnstart
 	.save {r0-r15}
 	.pad #12
 	nop
-ENTRY(__default_sa_restorer)
+ENTRY(__default_sa_restorer_v1)
+	mov	r7, $SYS_ify(sigreturn)
+	swi	0x0
+	.fnend
+#endif
+
+	.fnstart
+	.save {r0-r15}
+	.pad #32
+	nop
+ENTRY(__default_sa_restorer_v2)
 	mov	r7, $SYS_ify(sigreturn)
 	swi	0x0
 	.fnend
 
 #ifdef __NR_rt_sigreturn
 
+#ifndef __ASSUME_SIGFRAME_V2
 	.fnstart
 	.save {r0-r15}
 	.pad #168
 	nop
-ENTRY(__default_rt_sa_restorer)
+ENTRY(__default_rt_sa_restorer_v1)
+	mov	r7, $SYS_ify(rt_sigreturn)
+	swi	0x0
+	.fnend
+#endif
+
+	.fnstart
+	.save {r0-r15}
+	.pad #160
+	nop
+ENTRY(__default_rt_sa_restorer_v2)
 	mov	r7, $SYS_ify(rt_sigreturn)
 	swi	0x0
 	.fnend
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 5bedfe1..0a6ab21 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -46,4 +46,9 @@
 # define __ASSUME_VFORK_SYSCALL		1
 #endif
 
+/* The signal frame layout changed in 2.6.18.  */
+#if __LINUX_KERNEL_VERSION >= 132626
+# define __ASSUME_SIGFRAME_V2	1
+#endif
+
 #include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/arm/nptl/Versions b/sysdeps/unix/sysv/linux/arm/nptl/Versions
index c74a06f..435c921 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/Versions
+++ b/sysdeps/unix/sysv/linux/arm/nptl/Versions
@@ -2,5 +2,7 @@ libc {
   GLIBC_PRIVATE {
     # A copy of sigaction lives in NPTL, and needs these.
     __default_sa_restorer; __default_rt_sa_restorer;
+    __default_sa_restorer_v1; __default_rt_sa_restorer_v1;
+    __default_sa_restorer_v2; __default_rt_sa_restorer_v2;
   }
 }
diff --git a/sysdeps/unix/sysv/linux/arm/sigaction.c b/sysdeps/unix/sysv/linux/arm/sigaction.c
index 2d890d0..707c0fa 100644
--- a/sysdeps/unix/sysv/linux/arm/sigaction.c
+++ b/sysdeps/unix/sysv/linux/arm/sigaction.c
@@ -36,8 +36,27 @@ int __libc_missing_rt_sigs;
 
 #define SA_RESTORER	0x04000000
 
+#ifdef __ARM_EABI__
+extern void __default_sa_restorer_v1(void);
+extern void __default_sa_restorer_v2(void);
+extern void __default_rt_sa_restorer_v1(void);
+extern void __default_rt_sa_restorer_v2(void);
+# ifdef __ASSUME_SIGFRAME_V2
+#  define __default_sa_restorer __default_sa_restorer_v2
+#  define __default_rt_sa_restorer __default_rt_sa_restorer_v2
+# else
+#  include <ldsodefs.h>
+#  define __default_sa_restorer (GLRO(dl_osversion) >= 0x020612	\
+				 ? __default_sa_restorer_v2	\
+				 : __default_sa_restorer_v1)
+#  define __default_rt_sa_restorer (GLRO(dl_osversion) >= 0x020612	\
+				    ? __default_rt_sa_restorer_v2	\
+				    : __default_rt_sa_restorer_v1)
+# endif
+#else
 extern void __default_sa_restorer(void);
 extern void __default_rt_sa_restorer(void);
+#endif
 
 /* When RT signals are in use we need to use a different return stub.  */
 #ifdef __NR_rt_sigreturn

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7a30cb832315de0a6dc546d110726ed9952df82e

commit 7a30cb832315de0a6dc546d110726ed9952df82e
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 23 17:26:13 2007 +0000

    	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file.
    	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: New file.
    	* sysdeps/unix/sysv/linux/mips/mips32/readahead.c: New file.
    	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: New file.
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: New file.
    	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: New file.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 2b5754f..3ef0903 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,12 @@
+2007-05-23  Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/readahead.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: New file.
+
 2007-05-23  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/mips64/n32/Implies: Add mips/mips64/soft-fp.
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
new file mode 100644
index 0000000..24cbdf2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+int
+posix_fadvise (int fd, off_t offset, off_t len, int advise)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
+			      __LONG_LONG_PAIR (offset >> 31, offset),
+			      __LONG_LONG_PAIR (offset >> 31, len),
+			      advise);
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c
new file mode 100644
index 0000000..715d37e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+int
+__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
+			      __LONG_LONG_PAIR ((long) (offset >> 32),
+						(long) offset),
+			      __LONG_LONG_PAIR ((long) (len >> 32),
+						(long) len),
+			      advise);
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+attribute_compat_text_section
+__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
+{
+  return __posix_fadvise64_l64 (fd, offset, len, advise);
+}
+
+versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
+compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+#else
+strong_alias (__posix_fadvise64_l64, posix_fadvise64);
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/readahead.c b/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
new file mode 100644
index 0000000..b5b967c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/arm/eabi/readahead.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
new file mode 100644
index 0000000..13a21b0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
@@ -0,0 +1,47 @@
+/* Selective file content synch'ing.
+   Copyright (C) 2006, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+
+#ifdef __NR_sync_file_range
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+  return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
+			 __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+			 flags);
+}
+#else
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (sync_file_range)
+
+# include <stub-tag.h>
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c
new file mode 100644
index 0000000..40bafdb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+int
+__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+attribute_compat_text_section
+__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
+{
+  return __posix_fadvise64_l64 (fd, offset, len, advise);
+}
+
+versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
+compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+#else
+strong_alias (__posix_fadvise64_l64, posix_fadvise64);
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
new file mode 100644
index 0000000..babdba0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
@@ -0,0 +1,5 @@
+# File name	Caller	Syscall name	# args	Strong name	Weak names
+
+readahead	-	readahead	i:iii	__readahead	readahead
+sync_file_range	-	sync_file_range	i:iiii	sync_file_range
+posix_fadvise	-	fadvise64	i:iiii	posix_fadvise

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=384fa30dddabbf1629841fb853fed218a9849380

commit 384fa30dddabbf1629841fb853fed218a9849380
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 23 17:13:59 2007 +0000

    	* sysdeps/mips/mips64/n32/Implies: Add mips/mips64/soft-fp.
    	* sysdeps/mips/mips64/n64/Implies: Likewise.
    	* sysdeps/mips/mips64/soft-fp/Makefile: New.
    	* sysdeps/mips/mips64/soft-fp/e_sqrtl.c: New.
    	* sysdeps/mips/mips64/soft-fp/sfp-machine.h: Include <fenv.h> and
    	<fpu_control.h>.  Use hardware exception and rounding mode
    	settings.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 097f7e2..2b5754f 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,13 @@
+2007-05-23  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/mips64/n32/Implies: Add mips/mips64/soft-fp.
+	* sysdeps/mips/mips64/n64/Implies: Likewise.
+	* sysdeps/mips/mips64/soft-fp/Makefile: New.
+	* sysdeps/mips/mips64/soft-fp/e_sqrtl.c: New.
+	* sysdeps/mips/mips64/soft-fp/sfp-machine.h: Include <fenv.h> and
+	<fpu_control.h>.  Use hardware exception and rounding mode
+	settings.
+
 2007-05-23  Richard Sandiford  <rsandifo@nildram.co.uk>
 
 	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Change type of
diff --git a/sysdeps/mips/mips64/n32/Implies b/sysdeps/mips/mips64/n32/Implies
index a7cb280..bed8f14 100644
--- a/sysdeps/mips/mips64/n32/Implies
+++ b/sysdeps/mips/mips64/n32/Implies
@@ -1,4 +1,5 @@
 ieee754/ldbl-128
+mips/mips64/soft-fp
 mips/mips64
 mips
 wordsize-32
diff --git a/sysdeps/mips/mips64/n64/Implies b/sysdeps/mips/mips64/n64/Implies
index e507786..214b85c 100644
--- a/sysdeps/mips/mips64/n64/Implies
+++ b/sysdeps/mips/mips64/n64/Implies
@@ -1,4 +1,5 @@
 ieee754/ldbl-128
+mips/mips64/soft-fp
 mips/mips64
 mips
 wordsize-64
diff --git a/sysdeps/mips/mips64/soft-fp/Makefile b/sysdeps/mips/mips64/soft-fp/Makefile
new file mode 100644
index 0000000..ada13e8
--- /dev/null
+++ b/sysdeps/mips/mips64/soft-fp/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),math)
+CPPFLAGS += -I../soft-fp
+endif
diff --git a/sysdeps/mips/mips64/soft-fp/e_sqrtl.c b/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
new file mode 100644
index 0000000..81fd58a
--- /dev/null
+++ b/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
@@ -0,0 +1,39 @@
+/* long double square root in software floating-point emulation.
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdlib.h>
+#include <soft-fp.h>
+#include <quad.h>
+
+long double
+__ieee754_sqrtl (const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q(A, a);
+  FP_SQRT_Q(C, A);
+  FP_PACK_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
diff --git a/sysdeps/mips/mips64/soft-fp/sfp-machine.h b/sysdeps/mips/mips64/soft-fp/sfp-machine.h
index 309a14a..9c1ee3b 100644
--- a/sysdeps/mips/mips64/soft-fp/sfp-machine.h
+++ b/sysdeps/mips/mips64/soft-fp/sfp-machine.h
@@ -1,3 +1,6 @@
+#include <fenv.h>
+#include <fpu_control.h>
+
 #define _FP_W_TYPE_SIZE		64
 #define _FP_W_TYPE		unsigned long long
 #define _FP_WS_TYPE		signed long long
@@ -40,8 +43,32 @@
     R##_c = FP_CLS_NAN;						\
   } while (0)
 
-#define FP_EX_INVALID           (1 << 4)
-#define FP_EX_DIVZERO           (1 << 3)
-#define FP_EX_OVERFLOW          (1 << 2)
-#define FP_EX_UNDERFLOW         (1 << 1)
-#define FP_EX_INEXACT           (1 << 0)
+#define _FP_DECL_EX		fpu_control_t _fcw
+
+#define FP_ROUNDMODE		(_fcw & 0x3)
+
+#define FP_RND_NEAREST		FE_TONEAREST
+#define FP_RND_ZERO		FE_TOWARDZERO
+#define FP_RND_PINF		FE_UPWARD
+#define FP_RND_MINF		FE_DOWNWARD
+
+#define FP_EX_INVALID		FE_INVALID
+#define FP_EX_OVERFLOW		FE_OVERFLOW
+#define FP_EX_UNDERFLOW		FE_UNDERFLOW
+#define FP_EX_DIVZERO		FE_DIVBYZERO
+#define FP_EX_INEXACT		FE_INEXACT
+
+#ifdef __mips_hard_float
+#define FP_INIT_ROUNDMODE			\
+do {						\
+  _FPU_GETCW (_fcw);				\
+} while (0)
+
+#define FP_HANDLE_EXCEPTIONS			\
+do {						\
+  if (__builtin_expect (_fex, 0))		\
+    _FPU_SETCW (_fcw | _fex | (_fex << 10));	\
+} while (0)
+#else
+#define FP_INIT_ROUNDMODE	_fcw = FP_RND_NEAREST
+#endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=388fc51bf4a10271ad9826fb96e62dc809586ec7

commit 388fc51bf4a10271ad9826fb96e62dc809586ec7
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 23 16:50:43 2007 +0000

    Use commit date in changelog.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index b7f0e1d..097f7e2 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,4 +1,4 @@
-2007-02-27  Richard Sandiford  <rsandifo@nildram.co.uk>
+2007-05-23  Richard Sandiford  <rsandifo@nildram.co.uk>
 
 	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Change type of
 	r_info argument to ElfW(Addr).

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9077d4dc205ec9390af766b1e8d8fa365476f4fe

commit 9077d4dc205ec9390af766b1e8d8fa365476f4fe
Author: Daniel Jacobowitz <dan@codesourcery.com>
Date:   Wed May 23 16:50:14 2007 +0000

    	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Change type of
    	r_info argument to ElfW(Addr).

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 159a4c2..b7f0e1d 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2007-02-27  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Change type of
+	r_info argument to ElfW(Addr).
+
 2007-02-01  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/bits/mathdef.h (float_t): Change to float.
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index c92a1a3..1b8d0f3 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -304,7 +304,7 @@ do {									\
 
 auto inline void
 __attribute__ ((always_inline))
-elf_machine_reloc (struct link_map *map, ElfW(Word) r_info,
+elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
 		   const ElfW(Sym) *sym, const struct r_found_version *version,
 		   void *reloc_addr, ElfW(Addr) r_addend, int inplace_p)
 {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=90e01f41f991eb5ed709cae04362ab57ed66dfc4

commit 90e01f41f991eb5ed709cae04362ab57ed66dfc4
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri May 18 02:02:51 2007 +0000

    2007-05-17  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h
    	(SEM_VALUE_MAX): Remove.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index e35eb1b..3ee76d9 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,5 +1,10 @@
 2007-05-17  Carlos O'Donell  <carlos@systemhalted.org>
 
+	* sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h 
+	(SEM_VALUE_MAX): Remove.
+
+2007-05-17  Carlos O'Donell  <carlos@systemhalted.org>
+
 	* sysdeps/unix/sysv/linux/hppa/sysdep.h (PIC_REG_DEF): Define.
 	(PIC_REG_USE): Define.
 	(INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE.
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h b/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h
index 3d274ee..270f333 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h
@@ -20,17 +20,11 @@
 # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
 #endif
 
-
 #define __SIZEOF_SEM_T	16
 
-
 /* Value returned if `sem_open' failed.  */
 #define SEM_FAILED      ((sem_t *) 0)
 
-/* Maximum value the semaphore can have.  */
-#define SEM_VALUE_MAX   ((int) ((~0u) >> 1))
-
-
 typedef union
 {
   char __size[__SIZEOF_SEM_T];

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d164f33b2ad9a24f5119061514633f93f51b8681

commit d164f33b2ad9a24f5119061514633f93f51b8681
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri May 18 01:59:52 2007 +0000

    2007-05-17  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/unix/sysv/linux/hppa/sysdep.h (PIC_REG_DEF): Define.
    	(PIC_REG_USE): Define.
    	(INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE.
    	(INTERNAL_SYSCALL): Likewise.
    	(INTERNAL_SYSCALL_NCS): Likewise.
    	* sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use
    	PIC_REG_DEF, PIC_REG_USE.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 7d38ab0..e35eb1b 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,13 @@
+2007-05-17  Carlos O'Donell  <carlos@systemhalted.org>
+
+	* sysdeps/unix/sysv/linux/hppa/sysdep.h (PIC_REG_DEF): Define.
+	(PIC_REG_USE): Define.
+	(INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE.
+	(INTERNAL_SYSCALL): Likewise.
+	(INTERNAL_SYSCALL_NCS): Likewise.
+	* sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use 
+	PIC_REG_DEF, PIC_REG_USE.
+
 2007-05-01  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.c b/sysdeps/unix/sysv/linux/hppa/sysdep.c
index 8637c51..4a0bd21 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep.c
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 1998, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2001, 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
@@ -58,13 +59,14 @@ syscall (long int __sysno, ...)
   
   {
     register unsigned long int __res asm("r28");
+    PIC_REG_DEF
     LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
     asm volatile (SAVE_ASM_PIC
 		  "	ble  0x100(%%sr2, %%r0)	\n"
 		  "	copy %1, %%r20		\n"
 		  LOAD_ASM_PIC
 		  : "=r" (__res)
-		  : "r" (__sysno) ASM_ARGS_6
+		  : "r" (__sysno) PIC_REG_USE ASM_ARGS_6
 		  : "memory", CALL_CLOB_REGS CLOB_ARGS_6);
     __sys_res = __res;
   }
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h
index 69ed700..96632a1 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep.h
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -1,5 +1,6 @@
 /* Assembler macros for PA-RISC.
-   Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002, 2003, 2007 
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
    Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
@@ -40,7 +41,9 @@
 # define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */
 # define SAVE_ASM_PIC	"       copy %%r19, %" TREG_ASM "\n"
 # define LOAD_ASM_PIC	"       copy %" TREG_ASM ", %%r19\n"
-# define USING_TREG	TREG_ASM,
+# define CLOB_TREG	TREG_ASM ,
+# define PIC_REG_DEF	register unsigned long __r19 asm("r19");
+# define PIC_REG_USE	, "r" (__r19)
 #else
 # define TREG %r3
 # define SAVE_PIC(SREG) nop ASM_LINE_SEP
@@ -49,7 +52,9 @@
 # define TREG_ASM 
 # define SAVE_ASM_PIC	"nop \n"
 # define LOAD_ASM_PIC	"nop \n"
-# define USING_TREG
+# define CLOB_TREG
+# define PIC_REG_DEF
+# define PIC_REG_USE
 #endif
 
 #ifdef __ASSEMBLER__
@@ -344,7 +349,7 @@ L(pre_end):					ASM_LINE_SEP	\
    TREG is clobbered and use that register to save/restore r19
    across the syscall. */
 
-#define CALL_CLOB_REGS	"%r1", "%r2", USING_TREG \
+#define CALL_CLOB_REGS	"%r1", "%r2", CLOB_TREG \
 		 	"%r20", "%r29", "%r31"
 
 #undef INLINE_SYSCALL
@@ -353,6 +358,7 @@ L(pre_end):					ASM_LINE_SEP	\
 	long __sys_res;							\
 	{								\
 		register unsigned long __res asm("r28");		\
+		PIC_REG_DEF						\
 		LOAD_ARGS_##nr(args)					\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(						\
@@ -361,7 +367,7 @@ L(pre_end):					ASM_LINE_SEP	\
 			"	ldi %1, %%r20\n"			\
 			LOAD_ASM_PIC					\
 			: "=r" (__res)					\
-			: "i" (SYS_ify(name)) ASM_ARGS_##nr		\
+			: "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr	\
 			: "memory", CALL_CLOB_REGS CLOB_ARGS_##nr	\
 		);							\
 		__sys_res = (long)__res;				\
@@ -398,6 +404,7 @@ L(pre_end):					ASM_LINE_SEP	\
 	long __sys_res;							\
 	{								\
 		register unsigned long __res asm("r28");		\
+		PIC_REG_DEF						\
 		LOAD_ARGS_##nr(args)					\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(						\
@@ -406,7 +413,7 @@ L(pre_end):					ASM_LINE_SEP	\
 			"	ldi %1, %%r20\n"			\
 			LOAD_ASM_PIC					\
 			: "=r" (__res)					\
-			: "i" (SYS_ify(name)) ASM_ARGS_##nr		\
+			: "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr	\
 			: "memory", CALL_CLOB_REGS CLOB_ARGS_##nr	\
 		);							\
 		__sys_res = (long)__res;				\
@@ -422,6 +429,7 @@ L(pre_end):					ASM_LINE_SEP	\
 	long __sys_res;							\
 	{								\
 		register unsigned long __res asm("r28");		\
+		PIC_REG_DEF						\
 		LOAD_ARGS_##nr(args)					\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(						\
@@ -430,7 +438,7 @@ L(pre_end):					ASM_LINE_SEP	\
 			"	copy %1, %%r20\n"			\
 			LOAD_ASM_PIC					\
 			: "=r" (__res)					\
-			: "r" (name) ASM_ARGS_##nr			\
+			: "r" (name) PIC_REG_USE ASM_ARGS_##nr		\
 			: "memory", CALL_CLOB_REGS CLOB_ARGS_##nr	\
 		);							\
 		__sys_res = (long)__res;				\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bdef6f9a424ae9aec3bd1ebf50f711232da2bb6e

commit bdef6f9a424ae9aec3bd1ebf50f711232da2bb6e
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu May 10 21:39:43 2007 +0000

    Define UTIME_NOW and UTIME_OMIT.

diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index 40b6853..42748be 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -149,3 +149,9 @@ struct stat64
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=91d46f8a9b3120fa59aa1fbf772a8bba3012a360

commit 91d46f8a9b3120fa59aa1fbf772a8bba3012a360
Author: Richard Henderson <rth@redhat.com>
Date:   Mon May 7 22:57:20 2007 +0000

    2007-05-07  Richard Henderson  <rth@redhat.com>
    
            * sysdeps/alpha/fpu/bits/mathinline.h (__isnanl): Don't define
            if __NO_LONG_DOUBLE_MATH.
            * sysdeps/unix/sysv/linux/alpha/ioperm.c: If BWX insns not
            available in the compiler, add .arch directive to ethe assembly.
    
    2007-05-07  Jakub Jelinek  <jakub@redhat.com>
    
            * sysdeps/alpha/fpu/s_nearbyint.c (nearbyintl): Fix version on
            compat_symbol to GLIBC_2_1.
            * sysdeps/alpha/fpu/s_fmin.S (fminl): Likewise.
            * sysdeps/alpha/fpu/s_trunc.c (truncl): Likewise.
            * sysdeps/alpha/fpu/s_fmax.S (fmaxl): Likewise.
            * sysdeps/alpha/fpu/s_lrint.c (lrintl, llrintl): Likewise.
            * sysdeps/alpha/fpu/s_lround.c (lroundl, llroundl): Likewise.
            * sysdeps/alpha/fpu/s_round.c (roundl): Likewise.
            * sysdeps/alpha/fpu/s_isnan.c (isnanl): Provide compat_symbol in
            libc, not libm.
            (__isnanl): New compat_symbol.

diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index a126dcf..250171e 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -137,11 +137,14 @@ __NTH (__isnan (double __x))
   return isunordered (__x, __x);
 }
 
+#ifndef __NO_LONG_DOUBLE_MATH
 __MATH_INLINE int
 __NTH (__isnanl (long double __x))
 {
   return isunordered (__x, __x);
 }
+#endif
+
 #endif /* C99 */
 
 #endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/alpha/fpu/s_fmax.S b/sysdeps/alpha/fpu/s_fmax.S
index 4f2ace7..d638eec 100644
--- a/sysdeps/alpha/fpu/s_fmax.S
+++ b/sysdeps/alpha/fpu/s_fmax.S
@@ -53,6 +53,6 @@ weak_alias (__fmax, fmax)
 strong_alias (__fmax, __fmaxl)
 weak_alias (__fmaxl, fmaxl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_fmin.S b/sysdeps/alpha/fpu/s_fmin.S
index 10de529..d70fab6 100644
--- a/sysdeps/alpha/fpu/s_fmin.S
+++ b/sysdeps/alpha/fpu/s_fmin.S
@@ -53,6 +53,6 @@ weak_alias (__fmin, fmin)
 strong_alias (__fmin, __fminl)
 weak_alias (__fminl, fminl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_isnan.c b/sysdeps/alpha/fpu/s_isnan.c
index 4403a50..a923032 100644
--- a/sysdeps/alpha/fpu/s_isnan.c
+++ b/sysdeps/alpha/fpu/s_isnan.c
@@ -53,6 +53,7 @@ weak_alias (__isnanf, isnanf)
 strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __isnan, isnanl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
+compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_lrint.c b/sysdeps/alpha/fpu/s_lrint.c
index 4c32f61..1696408 100644
--- a/sysdeps/alpha/fpu/s_lrint.c
+++ b/sysdeps/alpha/fpu/s_lrint.c
@@ -42,7 +42,7 @@ strong_alias (__lrint, __llrintl)
 weak_alias (__lrintl, lrintl)
 weak_alias (__llrintl, llrintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_0);
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_lround.c b/sysdeps/alpha/fpu/s_lround.c
index bc5cb88..0e0e988 100644
--- a/sysdeps/alpha/fpu/s_lround.c
+++ b/sysdeps/alpha/fpu/s_lround.c
@@ -42,7 +42,7 @@ strong_alias (__lround, __llroundl)
 weak_alias (__lroundl, lroundl)
 weak_alias (__llroundl, llroundl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_0);
-compat_symbol (libm, __llround, llroundl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_nearbyint.c b/sysdeps/alpha/fpu/s_nearbyint.c
index 7a91bd1..b18db8b 100644
--- a/sysdeps/alpha/fpu/s_nearbyint.c
+++ b/sysdeps/alpha/fpu/s_nearbyint.c
@@ -43,6 +43,6 @@ weak_alias (__nearbyint, nearbyint)
 strong_alias (__nearbyint, __nearbyintl)
 weak_alias (__nearbyint, nearbyintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_round.c b/sysdeps/alpha/fpu/s_round.c
index 3999e61..71763cf 100644
--- a/sysdeps/alpha/fpu/s_round.c
+++ b/sysdeps/alpha/fpu/s_round.c
@@ -44,6 +44,6 @@ weak_alias (__round, round)
 strong_alias (__round, __roundl)
 weak_alias (__roundl, roundl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __round, roundl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_trunc.c b/sysdeps/alpha/fpu/s_trunc.c
index 1c1a666..11a279a 100644
--- a/sysdeps/alpha/fpu/s_trunc.c
+++ b/sysdeps/alpha/fpu/s_trunc.c
@@ -48,6 +48,6 @@ weak_alias (__trunc, trunc)
 strong_alias (__trunc, __truncl)
 weak_alias (__trunc, truncl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c
index 6c4115d..32e96ec 100644
--- a/sysdeps/unix/sysv/linux/alpha/ioperm.c
+++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c
@@ -32,6 +32,11 @@
    sparse address space would work (e.g., the Low Cost Alpha chip has an
    I/O address space that's 512MB large!).  */
 
+/* Make sure the ldbu/stb asms below are not expaneded to macros.  */
+#ifndef __alpha_bwx__
+asm(".arch ev56");
+#endif
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=854901bebe730b126ca035abcca1d816cfe4693e

commit 854901bebe730b126ca035abcca1d816cfe4693e
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Wed May 2 02:07:38 2007 +0000

    2007-05-01  Carlos O'Donell  <carlos@systemhalted.org>
    
    	* sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
    	[__USE_XOPEN2K]: Define pthread_rwlock_t and
    	pthread_rwlockattr_t.

diff --git a/ChangeLog.hppa b/ChangeLog.hppa
index 068044a..7d38ab0 100644
--- a/ChangeLog.hppa
+++ b/ChangeLog.hppa
@@ -1,3 +1,9 @@
+2007-05-01  Carlos O'Donell  <carlos@systemhalted.org>
+
+	* sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
+	[__USE_XOPEN2K]: Define pthread_rwlock_t and 
+	pthread_rwlockattr_t. 
+
 2007-02-02  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* sysdeps/unix/sysv/linux/hppa/sysdep.h (PTR_MANGLE): Define.
diff --git a/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
index e2c6f59..7173718 100644
--- a/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
@@ -111,8 +111,7 @@ typedef struct
 /* Once-only execution */
 typedef int pthread_once_t;
 
-
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
 /* Read-write locks.  */
 typedef struct _pthread_rwlock_t
 {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8d4fccc44295d622a4fe6c22d7047c9cf93e95fd

commit 8d4fccc44295d622a4fe6c22d7047c9cf93e95fd
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Mar 17 17:04:09 2007 +0000

    Use __extern_inline and __extern_always_inline where appropriate.

diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index 3ea021a..a126dcf 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -26,7 +26,7 @@
 #ifdef __cplusplus
 # define __MATH_INLINE __inline
 #else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
 #endif
 
 #if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
diff --git a/sysdeps/mach/alpha/machine-lock.h b/sysdeps/mach/alpha/machine-lock.h
index 80f8750..bd27d2a 100644
--- a/sysdeps/mach/alpha/machine-lock.h
+++ b/sysdeps/mach/alpha/machine-lock.h
@@ -1,5 +1,5 @@
 /* Machine-specific definition for spin locks.  Alpha version.
-   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1997, 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
@@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_t;
 
 
 #ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
 #endif
 
 /* Unlock LOCK.  */
diff --git a/sysdeps/mach/alpha/machine-sp.h b/sysdeps/mach/alpha/machine-sp.h
index b737525..e6df63c 100644
--- a/sysdeps/mach/alpha/machine-sp.h
+++ b/sysdeps/mach/alpha/machine-sp.h
@@ -1,5 +1,5 @@
 /* Machine-specific function to return the stack pointer.  Alpha version.
-   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1997, 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
@@ -23,7 +23,7 @@
 /* Return the current stack pointer.  */
 
 #ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
 #endif
 
 _EXTERN_INLINE void *

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f878f0bbc8bb39c945b0578969300217d55d3651

commit f878f0bbc8bb39c945b0578969300217d55d3651
Author: Richard Henderson <rth@redhat.com>
Date:   Wed Mar 14 20:01:05 2007 +0000

            * sysdeps/alpha/fpu/s_llround.c: New file.
    	* sysdeps/alpha/fpu/s_llroundf.c: New file.
    	* sysdeps/alpha/fpu/s_lround.c: New file.
    	* sysdeps/alpha/fpu/s_lroundf.c: New file.
    	* sysdeps/alpha/fpu/s_round.c: New file.
    	* sysdeps/alpha/fpu/s_roundf.c: New file.
    	* sysdeps/alpha/fpu/s_trunc.c: New file.
    	* sysdeps/alpha/fpu/s_truncf.c: New file.

diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c
index 29fc924..5af6386 100644
--- a/sysdeps/alpha/fpu/s_floor.c
+++ b/sysdeps/alpha/fpu/s_floor.c
@@ -21,9 +21,7 @@
 #include <math_ldbl_opt.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
+/* Use the -inf rounding mode conversion instructions to implement floor.  */
 
 double
 __floor (double x)
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_floorf.c
index 2283264..8b42170 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_floorf.c
@@ -20,9 +20,7 @@
 #include <math.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
+/* Use the -inf rounding mode conversion instructions to implement floor.  */
 
 float
 __floorf (float x)
diff --git a/sysdeps/alpha/fpu/s_llround.c b/sysdeps/alpha/fpu/s_llround.c
new file mode 100644
index 0000000..b212fbd
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_llround.c
@@ -0,0 +1 @@
+/* In s_lround.c.  */
diff --git a/sysdeps/alpha/fpu/s_llroundf.c b/sysdeps/alpha/fpu/s_llroundf.c
new file mode 100644
index 0000000..73bdf31
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_llroundf.c
@@ -0,0 +1 @@
+/* In s_lroundf.c.  */
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_lround.c
similarity index 53%
copy from sysdeps/alpha/fpu/s_floorf.c
copy to sysdeps/alpha/fpu/s_lround.c
index 2283264..bc5cb88 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_lround.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,31 +16,33 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define __llround	not___llround
+#define llround		not_llround
 #include <math.h>
+#include <math_ldbl_opt.h>
+#undef __llround
+#undef llround
 
-
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
-
-float
-__floorf (float x)
+long int
+__lround (double x)
 {
-  float two23 = copysignf (0x1.0p23, x);
-  float r, tmp;
-  
-  __asm (
-#ifdef _IEEE_FP_INEXACT
-	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
-#else
-	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
-#endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(x), "f"(two23));
+  double adj;
 
-  /* floor(-0) == -0, and in general we'll always have the same
-     sign as our input.  */
-  return copysignf (r, x);
+  adj = 0x1.fffffffffffffp-2;	/* nextafter (0.5, 0.0) */
+  adj = copysign (adj, x);
+  return x + adj;
 }
 
-weak_alias (__floorf, floorf)
+strong_alias (__lround, __llround)
+weak_alias (__lround, lround)
+weak_alias (__llround, llround)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__lround, __lroundl)
+strong_alias (__lround, __llroundl)
+weak_alias (__lroundl, lroundl)
+weak_alias (__llroundl, llroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_0);
+compat_symbol (libm, __llround, llroundl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_lroundf.c
similarity index 52%
copy from sysdeps/alpha/fpu/s_floorf.c
copy to sysdeps/alpha/fpu/s_lroundf.c
index 2283264..16ff348 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_lroundf.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,31 +16,23 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define __llroundf	not___llroundf
+#define llroundf	not_llroundf
 #include <math.h>
+#undef __llroundf
+#undef llroundf
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
-
-float
-__floorf (float x)
+long int
+__lroundf (float x)
 {
-  float two23 = copysignf (0x1.0p23, x);
-  float r, tmp;
-  
-  __asm (
-#ifdef _IEEE_FP_INEXACT
-	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
-#else
-	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
-#endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(x), "f"(two23));
-
-  /* floor(-0) == -0, and in general we'll always have the same
-     sign as our input.  */
-  return copysignf (r, x);
+  float adj;
+
+  adj = 0x1.fffffep-2;		/* nextafterf (0.5f, 0.0f) */
+  adj = copysignf (adj, x);
+  return x + adj;
 }
 
-weak_alias (__floorf, floorf)
+strong_alias (__lroundf, __llroundf)
+weak_alias (__lroundf, lroundf)
+weak_alias (__llroundf, llroundf)
diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_round.c
similarity index 57%
copy from sysdeps/alpha/fpu/s_floor.c
copy to sysdeps/alpha/fpu/s_round.c
index 29fc924..3999e61 100644
--- a/sysdeps/alpha/fpu/s_floor.c
+++ b/sysdeps/alpha/fpu/s_round.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 1998, 1999, 2000, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -21,35 +20,30 @@
 #include <math_ldbl_opt.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
-
 double
-__floor (double x)
+__round (double x)
 {
-  double two52 = copysign (0x1.0p52, x);
-  double r, tmp;
-  
+  const double almost_half = 0x1.fffffffffffffp-2;
+  const double two52 = 0x1.0p52;
+  double tmp, r;
+
   __asm (
 #ifdef _IEEE_FP_INEXACT
-	 "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
+	 "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
 #else
-	 "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
+	 "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
 #endif
 	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(x), "f"(two52));
+	 : "f"(fabs (x) + almost_half), "f"(two52));
 
-  /* floor(-0) == -0, and in general we'll always have the same
-     sign as our input.  */
   return copysign (r, x);
 }
 
-weak_alias (__floor, floor)
+weak_alias (__round, round)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
+strong_alias (__round, __roundl)
+weak_alias (__roundl, roundl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
+compat_symbol (libm, __round, roundl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_roundf.c
similarity index 64%
copy from sysdeps/alpha/fpu/s_floorf.c
copy to sysdeps/alpha/fpu/s_roundf.c
index 2283264..89584f0 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_roundf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -20,28 +20,25 @@
 #include <math.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
-
 float
-__floorf (float x)
+__roundf (float x)
 {
-  float two23 = copysignf (0x1.0p23, x);
+  const float almost_half = 0x1.fffffep-2;
+  const float two23 = 0x1.0p23;
   float r, tmp;
   
   __asm (
 #ifdef _IEEE_FP_INEXACT
-	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
+	 "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
 #else
-	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
+	 "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
 #endif
 	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(x), "f"(two23));
+	 : "f"(fabsf (x) + almost_half), "f"(two23));
 
-  /* floor(-0) == -0, and in general we'll always have the same
+  /* round(-0) == -0, and in general we'll always have the same
      sign as our input.  */
   return copysignf (r, x);
 }
 
-weak_alias (__floorf, floorf)
+weak_alias (__roundf, roundf)
diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_trunc.c
similarity index 66%
copy from sysdeps/alpha/fpu/s_floor.c
copy to sysdeps/alpha/fpu/s_trunc.c
index 29fc924..1c1a666 100644
--- a/sysdeps/alpha/fpu/s_floor.c
+++ b/sysdeps/alpha/fpu/s_trunc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -21,35 +21,33 @@
 #include <math_ldbl_opt.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
+/* Use the chopped rounding mode conversion instructions to implement trunc. */
 
 double
-__floor (double x)
+__trunc (double x)
 {
   double two52 = copysign (0x1.0p52, x);
   double r, tmp;
   
   __asm (
 #ifdef _IEEE_FP_INEXACT
-	 "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
+	 "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
 #else
-	 "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
+	 "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
 #endif
 	 : "=&f"(r), "=&f"(tmp)
 	 : "f"(x), "f"(two52));
 
-  /* floor(-0) == -0, and in general we'll always have the same
+  /* trunc(-0) == -0, and in general we'll always have the same
      sign as our input.  */
   return copysign (r, x);
 }
 
-weak_alias (__floor, floor)
+weak_alias (__trunc, trunc)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
+strong_alias (__trunc, __truncl)
+weak_alias (__trunc, truncl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
+compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_truncf.c
similarity index 69%
copy from sysdeps/alpha/fpu/s_floorf.c
copy to sysdeps/alpha/fpu/s_truncf.c
index 2283264..094997b 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_truncf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -20,28 +20,26 @@
 #include <math.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
+/* Use the chopped rounding mode conversion instructions to implement trunc. */
 
 float
-__floorf (float x)
+__truncf (float x)
 {
   float two23 = copysignf (0x1.0p23, x);
   float r, tmp;
   
   __asm (
 #ifdef _IEEE_FP_INEXACT
-	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
+	 "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
 #else
-	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
+	 "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
 #endif
 	 : "=&f"(r), "=&f"(tmp)
 	 : "f"(x), "f"(two23));
 
-  /* floor(-0) == -0, and in general we'll always have the same
+  /* trunc(-0) == -0, and in general we'll always have the same
      sign as our input.  */
   return copysignf (r, x);
 }
 
-weak_alias (__floorf, floorf)
+weak_alias (__truncf, truncf)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bebc49030c157a3c2b88bff16115029508bac1a8

commit bebc49030c157a3c2b88bff16115029508bac1a8
Author: Richard Henderson <rth@redhat.com>
Date:   Wed Mar 14 17:44:14 2007 +0000

    	* sysdeps/alpha/fpu/s_ceil.c: Rewrite without branches.
    	* sysdeps/alpha/fpu/s_ceilf.c: Likewise.
    	* sysdeps/alpha/fpu/s_floor.c: Likewise.
    	* sysdeps/alpha/fpu/s_floorf.c: Likewise.
    	* sysdeps/alpha/fpu/s_rint.c: Likewise.
    	* sysdeps/alpha/fpu/s_rintf.c: Likewise.
    
    	* sysdeps/alpha/fpu/s_fmax.S: New file.
    	* sysdeps/alpha/fpu/s_fmaxf.S: New file.
    	* sysdeps/alpha/fpu/s_fmin.S: New file.
    	* sysdeps/alpha/fpu/s_fminf.S: New file.
    	* sysdeps/alpha/fpu/s_isnan.c: New file.
    	* sysdeps/alpha/fpu/s_isnanf.c: New file.
    	* sysdeps/alpha/fpu/s_llrint.c: New file.
    	* sysdeps/alpha/fpu/s_llrintf.c: New file.
    	* sysdeps/alpha/fpu/s_lrint.c: New file.
    	* sysdeps/alpha/fpu/s_lrintf.c: New file.
    	* sysdeps/alpha/fpu/s_nearbyint.c: New file.
    	* sysdeps/alpha/fpu/s_nearbyintf.c: New file.
    
    	* sysdeps/alpha/fpu/bits/mathinline.h (__floorf, __floor): Remove.
    	(__fdimf, fdimf, __fdim, fdim): Remove.
    	(__signbitf, __signbit, __signbitl): Use gcc builtin if available.
    	(__isnanf, __isnan, __isnanl): New.

diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index bcc1b56..3ea021a 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -1,5 +1,6 @@
 /* Inline math functions for Alpha.
-   Copyright (C) 1996, 1997, 1999-2001, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999-2001, 2004, 2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger-Tang.
 
@@ -83,111 +84,64 @@ __inline_fabs (fabs, double)
 # undef __inline_fabs
 #endif
 
-
-/* Use the -inf rounding mode conversion instructions to implement
-   floor.  We note when the exponent is large enough that the value
-   must be integral, as this avoids unpleasant integer overflows.  */
-
-__MATH_INLINE float
-__NTH (__floorf (float __x))
-{
-  /* Check not zero since floor(-0) == -0.  */
-  if (__x != 0 && fabsf (__x) < 16777216.0f)  /* 1 << FLT_MANT_DIG */
-    {
-      /* Note that Alpha S_Floating is stored in registers in a
-	 restricted T_Floating format, so we don't even need to
-	 convert back to S_Floating in the end.  The initial
-	 conversion to T_Floating is needed to handle denormals.  */
-
-      float __tmp1, __tmp2;
-
-      __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svim %2,%1\n\t"
-#else
-	     "cvttq/svm %2,%1\n\t"
-#endif
-	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(__x), "=&f"(__tmp1), "=&f"(__tmp2)
-	     : "f"(__x));
-    }
-  return __x;
-}
-
-__MATH_INLINE double
-__NTH (__floor (double __x))
-{
-  if (__x != 0 && fabs (__x) < 9007199254740992.0)  /* 1 << DBL_MANT_DIG */
-    {
-      double __tmp1;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svim %2,%1\n\t"
-#else
-	     "cvttq/svm %2,%1\n\t"
-#endif
-	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(__x), "=&f"(__tmp1)
-	     : "f"(__x));
-    }
-  return __x;
-}
-
-__MATH_INLINE float __NTH (floorf (float __x)) { return __floorf(__x); }
-__MATH_INLINE double __NTH (floor (double __x)) { return __floor(__x); }
-
-
 #ifdef __USE_ISOC99
 
-__MATH_INLINE float
-__NTH (__fdimf (float __x, float __y))
-{
-  return __x <= __y ? 0.0f : __x - __y;
-}
-
-__MATH_INLINE float
-__NTH (fdimf (float __x, float __y))
-{
-  return __x <= __y ? 0.0f : __x - __y;
-}
-
-__MATH_INLINE double
-__NTH (__fdim (double __x, double __y))
-{
-  return __x <= __y ? 0.0 : __x - __y;
-}
-
-__MATH_INLINE double
-__NTH (fdim (double __x, double __y))
-{
-  return __x <= __y ? 0.0 : __x - __y;
-}
-
 /* Test for negative number.  Used in the signbit() macro.  */
 __MATH_INLINE int
 __NTH (__signbitf (float __x))
 {
+#if !__GNUC_PREREQ (4, 0)
   __extension__ union { float __f; int __i; } __u = { __f: __x };
   return __u.__i < 0;
+#else
+  return __builtin_signbitf (__x);
+#endif
 }
 
 __MATH_INLINE int
 __NTH (__signbit (double __x))
 {
+#if !__GNUC_PREREQ (4, 0)
   __extension__ union { double __d; long __i; } __u = { __d: __x };
   return __u.__i < 0;
+#else
+  return __builtin_signbit (__x);
+#endif
 }
 
 __MATH_INLINE int
 __NTH (__signbitl (long double __x))
 {
+#if !__GNUC_PREREQ (4, 0)
   __extension__ union {
     long double __d;
     long __i[sizeof(long double)/sizeof(long)];
   } __u = { __d: __x };
   return __u.__i[sizeof(long double)/sizeof(long) - 1] < 0;
+#else
+  return __builtin_signbitl (__x);
+#endif
 }
 
+/* Test for NaN.  Used in the isnan() macro.  */
+
+__MATH_INLINE int
+__NTH (__isnanf (float __x))
+{
+  return isunordered (__x, __x);
+}
+
+__MATH_INLINE int
+__NTH (__isnan (double __x))
+{
+  return isunordered (__x, __x);
+}
+
+__MATH_INLINE int
+__NTH (__isnanl (long double __x))
+{
+  return isunordered (__x, __x);
+}
 #endif /* C99 */
 
 #endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/alpha/fpu/s_ceil.c b/sysdeps/alpha/fpu/s_ceil.c
index ec58fd9..40c2379 100644
--- a/sysdeps/alpha/fpu/s_ceil.c
+++ b/sysdeps/alpha/fpu/s_ceil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -27,25 +27,20 @@
 double
 __ceil (double x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-
-      new_x = -x;
-      __asm (
+  double two52 = copysign (0x1.0p52, x);
+  double r, tmp;
+  
+  __asm (
 #ifdef _IEEE_FP_INEXACT
-	     "cvttq/svim %2,%1\n\t"
+	 "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
 #else
-	     "cvttq/svm %2,%1\n\t"
+	 "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
 #endif
-	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(new_x));
-
-      /* Fix up the negation we did above, as well as handling -0 properly. */
-      x = copysign(new_x, x);
-    }
-  return x;
+	 : "=&f"(r), "=&f"(tmp)
+	 : "f"(-x), "f"(-two52));
+
+  /* Fix up the negation we did above, as well as handling -0 properly. */
+  return copysign (r, x);
 }
 
 weak_alias (__ceil, ceil)
diff --git a/sysdeps/alpha/fpu/s_ceilf.c b/sysdeps/alpha/fpu/s_ceilf.c
index aba1697..0df651f 100644
--- a/sysdeps/alpha/fpu/s_ceilf.c
+++ b/sysdeps/alpha/fpu/s_ceilf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -26,30 +26,20 @@
 float
 __ceilf (float x)
 {
-  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
-    {
-      /* Note that Alpha S_Floating is stored in registers in a
-	 restricted T_Floating format, so we don't even need to
-	 convert back to S_Floating in the end.  The initial
-	 conversion to T_Floating is needed to handle denormals.  */
-
-      float tmp1, tmp2, new_x;
-
-      new_x = -x;
-      __asm ("cvtst/s %3,%2\n\t"
+  float two23 = copysignf (0x1.0p23, x);
+  float r, tmp;
+  
+  __asm (
 #ifdef _IEEE_FP_INEXACT
-	     "cvttq/svim %2,%1\n\t"
+	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
 #else
-	     "cvttq/svm %2,%1\n\t"
+	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
 #endif
-	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-	     : "f"(new_x));
-
-      /* Fix up the negation we did above, as well as handling -0 properly. */
-      x = copysignf(new_x, x);
-    }
-  return x;
+	 : "=&f"(r), "=&f"(tmp)
+	 : "f"(-x), "f"(-two23));
+
+  /* Fix up the negation we did above, as well as handling -0 properly. */
+  return copysignf (r, x);
 }
 
 weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c
index b22c523..29fc924 100644
--- a/sysdeps/alpha/fpu/s_floor.c
+++ b/sysdeps/alpha/fpu/s_floor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -28,25 +28,21 @@
 double
 __floor (double x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-
-      __asm (
+  double two52 = copysign (0x1.0p52, x);
+  double r, tmp;
+  
+  __asm (
 #ifdef _IEEE_FP_INEXACT
-	     "cvttq/svim %2,%1\n\t"
+	 "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
 #else
-	     "cvttq/svm %2,%1\n\t"
+	 "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
 #endif
-	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* floor(-0) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+	 : "=&f"(r), "=&f"(tmp)
+	 : "f"(x), "f"(two52));
+
+  /* floor(-0) == -0, and in general we'll always have the same
+     sign as our input.  */
+  return copysign (r, x);
 }
 
 weak_alias (__floor, floor)
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_floorf.c
index fd1ddab..2283264 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_floorf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -27,30 +27,21 @@
 float
 __floorf (float x)
 {
-  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
-    {
-      /* Note that Alpha S_Floating is stored in registers in a
-	 restricted T_Floating format, so we don't even need to
-	 convert back to S_Floating in the end.  The initial
-	 conversion to T_Floating is needed to handle denormals.  */
-
-      float tmp1, tmp2, new_x;
-
-      __asm ("cvtst/s %3,%2\n\t"
+  float two23 = copysignf (0x1.0p23, x);
+  float r, tmp;
+  
+  __asm (
 #ifdef _IEEE_FP_INEXACT
-	     "cvttq/svim %2,%1\n\t"
+	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
 #else
-	     "cvttq/svm %2,%1\n\t"
+	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
 #endif
-	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-	     : "f"(x));
-
-      /* floor(-0) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysignf(new_x, x);
-    }
-  return x;
+	 : "=&f"(r), "=&f"(tmp)
+	 : "f"(x), "f"(two23));
+
+  /* floor(-0) == -0, and in general we'll always have the same
+     sign as our input.  */
+  return copysignf (r, x);
 }
 
 weak_alias (__floorf, floorf)
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_fmax.S
similarity index 58%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_fmax.S
index be09651..4f2ace7 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_fmax.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -17,38 +17,42 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <math.h>
+#include <sysdep.h>
 #include <math_ldbl_opt.h>
 
+        .set noat
+	.set noreorder
 
-double
-__rint (double x)
-{
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
-}
-
-weak_alias (__rint, rint)
+	.text
+ENTRY (__fmax)
+	.prologue 0
+
+	cmptun/su	$f16, $f16, $f10
+	cmptun/su	$f17, $f17, $f11
+	fmov		$f17, $f0
+	unop
+
+	trapb
+	fbne		$f10, $ret
+	fmov		$f16, $f0
+	fbne		$f11, $ret
+
+	cmptlt/su	$f16, $f17, $f11
+	trapb
+	fcmovne		$f11, $f17, $f0
+$ret:	ret
+
+END (__fmax)
+
+/* Given the in-register format of single-precision, this works there too.  */
+strong_alias (__fmax, __fmaxf)
+weak_alias (__fmaxf, fmaxf)
+
+weak_alias (__fmax, fmax)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
+strong_alias (__fmax, __fmaxl)
+weak_alias (__fmaxl, fmaxl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
+compat_symbol (libm, __fmax, fmaxl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_fmaxf.S b/sysdeps/alpha/fpu/s_fmaxf.S
new file mode 100644
index 0000000..3c2d62b
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_fmaxf.S
@@ -0,0 +1 @@
+/* __fmaxf is in s_fmax.c  */
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_fmin.S
similarity index 58%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_fmin.S
index be09651..10de529 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_fmin.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -17,38 +17,42 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <math.h>
+#include <sysdep.h>
 #include <math_ldbl_opt.h>
 
+        .set noat
+	.set noreorder
 
-double
-__rint (double x)
-{
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
-}
-
-weak_alias (__rint, rint)
+	.text
+ENTRY (__fmin)
+	.prologue 0
+
+	cmptun/su	$f16, $f16, $f10
+	cmptun/su	$f17, $f17, $f11
+	fmov		$f17, $f0
+	unop
+
+	trapb
+	fbne		$f10, $ret
+	fmov		$f16, $f0
+	fbne		$f11, $ret
+
+	cmptlt/su	$f17, $f16, $f11
+	trapb
+	fcmovne		$f11, $f17, $f0
+$ret:	ret
+
+END (__fmin)
+
+/* Given the in-register format of single-precision, this works there too.  */
+strong_alias (__fmin, __fminf)
+weak_alias (__fminf, fminf)
+
+weak_alias (__fmin, fmin)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
+strong_alias (__fmin, __fminl)
+weak_alias (__fminl, fminl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
+compat_symbol (libm, __fmin, fminl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_fminf.S b/sysdeps/alpha/fpu/s_fminf.S
new file mode 100644
index 0000000..10ab7fe
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_fminf.S
@@ -0,0 +1 @@
+/* __fminf is in s_fmin.c  */
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_isnan.c
similarity index 53%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_isnan.c
index be09651..4403a50 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_isnan.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Return 1 if argument is a NaN, else 0.
+   Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,38 +17,42 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/* Ugly kludge to avoid declarations.  */
+#define __isnanf	not___isnanf
+#define isnanf		not_isnanf
+#define __GI___isnanf	not__GI___isnanf
+
 #include <math.h>
 #include <math_ldbl_opt.h>
 
+#undef __isnanf
+#undef isnanf
+#undef __GI___isnanf
+
+/* The hidden_proto in include/math.h was obscured by the macro hackery.  */
+__typeof (__isnan) __isnanf;
+hidden_proto (__isnanf)
+
 
-double
-__rint (double x)
+int
+__isnan (double x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+  return isunordered (x, x);
 }
 
-weak_alias (__rint, rint)
+hidden_def (__isnan)
+weak_alias (__isnan, isnan)
+
+/* It turns out that the 'double' version will also always work for
+   single-precision.  */
+strong_alias (__isnan, __isnanf)
+hidden_def (__isnanf)
+weak_alias (__isnanf, isnanf)
+
 #ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
+strong_alias (__isnan, __isnanl)
+weak_alias (__isnan, isnanl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
+compat_symbol (libm, __isnan, isnanl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_isnanf.c b/sysdeps/alpha/fpu/s_isnanf.c
new file mode 100644
index 0000000..af41e43
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_isnanf.c
@@ -0,0 +1 @@
+/* In s_isnan.c */
diff --git a/sysdeps/alpha/fpu/s_llrint.c b/sysdeps/alpha/fpu/s_llrint.c
new file mode 100644
index 0000000..5db97be
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_llrint.c
@@ -0,0 +1 @@
+/* In s_lrint.c */
diff --git a/sysdeps/alpha/fpu/s_llrintf.c b/sysdeps/alpha/fpu/s_llrintf.c
new file mode 100644
index 0000000..18f2885
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_llrintf.c
@@ -0,0 +1 @@
+/* In s_lrintf.c */
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_lrint.c
similarity index 57%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_lrint.c
index be09651..4c32f61 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_lrint.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,38 +16,33 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define __llrint	not___llrint
+#define llrint		not_llrint
 #include <math.h>
 #include <math_ldbl_opt.h>
+#undef __llrint
+#undef llrint
 
-
-double
-__rint (double x)
+long int
+__lrint (double x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+  long ret;
+
+  __asm ("cvttq/svd %1,%0" : "=&f"(ret) : "f"(x));
+
+  return ret;
 }
 
-weak_alias (__rint, rint)
+strong_alias (__lrint, __llrint)
+weak_alias (__lrint, lrint)
+weak_alias (__llrint, llrint)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
+strong_alias (__lrint, __lrintl)
+strong_alias (__lrint, __llrintl)
+weak_alias (__lrintl, lrintl)
+weak_alias (__llrintl, llrintl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_0);
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_lrintf.c
similarity index 51%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_lrintf.c
index be09651..20a6a6c 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_lrintf.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -17,38 +16,24 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define __llrintf	not___llrintf
+#define llrintf		not_llrintf
 #include <math.h>
-#include <math_ldbl_opt.h>
+#undef __llrintf
+#undef llrintf
 
-
-double
-__rint (double x)
+long int
+__lrintf (float x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+  double tmp;
+  long ret;
+
+  __asm ("cvtst/s %2,%1\n\tcvttq/svd %1,%0"
+	 : "=&f"(ret), "=&f"(tmp) : "f"(x));
+
+  return ret;
 }
 
-weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
-#endif
+strong_alias (__lrintf, __llrintf)
+weak_alias (__lrintf, lrintf)
+weak_alias (__llrintf, llrintf)
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_nearbyint.c
similarity index 62%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_nearbyint.c
index be09651..7a91bd1 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_nearbyint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -20,35 +20,29 @@
 #include <math.h>
 #include <math_ldbl_opt.h>
 
+#ifdef _IEEE_FP_INEXACT
+#error "Don't compile with -mieee-with-inexact"
+#endif
 
 double
-__rint (double x)
+__nearbyint (double x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+  double two52 = copysign (0x1.0p52, x);
+  double r;
+  
+  r = x + two52;
+  r = r - two52;
+
+  /* nearbyint(-0.1) == -0, and in general we'll always have the same sign
+     as our input.  */
+  return copysign (r, x);
 }
 
-weak_alias (__rint, rint)
+weak_alias (__nearbyint, nearbyint)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
+strong_alias (__nearbyint, __nearbyintl)
+weak_alias (__nearbyint, nearbyintl)
 #endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0);
 #endif
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_nearbyintf.c
similarity index 55%
copy from sysdeps/alpha/fpu/s_rint.c
copy to sysdeps/alpha/fpu/s_nearbyintf.c
index be09651..ee63798 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_nearbyintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -18,37 +18,23 @@
    02111-1307 USA.  */
 
 #include <math.h>
-#include <math_ldbl_opt.h>
 
-
-double
-__rint (double x)
-{
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
 #ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
+#error "Don't compile with -mieee-with-inexact"
 #endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+
+float
+__nearbyintf (float x)
+{
+  float two23 = copysignf (0x1.0p23, x);
+  float r;
+
+  r = x + two23;
+  r = r - two23;
+
+  /* nearbyint(-0.1) == -0, and in general we'll always have the same sign
+     as our input.  */
+  return copysign (r, x);
 }
 
-weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
-#endif
+weak_alias (__nearbyintf, nearbyintf)
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_rint.c
index be09651..e9aa028 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_rint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -24,24 +24,15 @@
 double
 __rint (double x)
 {
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm (
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
+  double two52 = copysign (0x1.0p52, x);
+  double r;
+  
+  r = x + two52;
+  r = r - two52;
+
+  /* rint(-0.1) == -0, and in general we'll always have the same sign
+     as our input.  */
+  return copysign (r, x);
 }
 
 weak_alias (__rint, rint)
diff --git a/sysdeps/alpha/fpu/s_rintf.c b/sysdeps/alpha/fpu/s_rintf.c
index d5d019d..9e4cbd1 100644
--- a/sysdeps/alpha/fpu/s_rintf.c
+++ b/sysdeps/alpha/fpu/s_rintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson.
 
@@ -23,30 +23,15 @@
 float
 __rintf (float x)
 {
-  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
-    {
-      /* Note that Alpha S_Floating is stored in registers in a
-	 restricted T_Floating format, so we don't even need to
-	 convert back to S_Floating in the end.  The initial
-	 conversion to T_Floating is needed to handle denormals.  */
-
-      float tmp1, tmp2, new_x;
-
-      __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
-	     "cvttq/svid %2,%1\n\t"
-#else
-	     "cvttq/svd %2,%1\n\t"
-#endif
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-	     : "f"(x));
-
-      /* rint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysignf(new_x, x);
-    }
-  return x;
+  float two23 = copysignf (0x1.0p23, x);
+  float r;
+
+  r = x + two23;
+  r = r - two23;
+
+  /* rint(-0.1) == -0, and in general we'll always have the same sign
+     as our input.  */
+  return copysign (r, x);
 }
 
 weak_alias (__rintf, rintf)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9ea0d865795ca73b4e5bb13f7721b1e091bc6eee

commit 9ea0d865795ca73b4e5bb13f7721b1e091bc6eee
Author: Richard Henderson <rth@redhat.com>
Date:   Wed Mar 14 00:40:50 2007 +0000

            * sysdeps/alpha/Makefile (sysdep-CFLAGS): Force dynamic rounding.
            * sysdeps/alpha/fpu/bits/mathinline.h (__signbitl): New.
            * sysdeps/alpha/fpu/libm-test-ulps: Regenerate.
            * sysdeps/unix/sysv/linux/alpha/alphaev6/fpu/Implies: New file.
            * sysdeps/unix/sysv/linux/alpha/alphaev67/fpu/Implies: New file.
            * sysdeps/unix/sysv/linux/alpha/fpu/Implies: New file.

diff --git a/sysdeps/alpha/Makefile b/sysdeps/alpha/Makefile
index 1e74d82..725ae43 100644
--- a/sysdeps/alpha/Makefile
+++ b/sysdeps/alpha/Makefile
@@ -38,9 +38,10 @@ ifeq ($(subdir),elf)
 CFLAGS-rtld.c = -mbuild-constants
 endif
 
-# For now, build everything with full IEEE math support.
-# TODO: build separate libm and libm-ieee.
-sysdep-CFLAGS += -mieee
+# Build everything with full IEEE math support, and with dynamic rounding;
+# there are a number of math routines that are defined to work with the
+# "current" rounding mode, and it's easiest to set this with all of them.
+sysdep-CFLAGS += -mieee -mfp-rounding-mode=d
 
 # libc.so requires about 16k for the small data area, which is well
 # below the 64k maximum.
diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index 87d4005..bcc1b56 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -178,6 +178,16 @@ __NTH (__signbit (double __x))
   return __u.__i < 0;
 }
 
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union {
+    long double __d;
+    long __i[sizeof(long double)/sizeof(long)];
+  } __u = { __d: __x };
+  return __u.__i[sizeof(long double)/sizeof(long) - 1] < 0;
+}
+
 #endif /* C99 */
 
 #endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/alpha/fpu/libm-test-ulps b/sysdeps/alpha/fpu/libm-test-ulps
index 6b882e3..d9df631 100644
--- a/sysdeps/alpha/fpu/libm-test-ulps
+++ b/sysdeps/alpha/fpu/libm-test-ulps
@@ -2,34 +2,40 @@
 
 # atan2
 Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112":
-float: 6
-ifloat: 6
+ildouble: 1
+ldouble: 1
 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
-float: 3
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
-float: 3
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # atanh
 Test "atanh (0.75) == 0.972955074527656652552676371721589865":
 float: 1
 ifloat: 1
 
+# cacos
+Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
+
 # cacosh
-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
-double: 1
-float: 7
-idouble: 1
-ifloat: 7
 Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # casin
 Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
@@ -37,6 +43,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
 
 # casinh
 Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
@@ -44,48 +53,55 @@ double: 5
 float: 1
 idouble: 5
 ifloat: 1
+ildouble: 4
+ldouble: 4
 Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
 double: 3
 float: 6
 idouble: 3
 ifloat: 6
+ildouble: 2
+ldouble: 2
 Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # catan
-Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
-float: 3
-ifloat: 3
 Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
-float: 4
-ifloat: 4
+Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+ildouble: 1
+ldouble: 1
 
 # catanh
 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
 double: 4
 idouble: 4
-Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
-float: 4
-ifloat: 4
 Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
 double: 1
 idouble: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
-float: 6
-ifloat: 6
+ildouble: 1
+ldouble: 1
 
 # cbrt
+Test "cbrt (-0.001) == -0.1":
+ildouble: 1
+ldouble: 1
 Test "cbrt (-27.0) == -3.0":
 double: 1
 idouble: 1
@@ -97,9 +113,14 @@ double: 1
 idouble: 1
 
 # ccos
+Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
 double: 1
 float: 1
@@ -113,9 +134,13 @@ ifloat: 1
 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
 double: 1
 float: 1
@@ -126,89 +151,130 @@ float: 1
 ifloat: 1
 
 # cexp
+Test "Real part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
 float: 1
 ifloat: 1
+Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+ildouble: 1
+ldouble: 1
 
 # clog
-Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
-float: 3
-ifloat: 3
 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # clog10
 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
+Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
 double: 1
-float: 5
 idouble: 1
-ifloat: 5
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
+Test "Imaginary part of: clog10 (-inf + inf i) == inf + 3/4 pi*log10(e) i":
+double: 1
+idouble: 1
 Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
 float: 1
 ifloat: 1
+Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
 
 # cos
 Test "cos (M_PI_6l * 2.0) == 0.5":
 double: 1
-float: 1
 idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "cos (M_PI_6l * 4.0) == -0.5":
 double: 2
 float: 1
 idouble: 2
 ifloat: 1
-Test "cos (pi/2) == 0":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # cpow
 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
@@ -222,16 +288,31 @@ double: 1
 float: 4
 idouble: 1
 ifloat: 4
+ildouble: 4
+ldouble: 4
+Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 1
+ldouble: 1
 Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
 double: 2
 float: 3
 idouble: 2
 ifloat: 3
+ildouble: 10
+ldouble: 10
+Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
+ildouble: 2
+ldouble: 2
 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 double: 1
 float: 4
 idouble: 1
 ifloat: 4
+ildouble: 3
+ldouble: 3
 Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 float: 2
 ifloat: 2
@@ -240,8 +321,21 @@ double: 2
 float: 2
 idouble: 2
 ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
+ildouble: 1
+ldouble: 1
 
 # csinh
+Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
 double: 1
 idouble: 1
@@ -256,14 +350,29 @@ ifloat: 1
 Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0.75 + 1.25 i) == 1.05065169626078392338656675760808326 + 0.594868882070379067881984030639932657 i":
+ildouble: 1
+ldouble: 1
 
 # ctan
+Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
 double: 1
 idouble: 1
+ildouble: 2
+ldouble: 2
 
 # ctanh
 Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
@@ -271,6 +380,11 @@ double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
 float: 1
 ifloat: 1
@@ -287,6 +401,9 @@ idouble: 1
 Test "erfc (2.0) == 0.00467773498104726583793074363274707139":
 double: 1
 idouble: 1
+Test "erfc (27.0) == 0.523704892378925568501606768284954709e-318":
+ildouble: 1
+ldouble: 1
 Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
 double: 1
 idouble: 1
@@ -307,14 +424,30 @@ double: 6
 float: 2
 idouble: 6
 ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# exp2
+Test "exp2 (10) == 1024":
+ildouble: 2
+ldouble: 2
 
 # expm1
 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
 double: 1
 idouble: 1
 Test "expm1 (1) == M_El - 1.0":
+double: 1
 float: 1
+idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# gamma
+Test "gamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
 
 # hypot
 Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
@@ -356,9 +489,13 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "j0 (2.0) == 0.223890779141235668051827454649948626":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
 double: 1
 float: 1
@@ -367,17 +504,32 @@ ifloat: 1
 Test "j0 (8.0) == 0.171650807137553906090869407851972001":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # j1
+Test "j1 (-1.0) == -0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
+Test "j1 (0.75) == 0.349243602174862192523281016426251335":
+ildouble: 1
+ldouble: 1
+Test "j1 (1.0) == 0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
 Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "j1 (2.0) == 0.576724807756873387202448242269137087":
 double: 1
 idouble: 1
 Test "j1 (8.0) == 0.234636346853914624381276651590454612":
 double: 1
 idouble: 1
+ildouble: 4
+ldouble: 4
 
 # jn
 Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
@@ -393,9 +545,13 @@ double: 2
 float: 1
 idouble: 2
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
 double: 1
 float: 1
@@ -404,30 +560,57 @@ ifloat: 1
 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "jn (1, -1.0) == -0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
+Test "jn (1, 0.75) == 0.349243602174862192523281016426251335":
+ildouble: 1
+ldouble: 1
+Test "jn (1, 1.0) == 0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
 Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
 float: 2
 ifloat: 2
+ildouble: 2
+ldouble: 2
 Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
 double: 1
 idouble: 1
 Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
 double: 1
 idouble: 1
+ildouble: 4
+ldouble: 4
+Test "jn (10, -1.0) == 0.263061512368745320699785368779050294e-9":
+ildouble: 1
+ldouble: 1
 Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "jn (10, 1.0) == 0.263061512368745320699785368779050294e-9":
+ildouble: 1
+ldouble: 1
 Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
 double: 4
 float: 3
 idouble: 4
 ifloat: 3
+ildouble: 2
+ldouble: 2
 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
 float: 4
 ifloat: 4
@@ -446,6 +629,8 @@ double: 3
 float: 1
 idouble: 3
 ifloat: 1
+ildouble: 2
+ldouble: 2
 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
 double: 1
 float: 2
@@ -453,16 +638,23 @@ idouble: 1
 ifloat: 2
 
 # lgamma
+Test "lgamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
 Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
+ildouble: 1
+ldouble: 1
 
 # log10
 Test "log10 (0.75) == -0.124938736608299953132449886193870744":
@@ -473,36 +665,54 @@ ifloat: 2
 Test "log10 (e) == log10(e)":
 float: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 # log1p
 Test "log1p (-0.25) == -0.287682072451780927439219005993827432":
 float: 1
 ifloat: 1
 
+# log2
+Test "log2 (0.75) == -.415037499278843818546261056052183492":
+ildouble: 1
+ldouble: 1
+
 # sincos
 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
 double: 1
-float: 1
 idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
 float: 1
 ifloat: 1
 
-# tan
-Test "tan (pi/4) == 1":
-double: 1
-idouble: 1
+# sqrt
+Test "sqrt (2) == M_SQRT2l":
+ildouble: 1
+ldouble: 1
+
+# tanh
+Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
+ildouble: 1
+ldouble: 1
+Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
+ildouble: 1
+ldouble: 1
+Test "tanh (0.75) == 0.635148952387287319214434357312496495":
+ildouble: 1
+ldouble: 1
+Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
+ildouble: 1
+ldouble: 1
 
 # tgamma
 Test "tgamma (-0.5) == -2 sqrt (pi)":
@@ -510,6 +720,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 Test "tgamma (0.5) == sqrt (pi)":
 float: 1
 ifloat: 1
@@ -518,6 +730,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "tgamma (4) == 6":
+ildouble: 1
+ldouble: 1
 
 # y0
 Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
@@ -533,19 +748,28 @@ ifloat: 1
 Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
 float: 1
 ifloat: 1
+ildouble: 3
+ldouble: 3
 Test "y0 (8.0) == 0.223521489387566220527323400498620359":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 3
+ldouble: 3
 
 # y1
 Test "y1 (0.125) == -5.19993611253477499595928744876579921":
 double: 1
 idouble: 1
+Test "y1 (0.75) == -1.03759455076928541973767132140642198":
+ildouble: 1
+ldouble: 1
 Test &