glibc 2.3.2-9 for hppa - "when hell freezes over" release
debian-glibc,
Thanks for all the patience, and help from too many people to name in a short email (you know who you are!) :)
Please wait 2 days before doing the upload, I am in the process of getting other testers to make sure this release is of the highest quality possible. If the testers do not agree with the release quality I will request by email a delay of 2 more days to repatch and test, followed by an update to the list.
I have done my own internal testing, but this is always limited compared to the scope of the "common persons" installed system and hardware.
-- Install procedure --
a. Remove all *hppa* patches from 0list
b. Include just this one .dpatch
I have asked Jeff Bailey to do the upload for me. This would place us at 2.3.2-9, and get us back on track.
The .dpatch contains a complete internal listing of all the patches I used to generate the larger patch.
I will produce an alternate .dpatch for the nptl branch, since the cvs.dpatch is newer and will have some of my upstream patches.
Many thanks,
Cheers,
Carlos.
#! /bin/sh -e
# All lines beginning with `# DP:' are a description of the patch. # DP: Description: HPPA Glibc Fixes 2003-10-14
# DP: Related bugs:
# DP: Author: Carlos O'Donell <[email protected]>
# DP: Upstream status: Submitted and pending.
# DP: Status Details: Waiting on upstream to review patcfhes/ # DP: Date: 2003-10-16
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 1esac
exit 0
# Patched with:
#
# Linuxthread fixes:
# patches-2003-10-14/glibc23-00.a-noarch-pthreads # patches-2003-10-14/glibc23-00.a1-noarch-sgu # patches-2003-10-14/glibc23-00.b-noarch-sysdeps-pthreads # patches-2003-10-14/glibc23-00.c2-hppa-pthreads # patches-2003-10-14/glibc23-01d-hppa-dl-machine # # libgcc compat fixes: # patches-2003-10-14/glibc23-02-hppa-compat # # Introduce atomicity warnings: # patches-2003-10-14/glibc23-03-hppa-atomicity # # Don't align all mallocs at 16: # patches-2003-10-14/glibc23-04-hppa-malloc8 # # Sysdep updates including cancellation: # patches-2003-10-14/glibc23-05n-hppa-sysdep # patches-2003-10-14/glibc23-06r-hppa-sysdep-cancel # patches-2003-10-14/glibc23-07b-hppa-sysdep2 # # Elf entry fix for ld, removes kernel hack: # patches-2003-10-14/glibc23-09-hppa-entry # # Patch to use new atomic structure: # patches-2003-10-14/glibc23-12-hppa-oldsemaphore # # We have sjlj exceptions but compat code was for dwarf: # patches-2003-10-14/glibc23-13-hppa-framestatefor # # Fix function pointer resolving (needs to move to new generic method): # patches-2003-10-14/glibc23-14-hppa-dlfptr # # Fixes getaddrinfo from upstream: # patches-2003-10-14/glibc23-15-generic-getaddrinfo # # Include new pthreadtypes for hppa: # patches-2003-10-14/glibc23-17b-hppa-pthreadtypes # # Fix warnings: # patches-2003-10-14/glibc23-18-generic-sysctlh # # Add semtimedop for hppa: # patches-2003-10-14/glibc23-19-hppa-semtimedop # # Fix symbol resolution issues: # patches-2003-10-14/glibc23-20c-hppa-ptmachine # # Make the kernelstat 64-bit uncompatible: # patches-2003-10-14/glibc23-21-hppa-kernelstat # # Fixup C version of syscalls: # patches-2003-10-14/glibc23-22c-hppa-sysdepc # # Fixes for sjlj versus dwarf compat code: # patches-2003-10-14/glibc23-23-hppa-unwind-dw2 # # Allow hppa to get at the linkmap: # patches-2003-10-14/glibc23-25b-dynamic-link # # Fix all of the assembly for hppa fpu code: # patches-2003-10-14/glibc23-26e-fpu # # Add small amount of debugging code to make locale # generation easier to understand: # patches-2003-10-14/glibc23-27-debug-gen-locale # # Fixup clone to save/restore pic register: # patches-2003-10-14/glibc23-28c-hppa-clone # # Fixup prototype warnings: # patches-2003-10-14/glibc23-29-hppa-prototypes # # Fixup bad cats: # patches-2003-10-14/glibc23-30-hppa-casts # # Fixup warning: # patches-2003-10-14/glibc23-31-generic-unix-Makefile # # Implement proper non-linuxthread locking: # patches-2003-10-14/glibc23-32-hppa-thread-m # patches-2003-10-14/glibc23-32a-hppa-thread-m # # Fixup warnings: # patches-2003-10-14/glibc23-33-generic-internals # # These patches generate rejects, and those rejects were then dealt # with on a per patch basis. Some were discarded others merged. #
# append the patch here and adjust the -p? flag in the patch calls.
diff -urN glibc-2.3.2.orig/elf/dynamic-link.h glibc-2.3.2/elf/dynamic-link.h
--- glibc-2.3.2.orig/elf/dynamic-link.h 2003-10-14 02:14:23.000000000 -0400
+++ glibc-2.3.2/elf/dynamic-link.h 2003-10-14 02:21:12.000000000 -0400
@@ -29,12 +29,21 @@
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
ElfW(Addr) *const reloc_addr);
+# if ELF_MACHINE_REL_RELATIVE_NEEDSLINKMAP
+auto void __attribute__((always_inline))
+elf_machine_rel_relative (struct link_map *map, ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+ ElfW(Addr) *const reloc_addr);
+auto void __attribute__((always_inline))
+elf_machine_rela_relative (struct link_map *map, ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+ ElfW(Addr) *const reloc_addr);
+# else
auto void __attribute__((always_inline))
elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
ElfW(Addr) *const reloc_addr);
auto void __attribute__((always_inline))
elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
ElfW(Addr) *const reloc_addr);
+# endif
# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
auto void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
diff -urN glibc-2.3.2.orig/linuxthreads/descr.h glibc-2.3.2/linuxthreads/descr.h
--- glibc-2.3.2.orig/linuxthreads/descr.h 2003-10-14 02:14:24.000000000 -0400
+++ glibc-2.3.2/linuxthreads/descr.h 2003-10-14 02:16:35.000000000 -0400
@@ -71,7 +71,7 @@
/* Atomic counter made possible by compare_and_swap */
struct pthread_atomic {
long p_count;
- int p_spinlock;
+ __atomic_lock_t p_spinlock;
};linuxthreads/manager.c +5 -0
@@ -69,8 +69,13 @@#else static inline pthread_descr thread_segment (int seg) { +# ifdef _STACK_GROWS_UP +return (pthread_descr)(THREAD_STACK_START_ADDRESS + (seg -1 ) *STACK_SIZE ) + +1 ; +# else return (pthread_descr)(THREAD_STACK_START_ADDRESS - (seg -1 ) *STACK_SIZE ) -1 ; +# endif }#endif
linuxthreads/oldsemaphore.c +1 -1
@@ -31,7 +31,7 @@typedef struct {long int sem_status; -int sem_spinlock; +__atomic_lock_t sem_spinlock; }old_sem_t ;extern int __old_sem_init (old_sem_t *__sem,int __pshared,unsigned int __value);
linuxthreads/pt-machine.c +3 -1
@@ -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>
linuxthreads/pthread.c +23 -8
@@ -299,9 +299,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
@@ -369,7 +369,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;
@@ -383,9 +383,9 @@#else /* USE_TLS */ /* 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;
@@ -841,7 +841,11 @@/* __pthread_handles[0] is the initial thread, __pthread_handles[1] is the manager threads handled specially in thread_self(), so start at 2 */ h = __pthread_handles +2 ; +# ifdef _STACK_GROWS_UP +while (! (sp >= (char *) h->h_descr && sp < h->h_descr->p_guardaddr)) h++; +# else while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom)) h++; +# endif return h->h_descr; }
@@ -856,11 +860,22 @@return manager_thread; h = __pthread_handles +2 ; # ifdef USE_TLS +# ifdef _STACK_GROWS_UP + while (h->h_descr == NULL + || ! (sp >= h->h_descr->p_stackaddr && + sp < h->h_descr->p_guardaddr)) +# else while (h->h_descr == NULL - || ! (sp <= (char *) h->h_descr->p_stackaddr && sp >= h->h_bottom)) + || ! (sp <= h->h_descr->p_stackaddr && + sp >= h->h_bottom)) +# endif h++; # else +# ifdef _STACK_GROWS_UP + while (! (sp >= (char *) h->h_descr && sp < h->h_descr->p_guardaddr)) +# else while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom)) +# endif h++; # endif return h->h_descr;
linuxthreads/spinlock.c +11 -11
@@ -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 definedTEST_FOR_COMPARE_AND_SWAP if (!__pthread_has_cas)
@@ -662,7 +662,7 @@#if !definedHAS_COMPARE_AND_SWAP || definedTEST_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;
linuxthreads/spinlock.h +20 -6
@@ -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); }
linuxthreads/sysdeps/hppa/pspinlock.c +11 -14
@@ -24,13 +24,10 @@int __pthread_spin_lock (pthread_spinlock_t *lock) { -unsigned int val; +volatile unsigned int *addr =__ldcw_align (lock); -do - asmvolatile ("ldcw %1,%0" - :"=r" (val),"=m" (*lock) - :"m" (*lock)); -while (!val); +while (__ldcw (addr) ==0 ) +while (*addr ==0 ) ;return 0 ; }
@@ -40,13 +37,9 @@int __pthread_spin_trylock (pthread_spinlock_t *lock) { -unsigned int val; +volatile unsigned int *a =__ldcw_align (lock); - asmvolatile ("ldcw %1,%0" - :"=r" (val),"=m" (*lock) - :"m" (*lock)); - -return val ?0 :EBUSY ; +return __ldcw (a) ?0 :EBUSY ; }weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
@@ -54,7 +47,9 @@int __pthread_spin_unlock (pthread_spinlock_t *lock) { - *lock =1 ; +volatile unsigned int *a =__ldcw_align (lock); + + *a =1 ;return 0 ; }weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
@@ -66,7 +61,9 @@/* We can ignore the `pshared' parameter. Since we are busy-waiting all processes which can access the memory location `lock' points to can use the spinlock. */ - *lock =1 ; +volatile unsigned int *a =__ldcw_align (lock); + + *a =1 ;return 0 ; }weak_alias (__pthread_spin_init, pthread_spin_init)
linuxthreads/sysdeps/hppa/pt-machine.h +73 -20
120 lines not on this page · raw message
linuxthreads/sysdeps/pthread/bits/libc-lock.h +3 -3
@@ -71,12 +71,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 ) \
linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +5 -3
@@ -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
linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h +19 -5
@@ -19,9 +19,23 @@/* 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, 1, 1, 1 } }) + +/* Initialize global spinlocks without cast, generally macro wrapped */ +#define __LT_SPINLOCK_ALT_INIT { { 1, 1, 1, 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 { __LT_SPINLOCK_ALT_INIT, 0 } + +/* Used to initialize _pthread_fastlock's in non-static case */ +#define __LOCK_ALT_INITIALIZER ((struct _pthread_fastlock){ __LT_SPINLOCK_INIT, 0 }) + +/* Used in pthread_atomic initialization */ +#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_ALT_INIT } + +/* 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 }
linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h +160 -0
160 lines not on this page · raw message
linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h +73 -0
73 lines not on this page · raw message
linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h +190 -0
190 lines not on this page · raw message
localedata/gen-locale.sh +1 -0
@@ -47,6 +47,7 @@ locale=`echo $locfile|sed 's|\([^.]*\)[.].*/LC_CTYPE|\1|'` charmap=`echo $locfile|sed 's|[^.]*[.]\(.*\)/LC_CTYPE|\1|'` +echo "Running \"$0 $common_objpfx $localedef $locfile\"" echo "Generating locale $locale.$charmap: this might take a while..." generate_locale `echo $charmap | sed -e s/SJIS/SHIFT_JIS/` $locale \ $locale.$charmap
sysdeps/generic/framestate.c +4 -0
@@ -41,7 +41,11 @@if (handle ==NULL || (frame_state_for = (framesf) __libc_dlsym (handle, "__frame_state_for")) == NULL) +#ifndef __USING_SJLJ_EXCEPTIONS__ frame_state_for = fallback_frame_state_for; +#else + frame_state_for = abort; +#endif }return frame_state_for (pc, frame_state);
sysdeps/generic/unwind-dw2.c +0 -2
@@ -39,7 +39,6 @@#endif -#ifndef __USING_SJLJ_EXCEPTIONS__#ifndef STACK_GROWS_DOWNWARD #define STACK_GROWS_DOWNWARD 0
@@ -1282,4 +1281,3 @@#include "unwind.inc" -#endif /* !USING_SJLJ_EXCEPTIONS */
sysdeps/hppa/Dist +1 -0
@@ -1,2 +1,3 @@ +libgcc-compat.c dl-symaddr.c dl-fptr.c
sysdeps/hppa/Makefile +11 -4
@@ -22,12 +22,19 @@ # CFLAGS-.os += -ffunction-sections LDFLAGS-c_pic.os += -Wl,--unique=.text* -ifeq ($(subdir),malloc) -CFLAGS-malloc.c += -DMALLOC_ALIGNMENT=16 -endif - ifeq ($(subdir),elf) CFLAGS-rtld.c += -mdisable-fpregs dl-routines += dl-symaddr dl-fptr rtld-routines += dl-symaddr dl-fptr endif + +ifeq ($(subdir),csu) +ifeq (yes,$(build-shared)) +# Compatibility +ifeq (yes,$(have-protected)) +CPPFLAGS-libgcc-compat.c = -DHAVE_DOT_HIDDEN +endif +sysdep_routines += libgcc-compat +shared-only-routines += libgcc-compat +endif +endif
sysdeps/hppa/Versions +5 -0
@@ -5,3 +5,8 @@ _dl_function_address; } } +libc { + GLIBC_2.2 { + __clz_tab; + } +}
sysdeps/hppa/atomicity.h +55 -0
55 lines not on this page · raw message
sysdeps/hppa/dl-fptr.c +6 -4
@@ -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;
sysdeps/hppa/dl-machine.h +117 -100
349 lines not on this page · raw message
sysdeps/hppa/elf/entry.h +10 -0
@@ -0,0 +1,10 @@ +#ifndef __ASSEMBLY__ +extern void _start (void ); +#endif + +/* The function's entry point is stored in the first word of the +function descriptor (plabel) of _start(). */ +#define ENTRY_POINT ({long int *tmp = (long int *)((long)_start & ~2); tmp[0];}) + +/* We have to provide a special declaration. */ +#define ENTRY_POINT_DECL (class) class void _start (void);
sysdeps/hppa/fpu/fclrexcpt.c +1 -1
@@ -29,7 +29,7 @@ __asm__ ("fstd %%fr0,0(%1)" :"=m" (*sw) :"r" (sw));/* Clear all the relevant bits. */ - sw[0 ] &= ~(excepts &FE_ALL_EXCEPT ) <<27 ; + sw[0 ] &= ~((excepts &FE_ALL_EXCEPT ) <<27 ); __asm__ ("fldd 0(%0),%%fr0" : :"r" (sw));/* Success. */
sysdeps/hppa/fpu/fegetenv.c +7 -6
@@ -23,11 +23,12 @@int fegetenv (fenv_t *envp) { - __asm__ ( -"fstd %%fr0,0(%2)\n" -"fstd,ma %%fr1,8(%2)\n" -"fstd,ma %%fr2,8(%2)\n" -"fstd %%fr3,0(%2)\n" - :"=m" (*envp),"=r" (envp) :"1" (envp)); +fenv_t *temp = envp; + __asm__ ("fstd,ma %%fr0,8(%1)\n" +"fstd,ma %%fr1,8(%1)\n" +"fstd,ma %%fr2,8(%1)\n" +"fstd %%fr3,0(%1)\n" + :"=m" (*temp),"+r" (temp) + );return 0 ; }
sysdeps/hppa/fpu/feholdexcpt.c +17 -24
53 lines not on this page · raw message
sysdeps/hppa/fpu/fesetenv.c +18 -22
@@ -26,24 +26,23 @@ fesetenv (const fenv_t *envp) {fenv_t temp; +fenv_t * _regs = &temp;/* Install the environment specified by ENVP. But there are a few values which we do not want to come from the saved environment. Therefore, we get the current environment and replace the values we want to use from the environment specified by the parameter. */ - { -fenv_t * _regs = &temp; - __asm__ ( -"fstd %%fr0,0(%2)\n" -"fstd,ma %%fr1,8(%2)\n" -"fstd,ma %%fr2,8(%2)\n" -"fstd %%fr3,0(%2)\n" - :"=m" (*_regs),"=r" (_regs) :"1" (_regs)); - } - temp.__status_word &= ~(FE_ALL_EXCEPT - | (FE_ALL_EXCEPT <<27 ) - |FE_DOWNWARD ); + __asm__ ("fstd,ma %%fr0,8(%1)\n" +"fstd,ma %%fr1,8(%1)\n" +"fstd,ma %%fr2,8(%1)\n" +"fstd %%fr3,0(%1)\n" + :"=m" (*_regs),"+r" (_regs) + ); + + temp.__status_word &= ~((FE_ALL_EXCEPT <<27 ) + |FE_DOWNWARD + |FE_ALL_EXCEPT );if (envp ==FE_DFL_ENV ) ;else if (envp ==FE_NOMASK_ENV )
@@ -55,16 +54,13 @@ | (FE_ALL_EXCEPT << 27)));/* Load the new environment. */ - { -fenv_t * _regs = &temp +1 ; - __asm__ ( -"fldd,mb -8(%2),%%fr3\n" -"fldd,mb -8(%2),%%fr2\n" -"fldd,mb -8(%2),%%fr1\n" -"fldd -8(%2),%%fr0\n" - :"=m" (*_regs),"=r" (_regs) :"1" (_regs)); - } - + __asm__ ("fldd,ma -8(%1),%%fr3\n" +"fldd,ma -8(%1),%%fr2\n" +"fldd,ma -8(%1),%%fr1\n" +"fldd 0(%2),%%fr0\n" + :"=m" (*_regs),"+r" (_regs) + ); +/* Success. */ return 0 ; }
sysdeps/hppa/fpu/feupdateenv.c +3 -5
@@ -27,14 +27,12 @@/* Get the current exception status. */ __asm__ ("fstd %%fr0,0(%1)" :"=m" (*sw) :"r" (sw)); - sw[0 ] &= (FE_ALL_EXCEPT <<27 ); - + sw[0 ] &=FE_ALL_EXCEPT ; + envp->__status_word = envp->__status_word | sw[0 ]; +/* Install new environment. */ fesetenv (envp); -/* Raise the saved exception. */ -feraiseexcept (sw[0 ] >>27 ); -/* Success. */ return 0 ; }
sysdeps/hppa/fpu/fraiseexcpt.c +41 -24
105 lines not on this page · raw message
sysdeps/hppa/fpu/fsetexcptflg.c +1 -2
@@ -29,8 +29,7 @@/* Get the current status word. */ __asm__ ("fstd %%fr0,0(%1)" :"=m" (*sw) :"r" (sw)); -/* Install the new exception flags bits. */ - sw[0 ] &= ~(excepts & (FE_ALL_EXCEPT >>27 )); +/* Clear exception flags, and install new neable trap bits */ sw[0 ] |= (*flagp & excepts &FE_ALL_EXCEPT ) <<27 ;/* Store the new status word. */
sysdeps/hppa/libgcc-compat.c +43 -0
43 lines not on this page · raw message
sysdeps/hppa/sysdep.h +1 -0
@@ -70,6 +70,7 @@#define PSEUDO_END (name) \ END (name) +#undef JUMPTARGET#define JUMPTARGET (name) name#define SYSCALL_PIC_SETUP /* Nothing. */
sysdeps/posix/getaddrinfo.c +1 -0
@@ -53,6 +53,7 @@#include <sys/utsname.h> #include <net/if.h> #include <nsswitch.h> +#include <stdbool.h> #define GAIH_OKIFUNSPEC 0x0100#define GAIH_EAI ~(GAIH_OKIFUNSPEC)
sysdeps/unix/Makefile +1 -0
@@ -295,6 +295,7 @@ $(..)sysdeps/unix/Makefile $(make-target-directory) (echo '#include <errno.h>'; \ + echo 'extern long int _no_syscall(void);'; \ echo 'long int _no_syscall (void)'; \ echo '{ __set_errno (ENOSYS); return -1L; }'; \ for call in $(unix-stub-syscalls); do \
sysdeps/unix/sysv/linux/hppa/clone.S +22 -3
@@ -28,6 +28,8 @@ /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */ +#warning CAO: __clone needs verification + .text ENTRY(__clone) /* FIXME: I have no idea how profiling works on hppa. */
@@ -42,6 +44,11 @@ stwm %arg0,64(%arg1) stw %arg3,-60(%arg1) + /* Save the PIC register. */ +#ifdef PIC + stw %r19,-32(%sr0, %sp) /* parent */ +#endif + /* Do the system call */ copy %arg2,%arg0 ble 0x100(%sr2,%r0)
@@ -53,19 +60,31 @@ comib,=,n 0,%ret0,thread_start - /* Successful return from the parent */ + /* Successful return from the parent + No need to restore the PIC register, + since we return immediately. */ + bv %r0(%rp) nop /* Something bad happened -- no child created */ .Lerror: + + /* Restore the PIC register on error */ +#ifdef PIC + ldw -32(%sr0, %sp), %r19 /* parent */ +#endif + b __syscall_error sub %r0,%ret0,%arg0 thread_start: + /* Load up the arguments. */ - ldw -60(%sp),%arg0 - ldw -64(%sp),%r22 + ldw -60(%sr0, %sp),%arg0 + ldw -64(%sr0, %sp),%r22 + + /* FIXME: Don't touch the childs PIC register? */ /* Call the user's function */ bl $$dyncall,%r31
sysdeps/unix/sysv/linux/hppa/kernel_stat.h +17 -17
@@ -1,30 +1,30 @@ -/* definition of "struct stat" from the kernel */ +/* Definition of 'struct stat' taken from kernel, please keep up to date */ struct kernel_stat { -unsigned long st_dev;/* dev_t is 32 bits on parisc */ -unsigned long st_ino;/* 32 bits */ +unsigned int st_dev;/* dev_t is 32 bits on parisc */ +unsigned int st_ino;/* 32 bits */ unsigned short st_mode;/* 16 bits */ unsigned short st_nlink;/* 16 bits */ unsigned short st_reserved1;/* old st_uid */ unsigned short st_reserved2;/* old st_gid */ -unsigned long st_rdev; -unsigned long st_size; +unsigned int st_rdev; +unsigned int st_size;struct timespec st_atim; -struct timespec st_mtim; -struct timespec st_ctim; -long st_blksize; -long st_blocks; -unsigned long __unused1;/* ACL stuff */ -unsigned long __unused2;/* network */ -unsigned long __unused3;/* network */ -unsigned long __unused4;/* cnodes */ +struct timespec st_mtim; +struct timespec st_ctim; +int st_blksize; +int st_blocks; +unsigned int __unused1;/* ACL stuff */ +unsigned int __unused2;/* network */ +unsigned int __unused3;/* network */ +unsigned int __unused4;/* cnodes */ unsigned short __unused5;/* netsite */ short st_fstype; -unsigned long st_realdev; +unsigned int st_realdev;unsigned short st_basemode;unsigned short st_spareshort; -unsigned long st_uid; -unsigned long st_gid; -unsigned long st_spare4[3 ]; +unsigned int st_uid; +unsigned int st_gid; +unsigned int st_spare4[3 ]; };#define _HAVE_STAT_NSEC
sysdeps/unix/sysv/linux/hppa/mmap.c +1 -1
@@ -37,7 +37,7 @@__ptr_t ret; - ret =INLINE_SYSCALL (mmap,6 , addr, len, prot, flags, fd, offset); + ret = (__ptr_t )INLINE_SYSCALL (mmap,6 , addr, len, prot, flags, fd, offset);/* check if it's really a negative number */ if (((unsigned long )ret &0xfffff000 ) ==0xfffff000 )
sysdeps/unix/sysv/linux/hppa/syscalls.list +1 -0
@@ -10,6 +10,7 @@ shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget semop - semop i:ipi __semop semop +semtimedop - semtimedop i:ipip semtimedop semget - semget i:iii __semget semget semctl - semctl i:iiii __semctl semctl
sysdeps/unix/sysv/linux/hppa/sysdep.c +28 -18
59 lines not on this page · raw message
sysdeps/unix/sysv/linux/hppa/sysdep.h +225 -49
341 lines not on this page · raw message
sysdeps/unix/sysv/linux/hppa/umount.c +1 -0
@@ -21,6 +21,7 @@does down here. */ extern long int __umount2 (const char *name,int flags); +extern long int __umount (const char * name);long int __umount (const char *name)
sysdeps/unix/sysv/linux/sys/sysctl.h +3 -1
@@ -24,7 +24,9 @@#include <stddef.h> /* Prevent more kernel headers than necessary to be included. */ #define _LINUX_KERNEL_H 1 -#define _LINUX_TYPES_H 1 +#ifndef _LINUX_TYPES_H +# define _LINUX_TYPES_H 1 +#endif #define _LINUX_LIST_H 1#include <linux/sysctl.h>
malloc/thread-m.h +22 -0
@@ -59,6 +59,28 @@ __libc_lock_define (typedef, mutex_t)#define mutex_unlock (m) \ __libc_maybe_call2 (pthread_mutex_unlock, (m), (*(int *)(m) = 0)) +# if (defined __hppa__) +/* Since our lock structure does not tolerate being initialized to zero, we must +modify the standard function calls made by malloc */ +# undef mutex_init +# undef mutex_lock +# undef mutex_trylock +# undef mutex_unlock +# define mutex_init (m) \ + __libc_maybe_call (__pthread_mutex_init, (m, NULL), \ + (((m)->__m_lock.__spinlock = __LT_SPINLOCK_INIT),(*(int *)(m))) ) +# define mutex_lock (m) \ + __libc_maybe_call (__pthread_mutex_lock, (m), \ + (__load_and_clear(&((m)->__m_lock.__spinlock)), 0)) +# define mutex_trylock (m) \ + __libc_maybe_call (__pthread_mutex_trylock, (m), \ + (*(int *)(m) ? 1 : (__load_and_clear(&((m)->__m_lock.__spinlock)), 0))) +# define mutex_unlock (m) \ + __libc_maybe_call (__pthread_mutex_unlock, (m), \ + (((m)->__m_lock.__spinlock = __LT_SPINLOCK_INIT), (*(int *)(m))) ) +# endif +/* if(defined __hppa__) */ +#else #define mutex_init (m) \
Quoted 5 lines · Carlos O'Donell
Please wait 2 days before doing the upload, I am in the process of getting other testers to make sure this release is of the highest quality possible. If the testers do not agree with the release quality I will request by email a delay of 2 more days to repatch and test, followed by an update to the list.
Requesting 2 more days.
- nscd is faulting on unaligned loads during real workload testing. = Remove unaligned handler and debug from core.
- Looking into mlockall failures.
Cheers,
Carlos.
Quoted 5 lines · Carlos O'Donell
Please wait 2 days before doing the upload, I am in the process of getting other testers to make sure this release is of the highest quality possible. If the testers do not agree with the release quality I will request by email a delay of 2 more days to repatch and test, followed by an update to the list.
Requesting 2 more days.
- nscd is faulting on unaligned loads during real workload testing. = Remove unaligned handler and debug from core.
- Looking into mlockall failures.
Cheers,
Carlos.
Quoted 11 lines · Carlos O'Donell
Quoted 5 lines · Carlos O'Donell
Please wait 2 days before doing the upload, I am in the process of getting other testers to make sure this release is of the highest quality possible. If the testers do not agree with the release quality I will request by email a delay of 2 more days to repatch and test, followed by an update to the list.
Requesting 2 more days.
- nscd is faulting on unaligned loads during real workload testing. = Remove unaligned handler and debug from core.
Fixed. Typo in syscall cancellation code. The corner case was a six arg syscall that used said typo'd code (recvfrom). This should really be the case to add threaded networking test code into libc's testsuite ;)
Quoted 1 line
- Looking into mlockall failures.
Passes QA on a 2.4 kernel (posix testsuite). 2.6 seems broken, though that is unrelated to glibc.
Will produce a new patch and new testing debs. Thanks go to all the testers that turned up these problems.
c.
Quoted 11 lines · Carlos O'Donell
Quoted 5 lines · Carlos O'Donell
Please wait 2 days before doing the upload, I am in the process of getting other testers to make sure this release is of the highest quality possible. If the testers do not agree with the release quality I will request by email a delay of 2 more days to repatch and test, followed by an update to the list.
Requesting 2 more days.
- nscd is faulting on unaligned loads during real workload testing. = Remove unaligned handler and debug from core.
Fixed. Typo in syscall cancellation code. The corner case was a six arg syscall that used said typo'd code (recvfrom). This should really be the case to add threaded networking test code into libc's testsuite ;)
Quoted 1 line
- Looking into mlockall failures.
Passes QA on a 2.4 kernel (posix testsuite). 2.6 seems broken, though that is unrelated to glibc.
Will produce a new patch and new testing debs. Thanks go to all the testers that turned up these problems.
c.
Quoted 2 lines · Carlos O'Donell
Will produce a new patch and new testing debs. Thanks go to all the testers that turned up these problems.
New debs fix reported problems:
a. Six argument syscall faiulres.
b. feraiseexcept(FE_INEXACT) doesn't raise FE_INEXACT excption.
New patch available at:
http://www.baldric.uwo.ca/~carlos/glibc232-hppa-full-2003-10-20.dpatch
Follow the instructions provided in the original email:
1. Remove all previous hppa patches.
2. Add this .dpatch as the only hppa patch.
Upload requested :) Lets make userspace churn...
Cheers,
Carlos.
Quoted 2 lines · Carlos O'Donell
Will produce a new patch and new testing debs. Thanks go to all the testers that turned up these problems.
New debs fix reported problems:
a. Six argument syscall faiulres.
b. feraiseexcept(FE_INEXACT) doesn't raise FE_INEXACT excption.
New patch available at:
http://www.baldric.uwo.ca/~carlos/glibc232-hppa-full-2003-10-20.dpatch
Follow the instructions provided in the original email:
1. Remove all previous hppa patches.
2. Add this .dpatch as the only hppa patch.
Upload requested :) Lets make userspace churn...
Cheers,
Carlos.
Hey Carlos - When submitting these upstream, will you consider adding test cases for these failures? feraiseexcept should certainly be tested somewhere. I don't know if there's a reasonable way to put in the test for the syscalls, though.
If you don't have time, that's fine too. I just like to encourage people to improve testsuites whenever they can. =)
Tks,
Jeff Bailey
Quoted 19 lines · Carlos O'Donell
Quoted 2 lines · Carlos O'Donell
Will produce a new patch and new testing debs. Thanks go to all the testers that turned up these problems.
New debs fix reported problems:
a. Six argument syscall faiulres.
b.feraiseexcept(FE_INEXACT)doesn't raiseFE_INEXACTexcption.New patch available at:
http://www.baldric.uwo.ca/~carlos/glibc232-hppa-full-2003-10-20.dpatchFollow the instructions provided in the original email:
1. Remove all previous hppa patches.
2. Add this .dpatch as the only hppa patch.Upload requested :) Lets make userspace churn...
Cheers,
Carlos.
Signature · 3 lines
In the United States, there isn't a government database that hasn't been misused by the very people entrusted with keeping its information safe. - Bruce Schneier
Hey Carlos - When submitting these upstream, will you consider adding test cases for these failures? feraiseexcept should certainly be tested somewhere. I don't know if there's a reasonable way to put in the test for the syscalls, though.
If you don't have time, that's fine too. I just like to encourage people to improve testsuites whenever they can. =)
Tks,
Jeff Bailey
Quoted 19 lines · Carlos O'Donell
Quoted 2 lines · Carlos O'Donell
Will produce a new patch and new testing debs. Thanks go to all the testers that turned up these problems.
New debs fix reported problems:
a. Six argument syscall faiulres.
b.feraiseexcept(FE_INEXACT)doesn't raiseFE_INEXACTexcption.New patch available at:
http://www.baldric.uwo.ca/~carlos/glibc232-hppa-full-2003-10-20.dpatchFollow the instructions provided in the original email:
1. Remove all previous hppa patches.
2. Add this .dpatch as the only hppa patch.Upload requested :) Lets make userspace churn...
Cheers,
Carlos.
Signature · 3 lines
In the United States, there isn't a government database that hasn't been misused by the very people entrusted with keeping its information safe. - Bruce Schneier
Quoted 4 lines · Jeff Bailey
Hey Carlos - When submitting these upstream, will you consider adding test cases for these failures? feraiseexcept should certainly be tested somewhere. I don't know if there's a reasonable way to put in the test for the syscalls, though.
o test-fenv (Already exists)
Quoted 2 lines
If you don't have time, that's fine too. I just like to encourage people to improve testsuites whenever they can. =)
o Requires adding threaded networking code.
= Might be a good thing to add!
c.
Quoted 4 lines · Jeff Bailey
Hey Carlos - When submitting these upstream, will you consider adding test cases for these failures? feraiseexcept should certainly be tested somewhere. I don't know if there's a reasonable way to put in the test for the syscalls, though.
o test-fenv (Already exists)
Quoted 2 lines
If you don't have time, that's fine too. I just like to encourage people to improve testsuites whenever they can. =)
o Requires adding threaded networking code.
= Might be a good thing to add!
c.