summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/glibc/ChangeLog6
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-00-hppa-pthreads.dpatch857
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-01-hppa-dl-machine.dpatch340
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-02-hppa-min-kern-unwind-fde.dpatch55
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-03-hppa-mcontext.dpatch46
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-04-hppa-fcntl64.dpatch53
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-05-hppa-buildhack.dpatch38
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-06-hppa-tests.dpatch921
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch81
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-08-hppa-configure.dpatch124
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-hppa-shmlba.dpatch48
-rw-r--r--sys-libs/glibc/glibc-2.3.1-r2.ebuild20
-rw-r--r--sys-libs/glibc/glibc-2.3.1-r3.ebuild22
13 files changed, 2606 insertions, 5 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog
index 7d6945aade26..ff282af3a8b9 100644
--- a/sys-libs/glibc/ChangeLog
+++ b/sys-libs/glibc/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-libs/glibc
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.41 2003/01/29 16:18:15 jmorgan Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.42 2003/02/09 20:22:48 gmsoft Exp $
+
+ 09 Feb 2003; Guy Martin <gmsoft@gentoo.org> :
+ Added patches for hppa. See patches for description of each.
+ Added hppa to keywords.
29 Jan 2003; Jack Morganan <jmorgan@gentoo.org> glibc-2.3.1-r3.ebuild :
Changed ~sparc to sparc
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-00-hppa-pthreads.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-00-hppa-pthreads.dpatch
new file mode 100644
index 000000000000..b8f4e40dff75
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-00-hppa-pthreads.dpatch
@@ -0,0 +1,857 @@
+#! /bin/sh -e
+
+# DP: Description: HPPA Linuxthreads implementation
+# DP: Author: Carlos O'Donell <carlos@baldric.uwo.ca> (original work by Matthew Wilcox <willy@debian.org>)
+# DP: Upstream status: Submitted
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2002-11-11 Carlos O'Donell <carlos@baldric.uwo.ca>
+#
+# * linuxthreads/descr.h: Change spinlock type to __atomic_lock_t.
+# * linuxthreads/pt-machine.c: Change extern definition of testandset
+# so it uses __atomic_lock_t instead of int.
+# * linuxthreads/pthread.c:
+# (__pthread_initialize_minimal): Replace the use of __LT_SPINLOCK_INIT
+# with __LT_INITIALIZER_NOT_ZERO in cases where it is used to check
+# wether the initialization should occur or not.
+# (__pthread_initialize_manager): Likewise.
+# * linuxthreads/spinlock.h: Add default define for lock_held if it has
+# not already been defined. Create the __pthread_lock_define_initialized
+# macro to wrap up the use of an alternate initializer. Change
+# __pthread_compare_and_swap to use __atomic_lock_t,
+# (compare_and_swap): Change function definitions to use __atomic_lock_t
+# (compare_and_swap_with_release_semantics): Likewise.
+# (__pthread_compare_and_swap): Likewise.
+# * linuxthreads/spinlock.c: Change definition of __pthread_acquire to
+# use __atomic_lock_t. Modify struct wait_node to use __atomic_lock_t
+# as lock. Wrap definition and init of wait_node_free_list_spinlock in
+# macro.
+# (__pthread_release): Change function definition to use __atomic_lock_t
+# (__pthread_alt_lock): Change instances of abandoned = 0 to
+# abandoned = __LT_SPINLOCK_INIT.
+# (__pthread_alt_timedlock): Likewise.
+# (__pthread_alt_unlock): Use lock_held instead of just checking
+# abandoned == 0. Typo fix in comment from "canno6" to "cannot"
+# (__pthread_compare_and_swap): Change function definition to use
+# __atomic_lock_t.
+# (__pthread_acquire): Likewise.
+# * linuxthreads/sysdeps/hppa/pspinlock.c: Define __ldcw macro for PA's
+# single atomic operation.
+# (__pthread_spin_lock): Modified to use __ldcw macro.
+# (__pthread_spin_trylock): Likewise.
+# * linuxthreads/sysdeps/hppa/pt-machine.h: Add sys/types.h to pull in
+# __atomic_long_t definition. Remove extern testandset define. Add
+# defines for FLOATING_STACKS and ARACH_STACK_MAX_SIZE. Add lock_held
+# macro.
+# (__get_cr27): New.
+# (__set_cr27): New.
+# (__load_and_clear): New.
+# (testandset): Modified to emulate testandset using __load_and_clear.
+# * linuxthreads/sysdeps/pthread/bits/libc-lock.h: Replace the use of
+# __LT_SPINLOCK_INIT with that of __LT_INITIALIZER_NOT_ZERO.
+# * linuxthreads/sysdeps/pthread/bits/pthreadtypes.h:
+# Define default __atomic_lock_t to be an int. Change struct
+# _pthread_fastlock to reflect name change.
+# * linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h:
+# Change macro's to reflect that lock is actually struct.
+# * linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h: New.
+# * linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c:
+# Avoid unterminated string literals.
+# * sysdeps/hppa/dl-fptr.c: Change global lock to use
+# __LT_SPINLOCK_ALT_INIT.
+# (__hppa_make_fptr): Use __LT_SPINLOCK_INIT to clear locks.
+# (_dl_unmap): Likewise.
+# (_dl_lookup_address): Likewise, and clear bottom two bits of address
+# to fix function pointer calculation, see make_ftpr for the reasoning.
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+diff -urN glibc-2.3.1.orig/linuxthreads/descr.h glibc-2.3.1/linuxthreads/descr.h
+--- glibc-2.3.1.orig/linuxthreads/descr.h 2002-10-09 05:10:55.000000000 -0400
++++ glibc-2.3.1/linuxthreads/descr.h 2002-11-03 16:57:02.000000000 -0500
+@@ -61,7 +61,7 @@
+ /* Atomic counter made possible by compare_and_swap */
+ struct pthread_atomic {
+ long p_count;
+- int p_spinlock;
++ __atomic_lock_t p_spinlock;
+ };
+
+
+diff -urN glibc-2.3.1.orig/linuxthreads/pt-machine.c glibc-2.3.1/linuxthreads/pt-machine.c
+--- glibc-2.3.1.orig/linuxthreads/pt-machine.c 2002-08-26 18:39:45.000000000 -0400
++++ glibc-2.3.1/linuxthreads/pt-machine.c 2002-11-09 19:03:50.000000000 -0500
+@@ -19,7 +19,9 @@
+
+ #define PT_EI
+
+-extern long int testandset (int *spinlock);
++#include <pthread.h>
++
++extern long int testandset (__atomic_lock_t *spinlock);
+ extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+ #include <pt-machine.h>
+diff -urN glibc-2.3.1.orig/linuxthreads/pthread.c glibc-2.3.1/linuxthreads/pthread.c
+--- glibc-2.3.1.orig/linuxthreads/pthread.c 2002-10-11 06:53:15.000000000 -0400
++++ glibc-2.3.1/linuxthreads/pthread.c 2002-11-07 09:39:12.000000000 -0500
+@@ -309,9 +309,9 @@
+ pthread_descr self;
+
+ /* First of all init __pthread_handles[0] and [1] if needed. */
+-# if __LT_SPINLOCK_INIT != 0
+- __pthread_handles[0].h_lock = __LOCK_INITIALIZER;
+- __pthread_handles[1].h_lock = __LOCK_INITIALIZER;
++# ifdef __LT_INITIALIZER_NOT_ZERO
++ __pthread_handles[0].h_lock = __LOCK_ALT_INITIALIZER;
++ __pthread_handles[1].h_lock = __LOCK_ALT_INITIALIZER;
+ # endif
+ # ifndef SHARED
+ /* Unlike in the dynamically linked case the dynamic linker has not
+@@ -334,7 +334,7 @@
+ # endif
+ /* self->p_start_args need not be initialized, it's all zero. */
+ self->p_userstack = 1;
+-# if __LT_SPINLOCK_INIT != 0
++# ifdef __LT_INITIALIZER_NOT_ZERO
+ self->p_resume_count = (struct pthread_atomic) __ATOMIC_INITIALIZER;
+ # endif
+ self->p_alloca_cutoff = __MAX_ALLOCA_CUTOFF;
+@@ -346,9 +346,9 @@
+ __pthread_handles[0].h_descr = self;
+ #else
+ /* First of all init __pthread_handles[0] and [1]. */
+-# if __LT_SPINLOCK_INIT != 0
+- __pthread_handles[0].h_lock = __LOCK_INITIALIZER;
+- __pthread_handles[1].h_lock = __LOCK_INITIALIZER;
++# ifdef __LT_INITIALIZER_NOT_ZERO
++ __pthread_handles[0].h_lock = __LOCK_ALT_INITIALIZER;
++ __pthread_handles[1].h_lock = __LOCK_ALT_INITIALIZER;
+ # endif
+ __pthread_handles[0].h_descr = &__pthread_initial_thread;
+ __pthread_handles[1].h_descr = &__pthread_manager_thread;
+@@ -572,7 +572,7 @@
+ # endif
+ tcb->p_start_args = (struct pthread_start_args) PTHREAD_START_ARGS_INITIALIZER(__pthread_manager);
+ tcb->p_nr = 1;
+-# if __LT_SPINLOCK_INIT != 0
++# ifdef __LT_INITIALIZER_NOT_ZERO
+ self->p_resume_count = (struct pthread_atomic) __ATOMIC_INITIALIZER;
+ # endif
+ tcb->p_alloca_cutoff = PTHREAD_STACK_MIN / 4;
+diff -urN glibc-2.3.1.orig/linuxthreads/spinlock.c glibc-2.3.1/linuxthreads/spinlock.c
+--- glibc-2.3.1.orig/linuxthreads/spinlock.c 2002-08-29 06:32:19.000000000 -0400
++++ glibc-2.3.1/linuxthreads/spinlock.c 2002-11-09 14:51:45.000000000 -0500
+@@ -24,9 +24,9 @@
+ #include "spinlock.h"
+ #include "restart.h"
+
+-static void __pthread_acquire(int * spinlock);
++static void __pthread_acquire(__atomic_lock_t * spinlock);
+
+-static inline void __pthread_release(int * spinlock)
++static inline void __pthread_release(__atomic_lock_t * spinlock)
+ {
+ WRITE_MEMORY_BARRIER();
+ *spinlock = __LT_SPINLOCK_INIT;
+@@ -269,11 +269,11 @@
+ struct wait_node {
+ struct wait_node *next; /* Next node in null terminated linked list */
+ pthread_descr thr; /* The thread waiting with this node */
+- int abandoned; /* Atomic flag */
++ __atomic_lock_t abandoned; /* Atomic flag */
+ };
+
+ static long wait_node_free_list;
+-static int wait_node_free_list_spinlock;
++__pthread_lock_define_initialized(static, wait_node_free_list_spinlock);
+
+ /* Allocate a new node from the head of the free list using an atomic
+ operation, or else using malloc if that list is empty. A fundamental
+@@ -376,7 +376,7 @@
+ if (self == NULL)
+ self = thread_self();
+
+- wait_node.abandoned = 0;
++ wait_node.abandoned = __LT_SPINLOCK_INIT;
+ wait_node.next = (struct wait_node *) lock->__status;
+ wait_node.thr = self;
+ lock->__status = (long) &wait_node;
+@@ -402,7 +402,7 @@
+ wait_node.thr = self;
+ newstatus = (long) &wait_node;
+ }
+- wait_node.abandoned = 0;
++ wait_node.abandoned = __LT_SPINLOCK_INIT;
+ wait_node.next = (struct wait_node *) oldstatus;
+ /* Make sure the store in wait_node.next completes before performing
+ the compare-and-swap */
+@@ -451,7 +451,7 @@
+ if (self == NULL)
+ self = thread_self();
+
+- p_wait_node->abandoned = 0;
++ p_wait_node->abandoned = __LT_SPINLOCK_INIT;
+ p_wait_node->next = (struct wait_node *) lock->__status;
+ p_wait_node->thr = self;
+ lock->__status = (long) p_wait_node;
+@@ -474,7 +474,7 @@
+ p_wait_node->thr = self;
+ newstatus = (long) p_wait_node;
+ }
+- p_wait_node->abandoned = 0;
++ p_wait_node->abandoned = __LT_SPINLOCK_INIT;
+ p_wait_node->next = (struct wait_node *) oldstatus;
+ /* Make sure the store in wait_node.next completes before performing
+ the compare-and-swap */
+@@ -574,7 +574,7 @@
+ while (p_node != (struct wait_node *) 1) {
+ int prio;
+
+- if (p_node->abandoned) {
++ if (lock_held(&p_node->abandoned)) {
+ /* Remove abandoned node. */
+ #if defined TEST_FOR_COMPARE_AND_SWAP
+ if (!__pthread_has_cas)
+@@ -605,7 +605,7 @@
+ p_max_prio = p_node;
+ }
+
+- /* This canno6 jump backward in the list, so no further read
++ /* This cannot jump backward in the list, so no further read
+ barrier is needed. */
+ pp_node = &p_node->next;
+ p_node = *pp_node;
+@@ -662,7 +662,7 @@
+ #if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
+
+ int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
+- int * spinlock)
++ __atomic_lock_t * spinlock)
+ {
+ int res;
+
+@@ -699,7 +699,7 @@
+ - When nanosleep() returns, we try again, doing MAX_SPIN_COUNT
+ sched_yield(), then sleeping again if needed. */
+
+-static void __pthread_acquire(int * spinlock)
++static void __pthread_acquire(__atomic_lock_t * spinlock)
+ {
+ int cnt = 0;
+ struct timespec tm;
+diff -urN glibc-2.3.1.orig/linuxthreads/spinlock.h glibc-2.3.1/linuxthreads/spinlock.h
+--- glibc-2.3.1.orig/linuxthreads/spinlock.h 2001-05-24 19:36:35.000000000 -0400
++++ glibc-2.3.1/linuxthreads/spinlock.h 2002-11-10 13:33:43.000000000 -0500
+@@ -33,14 +33,28 @@
+ #endif
+ #endif
+
++/* Define lock_held for all arches that don't need a modified copy. */
++#ifndef __LT_INITIALIZER_NOT_ZERO
++# define lock_held(p) *(p)
++#endif
++
++/* Initliazers for possibly complex structures */
++#ifdef __LT_INITIALIZER_NOT_ZERO
++# define __pthread_lock_define_initialized(CLASS,NAME) \
++ CLASS __atomic_lock_t NAME = __LT_SPINLOCK_ALT_INIT
++#else
++# define __pthread_lock_define_initialized(CLASS,NAME) \
++ CLASS __atomic_lock_t NAME
++#endif
++
+ #if defined(TEST_FOR_COMPARE_AND_SWAP)
+
+ extern int __pthread_has_cas;
+ extern int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
+- int * spinlock);
++ __atomic_lock_t * spinlock);
+
+ static inline int compare_and_swap(long * ptr, long oldval, long newval,
+- int * spinlock)
++ __atomic_lock_t * spinlock)
+ {
+ if (__builtin_expect (__pthread_has_cas, 1))
+ return __compare_and_swap(ptr, oldval, newval);
+@@ -58,7 +72,7 @@
+
+ static inline int
+ compare_and_swap_with_release_semantics (long * ptr, long oldval,
+- long newval, int * spinlock)
++ long newval, __atomic_lock_t * spinlock)
+ {
+ return __compare_and_swap_with_release_semantics (ptr, oldval,
+ newval);
+@@ -67,7 +81,7 @@
+ #endif
+
+ static inline int compare_and_swap(long * ptr, long oldval, long newval,
+- int * spinlock)
++ __atomic_lock_t * spinlock)
+ {
+ return __compare_and_swap(ptr, oldval, newval);
+ }
+@@ -75,10 +89,10 @@
+ #else
+
+ extern int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
+- int * spinlock);
++ __atomic_lock_t * spinlock);
+
+ static inline int compare_and_swap(long * ptr, long oldval, long newval,
+- int * spinlock)
++ __atomic_lock_t * spinlock)
+ {
+ return __pthread_compare_and_swap(ptr, oldval, newval, spinlock);
+ }
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/hppa/pspinlock.c glibc-2.3.1/linuxthreads/sysdeps/hppa/pspinlock.c
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/hppa/pspinlock.c 2002-08-26 18:39:51.000000000 -0400
++++ glibc-2.3.1/linuxthreads/sysdeps/hppa/pspinlock.c 2002-11-03 16:57:02.000000000 -0500
+@@ -21,18 +21,20 @@
+ #include <pthread.h>
+ #include "internals.h"
+
++/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
++#define __ldcw(a) ({ \
++ unsigned __ret; \
++ __asm__ __volatile__("ldcw 0(%1),%0" : "=r" (__ret) : "r" (a)); \
++ __ret; \
++})
++
+ int
+ __pthread_spin_lock (pthread_spinlock_t *lock)
+ {
+- unsigned int val;
+-
+- do
+- asm volatile ("ldcw %1,%0"
+- : "=r" (val), "=m" (*lock)
+- : "m" (*lock));
+- while (!val);
++ while (__ldcw (*lock) == 0)
++ while (*lock == 0) ;
+
+- return 0;
++ return 0;
+ }
+ weak_alias (__pthread_spin_lock, pthread_spin_lock)
+
+@@ -40,11 +42,7 @@
+ int
+ __pthread_spin_trylock (pthread_spinlock_t *lock)
+ {
+- unsigned int val;
+-
+- asm volatile ("ldcw %1,%0"
+- : "=r" (val), "=m" (*lock)
+- : "m" (*lock));
++ unsigned int val = __ldcw(*lock);
+
+ return val ? 0 : EBUSY;
+ }
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/hppa/pt-machine.h glibc-2.3.1/linuxthreads/sysdeps/hppa/pt-machine.h
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/hppa/pt-machine.h 2002-08-26 18:39:51.000000000 -0400
++++ glibc-2.3.1/linuxthreads/sysdeps/hppa/pt-machine.h 2002-11-11 13:45:29.000000000 -0500
+@@ -22,13 +22,13 @@
+ #ifndef _PT_MACHINE_H
+ #define _PT_MACHINE_H 1
+
++#include <sys/types.h>
+ #include <bits/initspin.h>
+
+ #ifndef PT_EI
+ # define PT_EI extern inline
+ #endif
+
+-extern long int testandset (int *spinlock);
+ extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+ /* Get some notion of the current stack. Need not be exactly the top
+@@ -36,16 +36,39 @@
+ #define CURRENT_STACK_FRAME stack_pointer
+ register char * stack_pointer __asm__ ("%r30");
+
++/* Get/Set thread-specific pointer. We have to call into the kernel to
++ * modify it, but we can read it in user mode. */
++
++#define THREAD_SELF __get_cr27()
++
++static inline struct _pthread_descr_struct * __get_cr27(void)
++{
++ long cr27;
++ asm("mfctl %%cr27, %0" : "=r" (cr27) : );
++ return (struct _pthread_descr_struct *) cr27;
++}
++
++#define INIT_THREAD_SELF(descr, nr) __set_cr27(descr)
++
++static inline void __set_cr27(struct _pthread_descr_struct * cr27)
++{
++ asm(
++ "ble 0xe0(%%sr2, %%r0)\n\t"
++ "copy %0, %%r26"
++ : : "r" (cr27) : "r26" );
++}
++
++/* We want the OS to assign stack addresses. */
++#define FLOATING_STACKS 1
++#define ARCH_STACK_MAX_SIZE 8*1024*1024
+
+ /* The hppa only has one atomic read and modify memory operation,
+ load and clear, so hppa spinlocks must use zero to signify that
+ someone is holding the lock. */
+
+-#define xstr(s) str(s)
+-#define str(s) #s
+ /* Spinlock implementation; required. */
+-PT_EI long int
+-testandset (int *spinlock)
++PT_EI int
++__load_and_clear(__atomic_lock_t *spinlock)
+ {
+ int ret;
+
+@@ -54,9 +77,16 @@
+ : "=r"(ret), "=m"(*spinlock)
+ : "r"(spinlock));
+
+- return ret == 0;
++ return ret;
++}
++
++/* Emulate testandset */
++PT_EI long int
++testandset(__atomic_lock_t *spinlock)
++{
++ return (__load_and_clear(spinlock) == 0);
+ }
+-#undef str
+-#undef xstr
+
++#define lock_held(spinlock) ((spinlock)->lock==0)
++
+ #endif /* pt-machine.h */
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/libc-lock.h glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/libc-lock.h
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/libc-lock.h 2002-10-11 06:53:17.000000000 -0400
++++ glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/libc-lock.h 2002-11-06 21:44:40.000000000 -0500
+@@ -64,12 +64,12 @@
+ initialized locks must be set to one due to the lack of normal
+ atomic operations.) */
+
+-#if __LT_SPINLOCK_INIT == 0
++#ifdef __LT_INITIALIZER_NOT_ZERO
+ # define __libc_lock_define_initialized(CLASS,NAME) \
+- CLASS __libc_lock_t NAME;
++ CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
+ #else
+ # define __libc_lock_define_initialized(CLASS,NAME) \
+- CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
++ CLASS __libc_lock_t NAME;
+ #endif
+
+ #define __libc_rwlock_define_initialized(CLASS,NAME) \
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2001-01-27 01:26:13.000000000 -0500
++++ glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2002-11-03 16:57:02.000000000 -0500
+@@ -22,12 +22,14 @@
+ #define __need_schedparam
+ #include <bits/sched.h>
+
++typedef int __atomic_lock_t;
++
+ /* Fast locks (not abstract because mutexes and conditions aren't abstract). */
+ struct _pthread_fastlock
+ {
+- long int __status; /* "Free" or "taken" or head of waiting list */
+- int __spinlock; /* Used by compare_and_swap emulation. Also,
+- adaptive SMP lock stores spin count here. */
++ long int __status; /* "Free" or "taken" or head of waiting list */
++ __atomic_lock_t __spinlock; /* Used by compare_and_swap emulation. Also,
++ adaptive SMP lock stores spin count here. */
+ };
+
+ #ifndef _PTHREAD_DESCR_DEFINED
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h glibc-2.3.1/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h 2002-08-26 18:39:55.000000000 -0400
++++ glibc-2.3.1/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h 2002-11-09 12:47:16.000000000 -0500
+@@ -19,9 +19,21 @@
+
+ /* Initial value of a spinlock. PA-RISC only implements atomic load
+ and clear so this must be non-zero. */
+-#define __LT_SPINLOCK_INIT 1
++#define __LT_SPINLOCK_INIT ((__atomic_lock_t){ 1 })
++
++/* Initillize global spinlocks without cast, generally macro wrapped */
++#define __LT_SPINLOCK_ALT_INIT { 1 }
++
++/* Macros for lock initializers, not using the above definition.
++ The above definition is not used in the case that static initializers
++ use this value. */
++#define __LOCK_INITIALIZER { { 1 }, 0 }
++#define __ATOMIC_INITIALIZER { 0, { 1 } }
++
++/* Used to initialize _pthread_fastlock's in non-static case */
++#define __LOCK_ALT_INITIALIZER ((struct _pthread_fastlock){ __LT_SPINLOCK_INIT, 0 })
++
++/* Tell the rest of the code that the initializer is non-zero without
++ explaining it's internal structure */
++#define __LT_INITIALIZER_NOT_ZERO
+
+-/* Macros for lock initializers, using the above definition. */
+-#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+-#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+-#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h glibc-2.3.1/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h 1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.3.1/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h 2002-11-03 16:57:02.000000000 -0500
+@@ -0,0 +1,146 @@
++/* Linuxthreads - a simple clone()-based implementation of Posix */
++/* threads for Linux. */
++/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
++/* */
++/* This program is free software; you can redistribute it and/or */
++/* modify it under the terms of the GNU Library General Public License */
++/* as published by the Free Software Foundation; either version 2 */
++/* of the License, or (at your option) any later version. */
++/* */
++/* This program 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 Library General Public License for more details. */
++
++#if !defined _BITS_TYPES_H && !defined _PTHREAD_H
++# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead."
++#endif
++
++#ifndef _BITS_PTHREADTYPES_H
++#define _BITS_PTHREADTYPES_H 1
++
++#define __need_schedparam
++#include <bits/sched.h>
++
++typedef struct {
++ int lock;
++} __attribute__((aligned (16))) __atomic_lock_t;
++
++/* Fast locks (not abstract because mutexes and conditions aren't abstract). */
++struct _pthread_fastlock
++{
++ __atomic_lock_t __spinlock; /* Used by compare_and_swap emulation. Also,
++ adaptive SMP lock stores spin count here. */
++ long int __status; /* "Free" or "taken" or head of waiting list */
++};
++
++#ifndef _PTHREAD_DESCR_DEFINED
++/* Thread descriptors */
++typedef struct _pthread_descr_struct *_pthread_descr;
++# define _PTHREAD_DESCR_DEFINED
++#endif
++
++
++/* Attributes for threads. */
++typedef struct __pthread_attr_s
++{
++ int __detachstate;
++ int __schedpolicy;
++ struct __sched_param __schedparam;
++ int __inheritsched;
++ int __scope;
++ size_t __guardsize;
++ int __stackaddr_set;
++ void *__stackaddr;
++ size_t __stacksize;
++} pthread_attr_t;
++
++
++/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */
++typedef struct
++{
++ struct _pthread_fastlock __c_lock; /* Protect against concurrent access */
++ _pthread_descr __c_waiting; /* Threads waiting on this condition */
++} pthread_cond_t;
++
++
++/* Attribute for conditionally variables. */
++typedef struct
++{
++ int __dummy;
++} pthread_condattr_t;
++
++/* Keys for thread-specific data */
++typedef unsigned int pthread_key_t;
++
++
++/* Mutexes (not abstract because of PTHREAD_MUTEX_INITIALIZER). */
++/* (The layout is unnatural to maintain binary compatibility
++ with earlier releases of LinuxThreads.) */
++typedef struct
++{
++ int __m_reserved; /* Reserved for future use */
++ int __m_count; /* Depth of recursive locking */
++ _pthread_descr __m_owner; /* Owner thread (if recursive or errcheck) */
++ int __m_kind; /* Mutex kind: fast, recursive or errcheck */
++ struct _pthread_fastlock __m_lock; /* Underlying fast lock */
++} pthread_mutex_t;
++
++
++/* Attribute for mutex. */
++typedef struct
++{
++ int __mutexkind;
++} pthread_mutexattr_t;
++
++
++/* Once-only execution */
++typedef int pthread_once_t;
++
++
++#ifdef __USE_UNIX98
++/* Read-write locks. */
++typedef struct _pthread_rwlock_t
++{
++ struct _pthread_fastlock __rw_lock; /* Lock to guarantee mutual exclusion */
++ int __rw_readers; /* Number of readers */
++ _pthread_descr __rw_writer; /* Identity of writer, or NULL if none */
++ _pthread_descr __rw_read_waiting; /* Threads waiting for reading */
++ _pthread_descr __rw_write_waiting; /* Threads waiting for writing */
++ int __rw_kind; /* Reader/Writer preference selection */
++ int __rw_pshared; /* Shared between processes or not */
++} pthread_rwlock_t;
++
++
++/* Attribute for read-write locks. */
++typedef struct
++{
++ int __lockkind;
++ int __pshared;
++} pthread_rwlockattr_t;
++#endif
++
++#ifdef __USE_XOPEN2K
++/* POSIX spinlock data type. */
++typedef volatile int pthread_spinlock_t __attribute__((aligned (16)));
++
++/* POSIX barrier. */
++typedef struct {
++ struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */
++ int __ba_required; /* Threads needed for completion */
++ int __ba_present; /* Threads waiting */
++ _pthread_descr __ba_waiting; /* Queue of waiting threads */
++} pthread_barrier_t;
++
++/* barrier attribute */
++typedef struct {
++ int __pshared;
++} pthread_barrierattr_t;
++
++#endif
++
++
++/* Thread identifiers */
++typedef unsigned long int pthread_t;
++
++#endif /* bits/pthreadtypes.h */
+diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c glibc-2.3.1/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c
+--- glibc-2.3.1.orig/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c 2002-08-26 18:39:29.000000000 -0400
++++ glibc-2.3.1/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c 2002-11-11 13:36:31.000000000 -0500
+@@ -41,70 +41,70 @@
+ and epilogues. Therefore we write these in assembly to make sure
+ they do the right thing. */
+
+-__asm__ ("
+-
+-#include \"defs.h\"
+-
+-/*@HEADER_ENDS*/
+-
+-/*@_init_PROLOG_BEGINS*/
+- .section .init
+- .align 4
+- .globl _init
+- .type _init,@function
+-_init:
+- stw %rp,-20(%sp)
+- stwm %r4,64(%sp)
+- stw %r19,-32(%sp)
+- bl __pthread_initialize_minimal,%rp
+- copy %r19,%r4 /* delay slot */
+- copy %r4,%r19
+-/*@_init_PROLOG_ENDS*/
+-
+-/*@_init_EPILOG_BEGINS*/
+-/* Here is the tail end of _init. */
+- .section .init
+- ldw -84(%sp),%rp
+- copy %r4,%r19
+- bv %r0(%rp)
+-_end_init:
+- ldwm -64(%sp),%r4
+-
+-/* Our very own unwind info, because the assembler can't handle
+- functions split into two or more pieces. */
+- .section .PARISC.unwind,\"a\",@progbits
+- .extern _init
+- .word _init, _end_init
+- .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08
+-
+-/*@_init_EPILOG_ENDS*/
+-
+-/*@_fini_PROLOG_BEGINS*/
+- .section .fini
+- .align 4
+- .globl _fini
+- .type _fini,@function
+-_fini:
+- stw %rp,-20(%sp)
+- stwm %r4,64(%sp)
+- stw %r19,-32(%sp)
+- copy %r19,%r4
+-/*@_fini_PROLOG_ENDS*/
+-
+-/*@_fini_EPILOG_BEGINS*/
+- .section .fini
+- ldw -84(%sp),%rp
+- copy %r4,%r19
+- bv %r0(%rp)
+-_end_fini:
+- ldwm -64(%sp),%r4
+-
+- .section .PARISC.unwind,\"a\",@progbits
+- .extern _fini
+- .word _fini, _end_fini
+- .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08
+-
+-/*@_fini_EPILOG_ENDS*/
+-
+-/*@TRAILER_BEGINS*/
++__asm__ (" \n\
++ \n\
++#include \"defs.h\" \n\
++ \n\
++/*@HEADER_ENDS*/ \n\
++ \n\
++/*@_init_PROLOG_BEGINS*/ \n\
++ .section .init \n\
++ .align 4 \n\
++ .globl _init \n\
++ .type _init,@function \n\
++_init: \n\
++ stw %rp,-20(%sp) \n\
++ stwm %r4,64(%sp) \n\
++ stw %r19,-32(%sp) \n\
++ bl __pthread_initialize_minimal,%rp \n\
++ copy %r19,%r4 /* delay slot */ \n\
++ copy %r4,%r19 \n\
++/*@_init_PROLOG_ENDS*/ \n\
++ \n\
++/*@_init_EPILOG_BEGINS*/ \n\
++/* Here is the tail end of _init. */ \n\
++ .section .init \n\
++ ldw -84(%sp),%rp \n\
++ copy %r4,%r19 \n\
++ bv %r0(%rp) \n\
++_end_init: \n\
++ ldwm -64(%sp),%r4 \n\
++ \n\
++/* Our very own unwind info, because the assembler can't handle \n\
++ functions split into two or more pieces. */ \n\
++ .section .PARISC.unwind,\"a\",@progbits \n\
++ .extern _init \n\
++ .word _init, _end_init \n\
++ .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08 \n\
++ \n\
++/*@_init_EPILOG_ENDS*/ \n\
++ \n\
++/*@_fini_PROLOG_BEGINS*/ \n\
++ .section .fini \n\
++ .align 4 \n\
++ .globl _fini \n\
++ .type _fini,@function \n\
++_fini: \n\
++ stw %rp,-20(%sp) \n\
++ stwm %r4,64(%sp) \n\
++ stw %r19,-32(%sp) \n\
++ copy %r19,%r4 \n\
++/*@_fini_PROLOG_ENDS*/ \n\
++ \n\
++/*@_fini_EPILOG_BEGINS*/ \n\
++ .section .fini \n\
++ ldw -84(%sp),%rp \n\
++ copy %r4,%r19 \n\
++ bv %r0(%rp) \n\
++_end_fini: \n\
++ ldwm -64(%sp),%r4 \n\
++ \n\
++ .section .PARISC.unwind,\"a\",@progbits \n\
++ .extern _fini \n\
++ .word _fini, _end_fini \n\
++ .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08 \n\
++ \n\
++/*@_fini_EPILOG_ENDS*/ \n\
++ \n\
++/*@TRAILER_BEGINS*/ \n\
+ ");
+diff -urN glibc-2.3.1.orig/sysdeps/hppa/dl-fptr.c glibc-2.3.1/sysdeps/hppa/dl-fptr.c
+--- glibc-2.3.1.orig/sysdeps/hppa/dl-fptr.c 2002-01-31 20:31:51.000000000 -0500
++++ glibc-2.3.1/sysdeps/hppa/dl-fptr.c 2002-11-11 13:39:11.000000000 -0500
+@@ -30,7 +30,7 @@
+ # include <pt-machine.h>
+
+ /* Remember, we use 0 to mean that a lock is taken on PA-RISC. */
+-static int __hppa_fptr_lock = 1;
++static __atomic_lock_t __hppa_fptr_lock = __LT_SPINLOCK_ALT_INIT;
+ #endif
+
+ /* Because ld.so is now versioned, these functions can be in their own
+@@ -127,7 +127,7 @@
+ #ifdef _LIBC_REENTRANT
+ /* Release the lock. Again, remember, zero means the lock is taken! */
+ if (mem == NULL)
+- __hppa_fptr_lock = 1;
++ __hppa_fptr_lock = __LT_SPINLOCK_INIT;
+ #endif
+
+ /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */
+@@ -180,7 +180,7 @@
+
+ #ifdef _LIBC_REENTRANT
+ /* Release the lock. */
+- __hppa_fptr_lock = 1;
++ __hppa_fptr_lock = __LT_SPINLOCK_INIT;
+ #endif
+ }
+
+@@ -190,6 +190,8 @@
+ Elf32_Addr addr = (Elf32_Addr) address;
+ struct hppa_fptr *f;
+
++ address = (void *)((unsigned long)address &~ 3); /* Clear the bottom two bits. See make_fptr. */
++
+ #ifdef _LIBC_REENTRANT
+ /* Make sure we are alone. */
+ while (testandset (&__hppa_fptr_lock));
+@@ -204,7 +206,7 @@
+
+ #ifdef _LIBC_REENTRANT
+ /* Release the lock. */
+- __hppa_fptr_lock = 1;
++ __hppa_fptr_lock = __LT_SPINLOCK_INIT;
+ #endif
+
+ return addr;
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-01-hppa-dl-machine.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-01-hppa-dl-machine.dpatch
new file mode 100644
index 000000000000..8940453360dc
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-01-hppa-dl-machine.dpatch
@@ -0,0 +1,340 @@
+#! /bin/sh -e
+
+# DP: Description: Relocation fixes and assembly cleanups
+# DP: Author: David Huggins-Daines <dhd@debian.org>
+# DP: Upstream status: Submitted by Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2000-07-31 David Huggins-Daines <dhd@debian.org>
+#
+# * sysdeps/hppa/dl-machine.h:
+# Cleanup assembly, define VALID_ELF_*,
+# (elf_machine_dynamic): Cleanup assembly.
+# (elf_machine_load_address): Likewise.
+# (elf_machine_runtime_setup): Fix relocations.
+# (set_dp): Cleanup assembly.
+# (elf_machine_rela): Likewise.
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+diff -urN libc/sysdeps/hppa/dl-machine.h libc/sysdeps/hppa/dl-machine.h
+--- libc/sysdeps/hppa/dl-machine.h Wed Nov 14 09:47:09 2001
++++ libc/sysdeps/hppa/dl-machine.h Wed Nov 14 09:46:02 2001
+@@ -28,8 +28,15 @@
+ #include <link.h>
+ #include <assert.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 must match the definition of the stub in bfd/elf32-hppa.c. */
+-#define SIZEOF_PLT_STUB (4*4)
++#define SIZEOF_PLT_STUB (7*4)
+ #define GOT_FROM_PLT_STUB (4*4)
+
+ /* A PLABEL is a function descriptor. Properly they consist of just
+@@ -66,45 +73,41 @@
+ return ehdr->e_machine == EM_PARISC;
+ }
+
+-
+ /* Return the link-time address of _DYNAMIC. */
+ static inline Elf32_Addr
++elf_machine_dynamic (void) __attribute__ ((const));
++
++static inline Elf32_Addr
+ elf_machine_dynamic (void)
+ {
+ Elf32_Addr dynamic;
+
+-#if 0
+- /* Use this method if GOT address not yet set up. */
+- asm (
+-" b,l 1f,%0\n"
++ asm ("b,l 1f,%0\n"
+ " depi 0,31,2,%0\n"
+ "1: addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8),%0\n"
+ " ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
+- : "=r" (dynamic) : : "r1");
+-#else
+- /* This works because we already have our GOT address available. */
+- dynamic = (Elf32_Addr) &_DYNAMIC;
+-#endif
++ : "=r" (dynamic) : : "r1");
+
+ return dynamic;
+ }
+
+ /* Return the run-time load address of the shared object. */
+ static inline Elf32_Addr
++elf_machine_load_address (void) __attribute__ ((const));
++
++static inline Elf32_Addr
+ elf_machine_load_address (void)
+ {
+- Elf32_Addr dynamic, dynamic_linkaddress;
++ Elf32_Addr dynamic;
+
+ asm (
+ " b,l 1f,%0\n"
+ " depi 0,31,2,%0\n"
+ "1: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%0\n"
+-" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%1\n"
+-" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%0\n"
+-" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%%r1),%0\n"
+- : "=r" (dynamic_linkaddress), "=r" (dynamic) : : "r1");
++" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
++ : "=r" (dynamic) : : "r1");
+
+- return dynamic - dynamic_linkaddress;
++ return dynamic - elf_machine_dynamic ();
+ }
+
+ /* Fixup a PLT entry to bounce directly to the function at VALUE. */
+@@ -167,41 +170,39 @@
+ fptr = (struct hppa_fptr *) (reloc->r_offset + l_addr);
+ if (r_sym != 0)
+ {
+- /* Relocate the pointer to the stub. */
+- fptr->func += l_addr;
+- /* Instead of the LTP value, we put the reloc offset
+- here. The trampoline code will load the proper
+- LTP and pass the reloc offset to the fixup
+- function. */
+- fptr->gp = iplt - jmprel;
+ if (!got)
+ {
+ static union {
+ unsigned char c[8];
+ Elf32_Addr i[2];
+ } sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}};
++ const Elf32_Rela *last_rel;
++
++ last_rel = (const Elf32_Rela *) end_jmprel - 1;
++
++ /* The stub is immediately after the last .plt
++ entry. Rely on .plt relocs being ordered. */
++ if (last_rel->r_offset == 0)
++ return 0;
+
+ /* Find our .got section. It's right after the
+ stub. */
+- got = (Elf32_Addr *) (fptr->func + GOT_FROM_PLT_STUB);
++ got = (Elf32_Addr *) (last_rel->r_offset + l_addr
++ + 8 + SIZEOF_PLT_STUB);
+
+- /* Sanity check to see if the address we are
+- going to check below is within a reasonable
+- approximation of the bounds of the PLT (or,
+- at least, is at an address that won't fault
+- on read). Then check for the magic signature
+- above. */
+- if (fptr->func < (Elf32_Addr) fptr + sizeof(*fptr))
+- return 0;
+- if (fptr->func >
+- ((Elf32_Addr) fptr
+- + SIZEOF_PLT_STUB
+- + ((l->l_info[DT_PLTRELSZ]->d_un.d_val / sizeof (Elf32_Rela))
+- * 8)))
+- return 0;
++ /* Check the magic signature. */
+ if (got[-2] != sig.i[0] || got[-1] != sig.i[1])
+ return 0; /* No lazy linking for you! */
+ }
++
++ /* Relocate the pointer to the stub. */
++ fptr->func = (Elf32_Addr) got - GOT_FROM_PLT_STUB;
++
++ /* Instead of the LTP value, we put the reloc offset
++ here. The trampoline code will load the proper
++ LTP and pass the reloc offset to the fixup
++ function. */
++ fptr->gp = iplt - jmprel;
+ }
+ else
+ {
+@@ -271,22 +272,24 @@
+ " stw %r25,-40(%sp)\n" /* argc */ \
+ " stw %r24,-44(%sp)\n" /* argv */ \
+ \
+- /* We need the LTP, and we need it now. */ \
+- /* $PIC_pcrel$0 points 8 bytes past the current instruction, \
+- just like a branch reloc. This sequence gets us the runtime \
+- address of _DYNAMIC. */ \
++ /* We need the LTP, and we need it now. \
++ $PIC_pcrel$0 points 8 bytes past the current instruction, \
++ just like a branch reloc. This sequence gets us the \
++ runtime address of _DYNAMIC. */ \
+ " bl 0f,%r19\n" \
+ " depi 0,31,2,%r19\n" /* clear priviledge bits */ \
+ "0: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%r19\n" \
+ " ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%r1),%r26\n" \
+ \
+- /* Also get the link time address from the first entry of the GOT. */ \
++ /* The link time address is stored in the first entry of the \
++ GOT. */ \
+ " addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%r19\n" \
+ " ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%r1),%r20\n" \
+ \
+ " sub %r26,%r20,%r20\n" /* Calculate load offset */ \
+ \
+- /* Rummage through the dynamic entries, looking for DT_PLTGOT. */ \
++ /* Rummage through the dynamic entries, looking for \
++ DT_PLTGOT. */ \
+ " ldw,ma 8(%r26),%r19\n" \
+ "1: cmpib,=,n 3,%r19,2f\n" /* tag == DT_PLTGOT? */ \
+ " cmpib,<>,n 0,%r19,1b\n" \
+@@ -306,8 +309,8 @@
+ | 32 bytes of magic | \
+ |---------------------------------| \
+ | 32 bytes argument/sp save area | \
+- |---------------------------------| ((current->mm->env_end) + 63 & ~63) \
+- | N bytes of slack | \
++ |---------------------------------| ((current->mm->env_end) \
++ | N bytes of slack | + 63 & ~63) \
+ |---------------------------------| \
+ | envvar and arg strings | \
+ |---------------------------------| \
+@@ -375,7 +378,7 @@
+ " bl _dl_init,%r2\n" \
+ " ldo 4(%r23),%r23\n" /* delay slot */ \
+ \
+- /* Reload argc, argv to the registers start.S expects them in (feh) */ \
++ /* Reload argc, argv to the registers start.S expects. */ \
+ " ldw -40(%sp),%r25\n" \
+ " ldw -44(%sp),%r24\n" \
+ \
+@@ -387,8 +390,8 @@
+ " .word 0xdeadbeef\n" \
+ " .previous\n" \
+ \
+- /* %r3 contains a function pointer, we need to mask out the lower \
+- * bits and load the gp and jump address. */ \
++ /* %r3 contains a function pointer, we need to mask out the \
++ lower bits and load the gp and jump address. */ \
+ " depi 0,31,2,%r3\n" \
+ " ldw 0(%r3),%r2\n" \
+ " addil LT'__dl_fini_plabel,%r19\n" \
+@@ -409,43 +409,41 @@
+ Enter with r19 = reloc offset, r20 = got-8, r21 = fixup ltp. */
+ #define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \
+ extern void tramp_name (void); \
+- asm ( "\
+- /* Trampoline for " #tramp_name " */ \n\
+- .globl " #tramp_name " \n\
+- .type " #tramp_name ",@function \n\
+-" #tramp_name ": \n\
+- /* Save return pointer */ \n\
+- stw %r2,-20(%sp) \n\
+- /* Save argument registers in the call stack frame. */ \n\
+- stw %r26,-36(%sp) \n\
+- stw %r25,-40(%sp) \n\
+- stw %r24,-44(%sp) \n\
+- stw %r23,-48(%sp) \n\
+- /* Build a call frame. */ \n\
+- stwm %sp,64(%sp) \n\
+- \n\
+- /* Set up args to fixup func. */ \n\
+- ldw 8+4(%r20),%r26 /* got[1] == struct link_map * */ \n\
+- copy %r19,%r25 /* reloc offset */ \n\
+- \n\
+- /* Call the real address resolver. */ \n\
+- bl " #fixup_name ",%r2 \n\
+- copy %r21,%r19 /* delay slot, set fixup func ltp */ \n\
+- \n\
+- ldwm -64(%sp),%sp \n\
+- /* Arguments. */ \n\
+- ldw -36(%sp),%r26 \n\
+- ldw -40(%sp),%r25 \n\
+- ldw -44(%sp),%r24 \n\
+- ldw -48(%sp),%r23 \n\
+- /* Return pointer. */ \n\
+- ldw -20(%sp),%r2 \n\
+- /* Call the real function. */ \n\
+- ldw 0(%r28),%r22 \n\
+- bv %r0(%r22) \n\
+- ldw 4(%r28),%r19 \n\
+-");
+-
++ asm (".globl " #tramp_name "\n" \
++ " .type " #tramp_name ",@function\n" \
++ #tramp_name ":\n" \
++ /* Save return pointer */ \
++ " stw %r2,-20(%sp)\n" \
++ /* Save argument registers in the call stack frame. */ \
++ " stw %r26,-36(%sp)\n" \
++ " stw %r25,-40(%sp)\n" \
++ " stw %r24,-44(%sp)\n" \
++ " stw %r23,-48(%sp)\n" \
++ /* Build a call frame, and save structure pointer. */ \
++ " stwm %r28,64(%sp)\n" \
++ \
++ /* Set up args to fixup func. */ \
++ " ldw 8+4(%r20),%r26\n" /* got[1] == struct link_map * */ \
++ " copy %r19,%r25\n" /* reloc offset */ \
++ \
++ /* Call the real address resolver. */ \
++ " bl " #fixup_name ",%r2\n" \
++ " copy %r21,%r19\n" /* delay slot, set fixup func ltp */ \
++ \
++ " ldw 0(%r28),%r22\n" /* load up the returned func ptr */ \
++ " ldw 4(%r28),%r19\n" \
++ " ldwm -64(%sp),%r28\n" \
++ /* Arguments. */ \
++ " ldw -36(%sp),%r26\n" \
++ " ldw -40(%sp),%r25\n" \
++ " ldw -44(%sp),%r24\n" \
++ " ldw -48(%sp),%r23\n" \
++ /* Call the real function. */ \
++ " bv %r0(%r22)\n" \
++ /* Return pointer. */ \
++ " ldw -20(%sp),%r2\n" \
++ );
++
+ #ifndef PROF
+ #define ELF_MACHINE_RUNTIME_TRAMPOLINE \
+ TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \
+@@ -570,15 +568,15 @@
+ probably haven't relocated the necessary values by this
+ point so we have to find them ourselves. */
+
+- asm ("bl 0f,%0 \n\
+- depi 0,31,2,%0 \n\
+-0: addil L'__boot_ldso_fptr - ($PIC_pcrel$0 - 8),%0 \n\
+- ldo R'__boot_ldso_fptr - ($PIC_pcrel$0 - 12)(%%r1),%1 \n\
+- addil L'__fptr_root - ($PIC_pcrel$0 - 16),%0 \n\
+- ldo R'__fptr_root - ($PIC_pcrel$0 - 20)(%%r1),%2 \n\
+- addil L'__fptr_count - ($PIC_pcrel$0 - 24),%0 \n\
+- ldo R'__fptr_count - ($PIC_pcrel$0 - 28)(%%r1),%3"
+- :
++ asm ("bl 0f,%0\n\t"
++ "depi 0,31,2,%0\n\t"
++ "0:\taddil L'__boot_ldso_fptr - ($PIC_pcrel$0 - 8),%0\n\t"
++ "ldo R'__boot_ldso_fptr - ($PIC_pcrel$0 - 12)(%%r1),%1\n\t"
++ "addil L'__fptr_root - ($PIC_pcrel$0 - 16),%0\n\t"
++ "ldo R'__fptr_root - ($PIC_pcrel$0 - 20)(%%r1),%2\n\t"
++ "addil L'__fptr_count - ($PIC_pcrel$0 - 24),%0\n\t"
++ "ldo R'__fptr_count - ($PIC_pcrel$0 - 28)(%%r1),%3"
++ :
+ "=r" (dot),
+ "=r" (p_boot_ldso_fptr),
+ "=r" (p_fptr_root),
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-02-hppa-min-kern-unwind-fde.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-02-hppa-min-kern-unwind-fde.dpatch
new file mode 100644
index 000000000000..da062e98742e
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-02-hppa-min-kern-unwind-fde.dpatch
@@ -0,0 +1,55 @@
+#! /bin/sh -e
+
+# DP: Description: Minimum required kernel bump.
+# DP: Author: Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Upstream status: Submitted
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2002-11-11 Carlos O'Donell <carlos@baldric.uwo.ca>
+#
+# * sysdeps/unix/sysv/linux/configure.in:
+# Make 2.4.19 minimum linux kernel for hppa, and add unwind symbols
+# from gcc-3.0 era for backwards compatibility.
+# * sysdeps/unix/sysv/linux/configure: Regenerate.
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- glibc-2.3.1.orig/sysdeps/unix/sysv/linux/configure.in 2002-10-25 21:06:29.000000000 -0400
++++ glibc-2.3.1/sysdeps/unix/sysv/linux/configure.in 2002-11-17 22:09:57.000000000 -0500
+@@ -64,7 +64,8 @@
+ arch_minimum_kernel=2.4.0
+ ;;
+ hppa*)
+- arch_minimum_kernel=2.3.99
++ libc_cv_gcc_unwind_find_fde=yes
++ arch_minimum_kernel=2.4.19
+ ;;
+ m68k*)
+ arch_minimum_kernel=2.0.10
+--- glibc-2.3.1.orig/sysdeps/unix/sysv/linux/configure 2002-10-25 21:06:29.000000000 -0400
++++ glibc-2.3.1/sysdeps/unix/sysv/linux/configure 2002-11-17 22:10:17.000000000 -0500
+@@ -101,7 +101,8 @@
+ arch_minimum_kernel=2.4.0
+ ;;
+ hppa*)
+- arch_minimum_kernel=2.3.99
++ libc_cv_gcc_unwind_find_fde=yes
++ arch_minimum_kernel=2.4.19
+ ;;
+ m68k*)
+ arch_minimum_kernel=2.0.10
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-03-hppa-mcontext.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-03-hppa-mcontext.dpatch
new file mode 100644
index 000000000000..523fae038133
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-03-hppa-mcontext.dpatch
@@ -0,0 +1,46 @@
+#! /bin/sh -e
+
+# DP: Description: Change HPPA mcontext to match kernel view.
+# DP: Author: Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Upstream status: Submitted
+# DP: Status Details: Awaiting approval
+# DP: Date: November 16, 2002
+
+#
+#2002-08-20 Carlos O'Donell <carlos@baldric.uwo.ca>
+#
+# * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h:
+# Define mcontext_t as a sigcontext.
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+diff -urN glibc-2.2.5/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h glibc-2.2.5/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
+--- glibc-2.2.5/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h 2002-08-20 20:50:17.000000000 -0400
++++ glibc-2.2.5/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h 2002-08-20 20:49:01.000000000 -0400
+@@ -52,11 +52,7 @@
+ } fpregset_t;
+
+ /* Context to describe whole processor state. */
+-typedef struct
+- {
+- gregset_t gregs;
+- fpregset_t fpregs;
+- } mcontext_t;
++typedef struct sigcontext mcontext_t;
+
+ /* Userlevel context. */
+ typedef struct ucontext
+
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-04-hppa-fcntl64.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-04-hppa-fcntl64.dpatch
new file mode 100644
index 000000000000..e3a0d7be108d
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-04-hppa-fcntl64.dpatch
@@ -0,0 +1,53 @@
+#! /bin/sh -e
+
+# DP: Description: Fixes fcntl64 on HPPA
+# DP: Author: Randolph Chung <tausq@debian.org>
+# DP: Upstream status: Submitted by Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2002-10-01 Randolph Chung <tausq@debian.org>
+#
+# * sysdeps/unix/sysv/linux/hppa/fcntl.c:
+# Include sysdeps/unix/sysv/linux/i386/fcntl.c
+# * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h:
+# Change defines when using __USE_FILE_OFFSET64
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- glibc/sysdeps/unix/sysv/linux/hppa/fcntl.c 2002-09-10 20:58:07.000000000 -0700
++++ glibc/sysdeps/unix/sysv/linux/hppa/fcntl.c 2002-09-10 20:58:07.000000000 -0700
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
+--- glibc/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h 2002-09-12 10:31:56.000000000 -0700
++++ glibc/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h 2002-09-12 23:43:14.000000000 -0700
+@@ -63,9 +63,15 @@
+ #define F_SETFD 2 /* Set file descriptor flags. */
+ #define F_GETFL 3 /* Get file status flags. */
+ #define F_SETFL 4 /* Set file status flags. */
++#ifndef __USE_FILE_OFFSET64
+ #define F_GETLK 5 /* Get record locking info. */
+ #define F_SETLK 6 /* Set record locking info (non-blocking). */
+ #define F_SETLKW 7 /* Set record locking info (blocking). */
++#else
++#define F_GETLK F_GETLK64 /* Get record locking info. */
++#define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */
++#define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
++#endif
+
+ #define F_GETLK64 8 /* Get record locking info. */
+ #define F_SETLK64 9 /* Set record locking info (non-blocking). */
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-05-hppa-buildhack.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-05-hppa-buildhack.dpatch
new file mode 100644
index 000000000000..6d5405ada4df
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-05-hppa-buildhack.dpatch
@@ -0,0 +1,38 @@
+#! /bin/sh -e
+
+# DP: Description: Remove the use of fp regs during the loader
+# DP: Author: Randolph Chung <tausq@debian.org>
+# DP: Upstream status: Submitted by Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2002-11-11 Randolph Chung <tausq@debian.org>
+#
+# * sysdeps/hppa/Makefile: Disable the use of fp regs in rtld.c
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- glibc/sysdeps/hppa/Makefile.orig 2002-09-11 20:19:15.000000000 -0700
++++ glibc/sysdeps/hppa/Makefile 2002-09-11 20:19:17.000000000 -0700
+@@ -27,6 +27,7 @@
+ endif
+
+ ifeq ($(subdir),elf)
++CFLAGS-rtld.c += -mdisable-fpregs
+ dl-routines += dl-symaddr dl-fptr
+ rtld-routines += dl-symaddr dl-fptr
+ endif
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-06-hppa-tests.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-06-hppa-tests.dpatch
new file mode 100644
index 000000000000..25a7f23c72a7
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-06-hppa-tests.dpatch
@@ -0,0 +1,921 @@
+#! /bin/sh -e
+
+# DP: Description: Regenerate new ulps for hppa
+# DP: Author: Randolf Chung <tausq@debian.org>
+# DP: Upstream status: Submitted by Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2002-11-11 Randolf Chung <tausq@debian.org>
+#
+# * sysdeps/hppa/fpu/libm-test-ulps: Regenerate new ulps for hppa.
+#
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- glibc-2.3.1/sysdeps/hppa/fpu/libm-test-ulps 1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.3.1/sysdeps/hppa/fpu/libm-test-ulps.new 2002-11-11 15:45:46.000000000 -0500
+@@ -0,0 +1,890 @@
++# Begin of automatic generation
++
++# atan2
++Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
++float: 3
++ifloat: 3
++Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
++float: 3
++ifloat: 3
++Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
++float: 1
++ifloat: 1
++
++# atanh
++Test "atanh (0.75) == 0.972955074527656652552676371721589865":
++float: 1
++ifloat: 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
++
++# casin
++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":
++double: 5
++float: 1
++idouble: 5
++ifloat: 1
++Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
++double: 3
++float: 6
++idouble: 3
++ifloat: 6
++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":
++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
++
++# 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
++Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
++float: 6
++ifloat: 6
++
++# cbrt
++Test "cbrt (-27.0) == -3.0":
++double: 1
++idouble: 1
++Test "cbrt (0.75) == 0.908560296416069829445605878163630251":
++double: 1
++idouble: 1
++Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217":
++double: 1
++idouble: 1
++
++# ccos
++Test "Imaginary part of: ccos (-2 - 3 i) == -4.1896256909688072301 - 9.1092278937553365979 i":
++float: 1
++ifloat: 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.7245455049153225654 + 0.5118225699873846088 i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: ccosh (-2 - 3 i) == -3.7245455049153225654 + 0.5118225699873846088 i":
++float: 1
++ifloat: 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":
++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":
++float: 3
++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":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-2 - 3 i) == 0.5569716761534183846 - 0.9375544629863747085 i":
++double: 1
++float: 5
++idouble: 1
++ifloat: 5
++Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
++float: 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 (3 + inf i) == inf + pi/2*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i":
++float: 1
++ifloat: 1
++Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i":
++float: 1
++ifloat: 1
++
++# cos
++Test "cos (M_PI_6l * 2.0) == 0.5":
++double: 1
++float: 1
++idouble: 1
++ifloat: 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
++
++# 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
++idouble: 1
++ifloat: 4
++Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
++float: 2
++ifloat: 2
++Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i":
++double: 2
++float: 2
++idouble: 2
++ifloat: 2
++
++# csinh
++Test "Imaginary part of: csinh (-2 - 3 i) == 3.5905645899857799520 - 0.5309210862485198052 i":
++double: 1
++idouble: 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":
++float: 1
++ifloat: 1
++Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
++float: 1
++ifloat: 1
++
++# ctan
++Test "Real part of: ctan (-2 - 3 i) == 0.0037640256415042482 - 1.0032386273536098014 i":
++double: 1
++idouble: 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.9653858790221331242 + 0.0098843750383224937 i":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
++float: 1
++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 (2.0) == 0.00467773498104726583793074363274707139":
++double: 1
++idouble: 1
++Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
++double: 1
++idouble: 1
++
++# exp10
++Test "exp10 (-1) == 0.1":
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
++Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "exp10 (3) == 1000":
++double: 6
++float: 2
++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
++
++# hypot
++Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271":
++float: 1
++ifloat: 1
++Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271":
++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 (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.171650807137553906090869407851972001":
++float: 1
++ifloat: 1
++
++# j1
++Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
++float: 2
++ifloat: 2
++Test "j1 (2.0) == 0.576724807756873387202448242269137087":
++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, 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.171650807137553906090869407851972001":
++float: 1
++ifloat: 1
++Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
++float: 2
++ifloat: 2
++Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
++double: 1
++idouble: 1
++Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
++double: 1
++idouble: 1
++Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
++double: 1
++float: 1
++idouble: 1
++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, 2.0) == 0.251538628271673670963516093751820639e-6":
++float: 4
++ifloat: 4
++Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
++double: 1
++float: 1
++idouble: 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, 2.0) == 0.128943249474402051098793332969239835":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++# lgamma
++Test "lgamma (0.7) == 0.26086724653166651439":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "lgamma (1.2) == -0.853740900033158497197e-1":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++# log10
++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
++
++# 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
++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
++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
++
++# tgamma
++Test "tgamma (-0.5) == -2 sqrt (pi)":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "tgamma (0.5) == sqrt (pi)":
++float: 1
++ifloat: 1
++Test "tgamma (0.7) == 1.29805533264755778568":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++# y0
++Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
++Test "y0 (1.5) == 0.382448923797758843955068554978089862":
++double: 2
++float: 1
++idouble: 2
++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
++
++# y1
++Test "y1 (0.125) == -5.19993611253477499595928744876579921":
++double: 1
++idouble: 1
++Test "y1 (1.5) == -0.412308626973911295952829820633445323":
++float: 1
++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 (8.0) == -0.158060461731247494255555266187483550":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++# yn
++Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
++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, 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 (1, 0.125) == -5.19993611253477499595928744876579921":
++double: 1
++idouble: 1
++Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
++float: 1
++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, 8.0) == -0.158060461731247494255555266187483550":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
++double: 1
++idouble: 1
++Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
++double: 1
++idouble: 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 (3, 0.125) == -2612.69757350066712600220955744091741":
++double: 1
++idouble: 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, 2.0) == -1.12778377684042778608158395773179238":
++double: 1
++idouble: 1
++
++# Maximal error of functions:
++Function: "atan2":
++float: 3
++ifloat: 3
++
++Function: "atanh":
++float: 1
++ifloat: 1
++
++Function: Real part of "cacosh":
++double: 1
++float: 7
++idouble: 1
++ifloat: 7
++
++Function: Imaginary part of "cacosh":
++double: 1
++float: 3
++idouble: 1
++ifloat: 3
++
++Function: Real part of "casin":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: Real part of "casinh":
++double: 5
++float: 1
++idouble: 5
++ifloat: 1
++
++Function: Imaginary part of "casinh":
++double: 3
++float: 6
++idouble: 3
++ifloat: 6
++
++Function: Real part of "catan":
++float: 4
++ifloat: 4
++
++Function: Imaginary part of "catan":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: Real part of "catanh":
++double: 4
++idouble: 4
++
++Function: Imaginary part of "catanh":
++float: 6
++ifloat: 6
++
++Function: "cbrt":
++double: 1
++idouble: 1
++
++Function: Real part of "ccos":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: Imaginary part of "ccos":
++float: 1
++ifloat: 1
++
++Function: Real part of "ccosh":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: Imaginary part of "ccosh":
++float: 1
++ifloat: 1
++
++Function: Real part of "cexp":
++float: 1
++ifloat: 1
++
++Function: Imaginary part of "cexp":
++float: 1
++ifloat: 1
++
++Function: Real part of "clog":
++float: 1
++ifloat: 1
++
++Function: Imaginary part of "clog":
++float: 3
++ifloat: 3
++
++Function: Real part of "clog10":
++float: 1
++ifloat: 1
++
++Function: Imaginary part of "clog10":
++double: 1
++float: 5
++idouble: 1
++ifloat: 5
++
++Function: "cos":
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
++
++Function: Real part of "cpow":
++double: 2
++float: 4
++idouble: 2
++ifloat: 4
++
++Function: Imaginary part of "cpow":
++double: 2
++float: 2
++idouble: 2
++ifloat: 2
++
++Function: Real part of "csinh":
++float: 1
++ifloat: 1
++
++Function: Imaginary part of "csinh":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: Real part of "csqrt":
++float: 1
++ifloat: 1
++
++Function: Real part of "ctan":
++double: 1
++idouble: 1
++
++Function: Imaginary part of "ctan":
++double: 1
++idouble: 1
++
++Function: Real part of "ctanh":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++Function: Imaginary part of "ctanh":
++float: 1
++ifloat: 1
++
++Function: "erf":
++double: 1
++idouble: 1
++
++Function: "erfc":
++double: 1
++idouble: 1
++
++Function: "exp10":
++double: 6
++float: 2
++idouble: 6
++ifloat: 2
++
++Function: "expm1":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: "hypot":
++float: 1
++ifloat: 1
++
++Function: "j0":
++double: 2
++float: 2
++idouble: 2
++ifloat: 2
++
++Function: "j1":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++Function: "jn":
++double: 4
++float: 4
++idouble: 4
++ifloat: 4
++
++Function: "lgamma":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++Function: "log10":
++double: 1
++float: 2
++idouble: 1
++ifloat: 2
++
++Function: "log1p":
++float: 1
++ifloat: 1
++
++Function: "sincos":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: "tan":
++double: 1
++idouble: 1
++
++Function: "tgamma":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++Function: "y0":
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
++
++Function: "y1":
++double: 3
++float: 2
++idouble: 3
++ifloat: 2
++
++Function: "yn":
++double: 3
++float: 2
++idouble: 3
++ifloat: 2
++
++# end of automatic generation
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch
new file mode 100644
index 000000000000..ef7b556df18d
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch
@@ -0,0 +1,81 @@
+#! /bin/sh -e
+
+# DP: Description: atomicity.h placeholder for HPPA
+# DP: Author: Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Upstream status: Not submitted upstream
+# DP: Status Details: --
+# DP: Date: November 16, 2002
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+diff -urN glibc-2.3.1.orig/sysdeps/hppa/atomicity.h glibc-2.3.1/sysdeps/hppa/atomicity.h
+--- glibc-2.3.1.orig/sysdeps/hppa/atomicity.h 1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.3.1/sysdeps/hppa/atomicity.h 2002-11-07 08:35:55.000000000 -0500
+@@ -0,0 +1,55 @@
++/* Low-level functions for atomic operations. HP-PARISC version.
++ Copyright (C) 1997,2001 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 _ATOMICITY_H
++#define _ATOMICITY_H 1
++
++#include <inttypes.h>
++
++#warning stub atomicity functions are not atomic
++#warning CAO This will get implemented soon
++
++static inline int
++__attribute__ ((unused))
++exchange_and_add (volatile uint32_t *mem, int val)
++{
++ int result = *mem;
++ *mem += val;
++ return result;
++}
++
++static inline void
++__attribute__ ((unused))
++atomic_add (volatile uint32_t *mem, int val)
++{
++ *mem += val;
++}
++
++static inline int
++__attribute__ ((unused))
++compare_and_swap (volatile long int *p, long int oldval, long int newval)
++{
++ if (*p != oldval)
++ return 0;
++
++ *p = newval;
++ return 1;
++}
++
++#endif /* atomicity.h */
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-08-hppa-configure.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-08-hppa-configure.dpatch
new file mode 100644
index 000000000000..cfa4e01cc440
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-08-hppa-configure.dpatch
@@ -0,0 +1,124 @@
+#! /bin/sh -e
+
+# DP: Description: Change link order of libgcc and libgcc_eh
+# DP: Author: Carlos O'Donell <carlos@baldric.uwo.ca>
+# DP: Upstream status: Submitted
+# DP: Status Details: Awaiting upstream approval
+# DP: Date: November 16, 2002
+
+#
+#2002-11-16 Carlos O'Donell <carlos@baldric.uwo.ca>
+#
+# * configure.in: Change "-lgcc -lgcc_eh" to "-lgcc_eh -lgcc"
+# * configure: Regenerate.
+#
+
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p0 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- configure.in~ 2002-11-18 23:55:32.000000000 -0500
++++ configure.in 2002-11-18 23:55:54.000000000 -0500
+@@ -1508,9 +1508,9 @@
+ fi
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info
+ -nostdlib -nostartfiles
+- -o conftest conftest.c -lgcc -lgcc_eh >&AC_FD_CC]); then
++ -o conftest conftest.c -lgcc_eh -lgcc >&AC_FD_CC]); then
+ if ${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles \
+- -o conftest conftest.c -lgcc -lgcc_eh -v 2>&1 >/dev/null \
++ -o conftest conftest.c -lgcc_eh -lgcc -v 2>&1 >/dev/null \
+ | grep -q -- --eh-frame-hdr; then
+ libc_cv_gcc_dwarf2_unwind_info=no_registry_needed
+ else
+--- configure~ 2002-11-18 23:56:01.000000000 -0500
++++ configure 2002-11-19 00:02:22.000000000 -0500
+@@ -2383,7 +2383,7 @@
+ fi
+
+
+-for ac_prog in gawk mawk nawk awk
++for ac_prog in mawk gawk nawk awk
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+@@ -3612,9 +3612,9 @@
+ fi
+ if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame_info
+ -nostdlib -nostartfiles
+- -o conftest conftest.c -lgcc -lgcc_eh >&5'; { (eval echo configure:3616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
++ -o conftest conftest.c -lgcc_eh -lgcc >&5'; { (eval echo configure:3616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if ${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles \
+- -o conftest conftest.c -lgcc -lgcc_eh -v 2>&1 >/dev/null \
++ -o conftest conftest.c -lgcc_eh -lgcc -v 2>&1 >/dev/null \
+ | grep -q -- --eh-frame-hdr; then
+ libc_cv_gcc_dwarf2_unwind_info=no_registry_needed
+ else
+@@ -3821,15 +3821,16 @@
+ #line 3822 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
+-int main()
++#include <sys/types.h>
++main()
+ {
+ FILE *f=fopen("conftestval", "w");
+- if (!f) return(1);
++ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(long double));
+- return(0);
++ exit(0);
+ }
+ EOF
+-if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:3834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_long_double=`cat conftestval`
+ else
+@@ -3907,7 +3908,7 @@
+ fi
+
+ echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
+-echo "configure:3911: checking OS release for uname" >&5
++echo "configure:3912: checking OS release for uname" >&5
+ if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -3929,7 +3930,7 @@
+ uname_release="$libc_cv_uname_release"
+
+ echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
+-echo "configure:3933: checking OS version for uname" >&5
++echo "configure:3934: checking OS version for uname" >&5
+ if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -3958,7 +3959,7 @@
+ # Test for old glibc 2.0.x headers so that they can be removed properly
+ # Search only in includedir.
+ echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6
+-echo "configure:3962: checking for old glibc 2.0.x headers" >&5
++echo "configure:3963: checking for old glibc 2.0.x headers" >&5
+ if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
+ then
+ old_glibc_headers=yes
+@@ -4019,7 +4020,7 @@
+ fi
+
+ echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
+-echo "configure:4023: checking whether -fPIC is default" >&5
++echo "configure:4024: checking whether -fPIC is default" >&5
+ if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-hppa-shmlba.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-hppa-shmlba.dpatch
new file mode 100644
index 000000000000..4f0b93d9d8a9
--- /dev/null
+++ b/sys-libs/glibc/files/2.3.1/glibc23-hppa-shmlba.dpatch
@@ -0,0 +1,48 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: HPPA X11 build problem fix from current libc cvs.
+# DP: Author: GOTO Masanori <gotom@debian.org>
+# DP: Upstream status: In CVS
+# DP: Status Details: Already applied in upstream
+# DP: Date: 2002-12-28
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p0 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- sysdeps/unix/sysv/linux/hppa/bits/shm.h 28 Sep 2002 04:05:23 -0000 1.1
++++ sysdeps/unix/sysv/linux/hppa/bits/shm.h 20 Dec 2002 10:31:09 -0000 1.3
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
++/* Copyright (C) 1995, 1996, 1997, 2000, 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
+@@ -36,6 +36,8 @@
+ #define SHM_LOCK 11 /* lock segment (root only) */
+ #define SHM_UNLOCK 12 /* unlock segment (root only) */
+
++/* Segment low boundary address multiple. */
++#define SHMLBA 0x00400000 /* address needs to be 4 Mb aligned */
+
+ /* Type to count number of attaches. */
+ typedef unsigned long int shmatt_t;
+@@ -76,6 +78,7 @@
+ /* 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 */
+
+ struct shminfo
+ {
diff --git a/sys-libs/glibc/glibc-2.3.1-r2.ebuild b/sys-libs/glibc/glibc-2.3.1-r2.ebuild
index 339fd6611ae2..815454380cb4 100644
--- a/sys-libs/glibc/glibc-2.3.1-r2.ebuild
+++ b/sys-libs/glibc/glibc-2.3.1-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r2.ebuild,v 1.16 2003/01/15 01:41:20 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r2.ebuild,v 1.17 2003/02/09 20:22:48 gmsoft Exp $
IUSE="nls pic build"
@@ -44,7 +44,7 @@ SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${PV}.tar.gz
http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${PV}.tar.gz"
HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-KEYWORDS="x86 ppc sparc alpha mips"
+KEYWORDS="x86 ppc sparc alpha mips hppa"
# Is 99% compadible, just some .a's bork
SLOT="2.2"
LICENSE="GPL-2"
@@ -137,6 +137,22 @@ src_unpack() {
epatch ${FILESDIR}/${PV}/${P}-tst-rndseek-mips.patch
epatch ${FILESDIR}/${PV}/${P}-ulps-mips.patch
fi
+ # Some patches for hppa.
+ # <gmsoft@gentoo.org> (27 Jan 2003)
+ if [ "${ARCH}" = "hppa" ]
+ then
+ cd ${S}
+ epatch ${FILESDIR}/${PV}/glibc23-00-hppa-pthreads.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-01-hppa-dl-machine.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-02-hppa-min-kern-unwind-fde.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-03-hppa-mcontext.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-04-hppa-fcntl64.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-05-hppa-buildhack.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-06-hppa-tests.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-07-hppa-atomicity.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-08-hppa-configure.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-hppa-shmlba.dpatch
+ fi
}
diff --git a/sys-libs/glibc/glibc-2.3.1-r3.ebuild b/sys-libs/glibc/glibc-2.3.1-r3.ebuild
index b38eaa10fa39..43b6e8c76803 100644
--- a/sys-libs/glibc/glibc-2.3.1-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.3.1-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r3.ebuild,v 1.4 2003/01/29 16:18:15 jmorgan Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r3.ebuild,v 1.5 2003/02/09 20:22:48 gmsoft Exp $
IUSE="nls pic build"
@@ -44,7 +44,7 @@ SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${PV}.tar.gz
http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${PV}.tar.gz"
HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-KEYWORDS="~x86 ~ppc sparc ~alpha ~mips"
+KEYWORDS="~x86 ~ppc sparc ~alpha ~mips ~hppa"
# Is 99% compadible, just some .a's bork
SLOT="2.2"
LICENSE="GPL-2"
@@ -138,6 +138,24 @@ src_unpack() {
epatch ${FILESDIR}/${PV}/${P}-ulps-mips.patch
fi
+ # Some patches for hppa.
+ # <gmsoft@gentoo.org> (27 Jan 2003)
+ if [ "${ARCH}" = "hppa" ]
+ then
+ cd ${S}
+ epatch ${FILESDIR}/${PV}/glibc23-00-hppa-pthreads.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-01-hppa-dl-machine.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-02-hppa-min-kern-unwind-fde.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-03-hppa-mcontext.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-04-hppa-fcntl64.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-05-hppa-buildhack.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-06-hppa-tests.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-07-hppa-atomicity.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-08-hppa-configure.dpatch
+ epatch ${FILESDIR}/${PV}/glibc23-hppa-shmlba.dpatch
+ fi
+
+
}
src_compile() {