From 6a0aa4add30eecf76b9d14ad3f204e4017f9f22c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 9 Feb 2011 20:08:20 +0100 Subject: arm: mv nptl specific atomic impl to common place Thanks to Nitin Garg for notincing! Signed-off-by: Bernhard Reutner-Fischer --- .../nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h | 122 --------------------- 1 file changed, 122 deletions(-) delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h deleted file mode 100644 index 8f63e2510..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - - -typedef int8_t atomic8_t; -typedef uint8_t uatomic8_t; -typedef int_fast8_t atomic_fast8_t; -typedef uint_fast8_t uatomic_fast8_t; - -typedef int32_t atomic32_t; -typedef uint32_t uatomic32_t; -typedef int_fast32_t atomic_fast32_t; -typedef uint_fast32_t uatomic_fast32_t; - -typedef intptr_t atomicptr_t; -typedef uintptr_t uatomicptr_t; -typedef intmax_t atomic_max_t; -typedef uintmax_t uatomic_max_t; - -void __arm_link_error (void); - -#ifdef __thumb2__ -#define atomic_full_barrier() \ - __asm__ __volatile__ \ - ("movw\tip, #0x0fa0\n\t" \ - "movt\tip, #0xffff\n\t" \ - "blx\tip" \ - : : : "ip", "lr", "cc", "memory"); -#else -#define atomic_full_barrier() \ - __asm__ __volatile__ \ - ("mov\tip, #0xffff0fff\n\t" \ - "mov\tlr, pc\n\t" \ - "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)" \ - : : : "ip", "lr", "cc", "memory"); -#endif - -/* Atomic compare and exchange. This sequence relies on the kernel to - provide a compare and exchange operation which is atomic on the - current architecture, either via cleverness on pre-ARMv6 or via - ldrex / strex on ARMv6. */ - -#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - ({ __arm_link_error (); oldval; }) - -#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - ({ __arm_link_error (); oldval; }) - -/* It doesn't matter what register is used for a_oldval2, but we must - specify one to work around GCC PR rtl-optimization/21223. Otherwise - it may cause a_oldval or a_tmp to be moved to a different register. */ - -#ifdef __thumb2__ -/* Thumb-2 has ldrex/strex. However it does not have barrier instructions, - so we still need to use the kernel helper. */ -#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ register __typeof (oldval) a_oldval __asm__ ("r0"); \ - register __typeof (oldval) a_newval __asm__ ("r1") = (newval); \ - register __typeof (mem) a_ptr __asm__ ("r2") = (mem); \ - register __typeof (oldval) a_tmp __asm__ ("r3"); \ - register __typeof (oldval) a_oldval2 __asm__ ("r4") = (oldval); \ - __asm__ __volatile__ \ - ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \ - "cmp\t%[tmp], %[old2]\n\t" \ - "bne\t1f\n\t" \ - "mov\t%[old], %[old2]\n\t" \ - "movw\t%[tmp], #0x0fc0\n\t" \ - "movt\t%[tmp], #0xffff\n\t" \ - "blx\t%[tmp]\n\t" \ - "bcc\t0b\n\t" \ - "mov\t%[tmp], %[old2]\n\t" \ - "1:" \ - : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \ - : [new] "r" (a_newval), [ptr] "r" (a_ptr), \ - [old2] "r" (a_oldval2) \ - : "ip", "lr", "cc", "memory"); \ - a_tmp; }) -#else -#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ - ({ register __typeof (oldval) a_oldval __asm__ ("r0"); \ - register __typeof (oldval) a_newval __asm__ ("r1") = (newval); \ - register __typeof (mem) a_ptr __asm__ ("r2") = (mem); \ - register __typeof (oldval) a_tmp __asm__ ("r3"); \ - register __typeof (oldval) a_oldval2 __asm__ ("r4") = (oldval); \ - __asm__ __volatile__ \ - ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \ - "cmp\t%[tmp], %[old2]\n\t" \ - "bne\t1f\n\t" \ - "mov\t%[old], %[old2]\n\t" \ - "mov\t%[tmp], #0xffff0fff\n\t" \ - "mov\tlr, pc\n\t" \ - "add\tpc, %[tmp], #(0xffff0fc0 - 0xffff0fff)\n\t" \ - "bcc\t0b\n\t" \ - "mov\t%[tmp], %[old2]\n\t" \ - "1:" \ - : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \ - : [new] "r" (a_newval), [ptr] "r" (a_ptr), \ - [old2] "r" (a_oldval2) \ - : "ip", "lr", "cc", "memory"); \ - a_tmp; }) -#endif - -#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - ({ __arm_link_error (); oldval; }) -- cgit v1.2.3 From be88a80858ea4febcc621f87166fbf4c1753e513 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Mon, 7 Feb 2011 18:03:36 +0100 Subject: nptl:arm: add a wrapper for .cfi_sections pseudo-ops ARM disables by default the support for ASM CFI directives. Anyway using an old version of binutils that does not support some new pseudo-op, the build fails as below: AS libpthread/nptl/sysdeps/unix/sysv/linux/close.oS libpthread/nptl/sysdeps/unix/sysv/linux/close.S: Assembler messages: libpthread/nptl/sysdeps/unix/sysv/linux/close.S:9: Error: unknown pseudo-op: `.cfi_sections' The problem is that the .cfi_sections pseudo should be wrapped by a macro that expands to nothing when the CFI is off. Signed-off-by: Carmelo Amoroso CC: Khem Ray --- libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h | 2 +- libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h index 7ac9ca1e9..f0e5f6b37 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h @@ -36,7 +36,7 @@ .type __##syscall_name##_nocancel,%function; \ .globl __##syscall_name##_nocancel; \ __##syscall_name##_nocancel: \ - .cfi_sections .debug_frame; \ + cfi_sections(.debug_frame); \ cfi_startproc; \ DO_CALL (syscall_name, args); \ PSEUDO_RET; \ diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c index e35374d34..15250157c 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c @@ -65,7 +65,7 @@ __asm__ ( " .globl _Unwind_Resume\n" " .type _Unwind_Resume, %function\n" "_Unwind_Resume:\n" -" .cfi_sections .debug_frame\n" +" " CFI_SECTIONS (.debug_frame) "\n" " " CFI_STARTPROC "\n" " stmfd sp!, {r4, r5, r6, lr}\n" " " CFI_ADJUST_CFA_OFFSET (16)" \n" -- cgit v1.2.3 From 099b65127dd434846ca75d5fb11c2db303ed77a6 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:23:10 +0100 Subject: avoid warnings on _STACK_GROWS_* usage Signed-off-by: Peter S. Mazinger --- libpthread/nptl/allocatestack.c | 16 ++++++++-------- libpthread/nptl/pt-cleanup.c | 4 ++-- libpthread/nptl/unwind.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 1c549cee1..6a4e252e8 100644 --- a/libpthread/nptl/allocatestack.c +++ b/libpthread/nptl/allocatestack.c @@ -316,10 +316,10 @@ change_stack_perm (struct pthread *pd + (((((pd->stackblock_size - pd->guardsize) / 2) & pagemask) + pd->guardsize) & pagemask)); size_t len = pd->stackblock + pd->stackblock_size - stack; -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN void *stack = pd->stackblock + pd->guardsize; size_t len = pd->stackblock_size - pd->guardsize; -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP void *stack = pd->stackblock; size_t len = (uintptr_t) pd - pd->guardsize - (uintptr_t) pd->stackblock; #else @@ -591,9 +591,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, { #ifdef NEED_SEPARATE_REGISTER_STACK char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1); -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN char *guard = mem; -# elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1); #endif if (mprotect (guard, guardsize, PROT_NONE) != 0) @@ -641,11 +641,11 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, oldguard + pd->guardsize - guard - guardsize, prot) != 0) goto mprot_error; -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN if (mprotect ((char *) mem + guardsize, pd->guardsize - guardsize, prot) != 0) goto mprot_error; -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP if (mprotect ((char *) pd - pd->guardsize, pd->guardsize - guardsize, prot) != 0) goto mprot_error; @@ -688,9 +688,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, #ifdef NEED_SEPARATE_REGISTER_STACK *stack = pd->stackblock; *stacksize = stacktop - *stack; -#elif _STACK_GROWS_DOWN +#elif defined _STACK_GROWS_DOWN *stack = stacktop; -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP *stack = pd->stackblock; assert (*stack > 0); #endif diff --git a/libpthread/nptl/pt-cleanup.c b/libpthread/nptl/pt-cleanup.c index 97673b6c5..d7394ae44 100644 --- a/libpthread/nptl/pt-cleanup.c +++ b/libpthread/nptl/pt-cleanup.c @@ -39,13 +39,13 @@ __pthread_cleanup_upto (__jmp_buf target, char *targetframe) cbuf != NULL && _JMPBUF_UNWINDS_ADJ (target, cbuf, adj); cbuf = cbuf->__prev) { -#if _STACK_GROWS_DOWN +#ifdef _STACK_GROWS_DOWN if ((uintptr_t) cbuf - adj <= targetframe_adj) { cbuf = NULL; break; } -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP if ((uintptr_t) cbuf - adj >= targetframe_adj) { cbuf = NULL; diff --git a/libpthread/nptl/unwind.c b/libpthread/nptl/unwind.c index c7e01e764..0322a6023 100644 --- a/libpthread/nptl/unwind.c +++ b/libpthread/nptl/unwind.c @@ -30,7 +30,7 @@ #ifdef _STACK_GROWS_DOWN # define FRAME_LEFT(frame, other, adj) \ ((uintptr_t) frame - adj >= (uintptr_t) other - adj) -#elif _STACK_GROWS_UP +#elif defined _STACK_GROWS_UP # define FRAME_LEFT(frame, other, adj) \ ((uintptr_t) frame - adj <= (uintptr_t) other - adj) #else -- cgit v1.2.3 From de71e42c04a7d35cf663b1c84ac1de5b6b93b052 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:26:30 +0100 Subject: syntax fixes Avoid compile warnings about the use of undefined constants Signed-off-by: Peter S. Mazinger --- libpthread/nptl/allocatestack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 6a4e252e8..e30fe41a2 100644 --- a/libpthread/nptl/allocatestack.c +++ b/libpthread/nptl/allocatestack.c @@ -122,7 +122,7 @@ static uintptr_t in_flight_stack; list_t __stack_user __attribute__ ((nocommon)); hidden_data_def (__stack_user) -#if COLORING_INCREMENT != 0 +#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0 /* Number of threads created. */ static unsigned int nptl_ncreated; #endif @@ -443,7 +443,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, void *mem = 0; const int prot = (PROT_READ | PROT_WRITE); -#if COLORING_INCREMENT != 0 +#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0 /* Add one more page for stack coloring. Don't do it for stacks with 16 times pagesize or larger. This might just cause unnecessary misalignment. */ @@ -474,7 +474,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, adjust the allocated stack size if necessary. This way allocations directly following each other will not have aliasing problems. */ -#if MULTI_PAGE_ALIASING != 0 +#if defined MULTI_PAGE_ALIASING && MULTI_PAGE_ALIASING != 0 if ((size % MULTI_PAGE_ALIASING) == 0) size += pagesize_m1 + 1; #endif @@ -494,7 +494,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, So we can never get a null pointer back from mmap. */ assert (mem != NULL); -#if COLORING_INCREMENT != 0 +#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0 /* Atomically increment NCREATED. */ unsigned int ncreated = atomic_increment_val (&nptl_ncreated); -- cgit v1.2.3 From 1fc68eae4846de4a1e276e68aee743ef731f3e91 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:31:39 +0100 Subject: add missing prototypes Add some missing prototypes Signed-off-by: Peter S. Mazinger --- libpthread/nptl/sysdeps/generic/dl-tls.c | 2 ++ libpthread/nptl/sysdeps/generic/libc-tls.c | 1 + libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c | 1 + 3 files changed, 4 insertions(+) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/sysdeps/generic/dl-tls.c b/libpthread/nptl/sysdeps/generic/dl-tls.c index 4acfa4ba7..904da8b8d 100644 --- a/libpthread/nptl/sysdeps/generic/dl-tls.c +++ b/libpthread/nptl/sysdeps/generic/dl-tls.c @@ -66,6 +66,7 @@ oom (void) # endif +void *_dl_memalign(size_t alignment, size_t bytes); void *_dl_memalign(size_t alignment, size_t bytes) { return _dl_malloc(bytes); @@ -836,6 +837,7 @@ __tls_get_addr (GET_ADDR_ARGS) +void _dl_add_to_slotinfo (struct link_map *l); void _dl_add_to_slotinfo (struct link_map *l) { diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c index b78d96483..c45e76120 100644 --- a/libpthread/nptl/sysdeps/generic/libc-tls.c +++ b/libpthread/nptl/sysdeps/generic/libc-tls.c @@ -110,6 +110,7 @@ init_static_tls (size_t memsz, size_t align) GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx); } +void __libc_setup_tls (size_t tcbsize, size_t tcbalign); void __libc_setup_tls (size_t tcbsize, size_t tcbalign) { diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c index f2795510a..642198bad 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c @@ -25,6 +25,7 @@ extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe); #pragma weak __pthread_cleanup_upto +void _longjmp_unwind (jmp_buf env, int val); void _longjmp_unwind (jmp_buf env, int val) { -- cgit v1.2.3 From 380b5c5b31bdbf5e171ce035009e5e53b0ea230d Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:33:21 +0100 Subject: use common sigthread.h NPTL build did not use the correct bits/sigthread.h, use a common version avoiding this. Signed-off-by: Peter S. Mazinger --- libpthread/nptl/sysdeps/pthread/bits/sigthread.h | 44 ------------------------ 1 file changed, 44 deletions(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/sysdeps/pthread/bits/sigthread.h b/libpthread/nptl/sysdeps/pthread/bits/sigthread.h index 9a524e57d..e69de29bb 100644 --- a/libpthread/nptl/sysdeps/pthread/bits/sigthread.h +++ b/libpthread/nptl/sysdeps/pthread/bits/sigthread.h @@ -1,44 +0,0 @@ -/* Signal handling function for threaded programs. - Copyright (C) 1998, 1999, 2000, 2002, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_SIGTHREAD_H -#define _BITS_SIGTHREAD_H 1 - -#if !defined _SIGNAL_H && !defined _PTHREAD_H -# error "Never include this file directly. Use instead" -#endif - -/* Functions for handling signals. */ - -/* Modify the signal mask for the calling thread. The arguments have - the same meaning as for sigprocmask(2). */ -extern int pthread_sigmask (int __how, - __const __sigset_t *__restrict __newmask, - __sigset_t *__restrict __oldmask)__THROW; - -/* Send signal SIGNO to the given thread. */ -extern int pthread_kill (pthread_t __threadid, int __signo) __THROW; - -#ifdef __USE_GNU -/* Queue signal and data to a thread. */ -extern int pthread_sigqueue (pthread_t __threadid, int __signo, - const union sigval __value) __THROW; -#endif - -#endif /* bits/sigthread.h */ -- cgit v1.2.3 From f00e553e4b084007781df5e4b5accc2e152da231 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:41:29 +0100 Subject: add missing prototypes Add some missing prototypes Signed-off-by: Peter S. Mazinger --- libpthread/nptl/init.c | 1 + libpthread/nptl/pthreadP.h | 16 ++++++++++++++-- libpthread/nptl/sysdeps/generic/libc-tls.c | 1 + libpthread/nptl/unwind.c | 3 +++ 4 files changed, 19 insertions(+), 2 deletions(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c index 911293a65..c8ca09637 100644 --- a/libpthread/nptl/init.c +++ b/libpthread/nptl/init.c @@ -257,6 +257,7 @@ extern void **__libc_dl_error_tsd (void) __attribute__ ((const)); /* This can be set by the debugger before initialization is complete. */ static bool __nptl_initial_report_events __attribute_used__; +void __pthread_initialize_minimal_internal (void) attribute_hidden; void __pthread_initialize_minimal_internal (void) { diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h index fbac7d08f..fb354eaa3 100644 --- a/libpthread/nptl/pthreadP.h +++ b/libpthread/nptl/pthreadP.h @@ -179,7 +179,13 @@ extern struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]; hidden_proto (__pthread_keys) /* Number of threads running. */ -extern unsigned int __nptl_nthreads attribute_hidden; +extern unsigned int __nptl_nthreads +#ifdef SHARED + attribute_hidden +#else + __attribute ((weak)) +#endif + ; #ifndef __ASSUME_SET_ROBUST_LIST /* Negative if we do not have the system call and we can use it. */ @@ -563,7 +569,13 @@ extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, int execute); -extern void __nptl_deallocate_tsd (void) attribute_hidden; +extern void __nptl_deallocate_tsd (void) +#ifdef SHARED + attribute_hidden +#else + __attribute ((weak)) +#endif + ; extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden; diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c index c45e76120..e14fc26c6 100644 --- a/libpthread/nptl/sysdeps/generic/libc-tls.c +++ b/libpthread/nptl/sysdeps/generic/libc-tls.c @@ -242,6 +242,7 @@ _dl_tls_setup (void) return 0; } +extern void __pthread_initialize_minimal(void) __attribute__((weak)); /* This is the minimal initialization function used when libpthread is not used. */ diff --git a/libpthread/nptl/unwind.c b/libpthread/nptl/unwind.c index 0322a6023..8f60ae410 100644 --- a/libpthread/nptl/unwind.c +++ b/libpthread/nptl/unwind.c @@ -117,6 +117,9 @@ unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc) void attribute_protected __cleanup_fct_attribute __attribute ((noreturn)) +#if !defined SHARED && !defined IS_IN_LIBPTHREAD +weak_function +#endif __pthread_unwind (__pthread_unwind_buf_t *buf) { struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf; -- cgit v1.2.3 From 37525c04e45bb37bbc1532e11b5ab821a10f3cf4 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Fri, 4 Mar 2011 13:04:13 +0100 Subject: nptl: fix use of IS_IN_LIBPTHREAD macro IS_IN_LIBPTHREAD should be IS_IN_libpthread instead. Signed-off-by: Carmelo Amoroso --- libpthread/nptl/unwind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/unwind.c b/libpthread/nptl/unwind.c index 8f60ae410..671d70208 100644 --- a/libpthread/nptl/unwind.c +++ b/libpthread/nptl/unwind.c @@ -117,7 +117,7 @@ unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc) void attribute_protected __cleanup_fct_attribute __attribute ((noreturn)) -#if !defined SHARED && !defined IS_IN_LIBPTHREAD +#if !defined SHARED && !defined IS_IN_libpthread weak_function #endif __pthread_unwind (__pthread_unwind_buf_t *buf) -- cgit v1.2.3 From 526af41956be03b56e1bf33ec144e797256c1255 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 8 Mar 2011 02:12:11 -0600 Subject: nptl: fix compilation on x86_64 This commit gives us a fully functioning NPTL on x86-64 by using the GOTOFF macro as needed. Signed-off-by: William Pitcock Signed-off-by: Khem Raj --- libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S | 2 +- .../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S | 2 +- .../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S | 10 +--------- .../unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S | 2 +- .../unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S | 2 +- libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S | 2 +- 6 files changed, 6 insertions(+), 14 deletions(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S index f87532359..e59bdda44 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S @@ -163,7 +163,7 @@ __lll_timedlock_wait: cfi_startproc # ifndef __ASSUME_FUTEX_CLOCK_REALTIME # ifdef __PIC__ - cmpl $0, __have_futex_clock_realtime(%rip) + cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) # else cmpl $0, __have_futex_clock_realtime # endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S index 2eb8e29fa..5cc4256a5 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S @@ -118,7 +118,7 @@ __lll_robust_timedlock_wait: cfi_startproc # ifndef __ASSUME_FUTEX_CLOCK_REALTIME # ifdef __PIC__ - cmpl $0, __have_futex_clock_realtime(%rip) + cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) # else cmpl $0, __have_futex_clock_realtime # endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 3a965ad0b..645436f99 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -98,7 +98,7 @@ __pthread_cond_timedwait: 22: #ifndef __ASSUME_FUTEX_CLOCK_REALTIME # ifdef __PIC__ - cmpl $0, __have_futex_clock_realtime(%rip) + cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) # else cmpl $0, __have_futex_clock_realtime # endif @@ -437,14 +437,6 @@ __pthread_cond_timedwait: /* Only clocks 0 and 1 are allowed so far. Both are handled in the kernel. */ leaq 32(%rsp), %rsi -# ifdef SHARED - movq __vdso_clock_gettime@GOTPCREL(%rip), %rax - movq (%rax), %rax - PTR_DEMANGLE (%rax) - jz 26f - call *%rax - jmp 27f -# endif 26: movl $__NR_clock_gettime, %eax syscall 27: diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S index 3629ffbe5..15edd6149 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S @@ -96,7 +96,7 @@ pthread_rwlock_timedrdlock: 11: #ifndef __ASSUME_FUTEX_CLOCK_REALTIME # ifdef __PIC__ - cmpl $0, __have_futex_clock_realtime(%rip) + cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) # else cmpl $0, __have_futex_clock_realtime # endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S index 23e1ee155..3c4a27912 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S @@ -93,7 +93,7 @@ pthread_rwlock_timedwrlock: 11: #ifndef __ASSUME_FUTEX_CLOCK_REALTIME # ifdef __PIC__ - cmpl $0, __have_futex_clock_realtime(%rip) + cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) # else cmpl $0, __have_futex_clock_realtime # endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S index 704a2223a..3ff34120c 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S @@ -61,7 +61,7 @@ sem_timedwait: #ifndef __ASSUME_FUTEX_CLOCK_REALTIME # ifdef __PIC__ - cmpl $0, __have_futex_clock_realtime(%rip) + cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) # else cmpl $0, __have_futex_clock_realtime # endif -- cgit v1.2.3 From 1dd9275091d6cbb14d6b149770fc90cef53577cf Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 9 Mar 2011 13:32:30 +0100 Subject: remove trailing ';' from _syscallX() Signed-off-by: Peter S. Mazinger --- libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c index 08710f1c8..79faf54bf 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-gettimeofday.c @@ -2,4 +2,4 @@ #include int gettimeofday (struct timeval *, struct timezone *) attribute_hidden; -_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz); +_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz) -- cgit v1.2.3