diff options
| -rw-r--r-- | include/signal.h | 6 | ||||
| -rw-r--r-- | libc/misc/internals/__uClibc_main.c | 7 | ||||
| -rw-r--r-- | libc/sysdeps/linux/common/longjmp.c | 4 | ||||
| -rw-r--r-- | libpthread/nptl/init.c | 1 | ||||
| -rw-r--r-- | libpthread/nptl/pthreadP.h | 16 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/generic/libc-tls.c | 1 | ||||
| -rw-r--r-- | libpthread/nptl/unwind.c | 3 | 
7 files changed, 34 insertions, 4 deletions
diff --git a/include/signal.h b/include/signal.h index 0a09c7ad4..80e4edee0 100644 --- a/include/signal.h +++ b/include/signal.h @@ -310,6 +310,9 @@ extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)     __THROW.  */  extern int sigwaitinfo (__const sigset_t *__restrict __set,  			siginfo_t *__restrict __info) __nonnull ((1)); +#ifdef _LIBC +extern __typeof(sigwaitinfo) __sigwaitinfo attribute_hidden; +#endif  libc_hidden_proto(sigwaitinfo)  /* Select any of pending signals from SET and place information in INFO. @@ -321,6 +324,9 @@ extern int sigtimedwait (__const sigset_t *__restrict __set,  			 siginfo_t *__restrict __info,  			 __const struct timespec *__restrict __timeout)       __nonnull ((1)); +#ifdef _LIBC +extern __typeof(sigtimedwait) __sigtimedwait attribute_hidden; +#endif  libc_hidden_proto(sigtimedwait)  /* Send signal SIG to the process PID.  Associate data in VAL with the diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 58f6643b2..da29ef69e 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -313,6 +313,11 @@ void __uClibc_fini(void)  }  libc_hidden_def(__uClibc_fini) +#ifndef SHARED +extern void __nptl_deallocate_tsd (void) __attribute ((weak)); +extern unsigned int __nptl_nthreads __attribute ((weak)); +#endif +  /* __uClibc_main is the new main stub for uClibc. This function is   * called from crt1 (version 0.9.28 or newer), after ALL shared libraries   * are initialized, just before we call the application's main function. @@ -481,7 +486,6 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,  # ifdef SHARED  		__libc_pthread_functions.ptr__nptl_deallocate_tsd ();  # else -		extern void __nptl_deallocate_tsd (void) __attribute ((weak));  		__nptl_deallocate_tsd ();  # endif @@ -491,7 +495,6 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,  # ifdef SHARED  		unsigned int *const ptr = __libc_pthread_functions.ptr_nthreads;  # else -		extern unsigned int __nptl_nthreads __attribute ((weak));  		unsigned int *const ptr = &__nptl_nthreads;  # endif diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index 4d1442414..b07eced6a 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -24,6 +24,10 @@  extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn;  libc_hidden_proto(__longjmp) +#if 0 +extern void _longjmp_unwind (jmp_buf env, int val); +#endif +  extern __typeof(longjmp) __libc_longjmp attribute_noreturn;  /* Set the signal mask to the one specified in ENV, and jump     to the position specified in ENV, causing the setjmp 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;  | 
