diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-08-09 05:55:16 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-08-09 05:55:16 +0000 |
commit | 3dfe29ec75a1adfe9f05e8437ff8b67f309d4acd (patch) | |
tree | 2f6590386d1c091a8ee72cce290c0798f82f974c | |
parent | 75f9a2b1874f3c50727c6b91fd5b5735a2a5deb3 (diff) | |
download | uClibc-alpine-3dfe29ec75a1adfe9f05e8437ff8b67f309d4acd.tar.bz2 uClibc-alpine-3dfe29ec75a1adfe9f05e8437ff8b67f309d4acd.tar.xz |
Compile cleanups for NPTL support.
-rw-r--r-- | libc/stdlib/malloc-standard/Makefile | 7 | ||||
-rw-r--r-- | libc/stdlib/malloc-standard/thread-freeres.c | 11 | ||||
-rw-r--r-- | libc/sysdeps/linux/mips/__syscall_error.c | 4 | ||||
-rw-r--r-- | libpthread/nptl/compat/libc-symbols.h | 12 | ||||
-rw-r--r-- | libpthread/nptl/forward.c | 2 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c | 5 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/libc-lowlevellock.c | 21 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/pt-fork.c | 3 |
8 files changed, 56 insertions, 9 deletions
diff --git a/libc/stdlib/malloc-standard/Makefile b/libc/stdlib/malloc-standard/Makefile index b5f53f2bf..28f67b058 100644 --- a/libc/stdlib/malloc-standard/Makefile +++ b/libc/stdlib/malloc-standard/Makefile @@ -32,10 +32,9 @@ endif # calloc.c can be found at uClibc/libc/stdlib/calloc.c # valloc.c can be found at uClibc/libc/stdlib/valloc.c CSRC=malloc.c calloc.c realloc.c free.c memalign.c mallopt.c mallinfo.c -#ifeq ($(PTHREADS_NATIVE),y) -#CSRC+=thread-freeres.c -#CFLAGS += -I$(TOPDIR)/libpthread/nptl/compat -#endif +ifeq ($(PTHREADS_NATIVE),y) +CSRC += thread-freeres.c +endif COBJS=$(patsubst %.c,%.o, $(CSRC)) OBJS=$(COBJS) diff --git a/libc/stdlib/malloc-standard/thread-freeres.c b/libc/stdlib/malloc-standard/thread-freeres.c index 37cd234ed..f61b38b4a 100644 --- a/libc/stdlib/malloc-standard/thread-freeres.c +++ b/libc/stdlib/malloc-standard/thread-freeres.c @@ -42,8 +42,19 @@ do { \ DEFINE_HOOK (__libc_thread_subfreeres, (void)); +/* + * This needs a lot of work. + */ +#if 0 void __attribute__ ((section ("__libc_thread_freeres_fn"))) __libc_thread_freeres (void) { RUN_HOOK (__libc_thread_subfreeres, ()); } +#else +void +__libc_thread_freeres (void) +{ + return; +} +#endif diff --git a/libc/sysdeps/linux/mips/__syscall_error.c b/libc/sysdeps/linux/mips/__syscall_error.c index de65a1f39..05dcacc8b 100644 --- a/libc/sysdeps/linux/mips/__syscall_error.c +++ b/libc/sysdeps/linux/mips/__syscall_error.c @@ -22,7 +22,11 @@ /* This routine is jumped to by all the syscall handlers, to stash * an error number into errno. */ +#ifdef __PTHREADS_NATIVE__ +int __syscall_error(int err_no) +#else int attribute_hidden __syscall_error(int err_no) +#endif { __set_errno(err_no); return -1; diff --git a/libpthread/nptl/compat/libc-symbols.h b/libpthread/nptl/compat/libc-symbols.h index 777cafb3e..0dfb5a565 100644 --- a/libpthread/nptl/compat/libc-symbols.h +++ b/libpthread/nptl/compat/libc-symbols.h @@ -201,4 +201,16 @@ /* This should not appear outside `#if SHLIB_COMPAT (...)'. */ # define compat_symbol(lib, local, symbol, version) ... +/* Move compatibility symbols out of the way by placing them all in a + * special section. */ +#ifndef __ASSEMBLER__ +# define attribute_compat_text_section \ + __attribute__ ((section (".text.compat"))) +# define attribute_compat_data_section \ + __attribute__ ((section (".data.compat"))) +#else +# define compat_text_section .section ".text.compat", "ax"; +# define compat_data_section .section ".data.compat", "aw"; +#endif + #endif /* _LIBC_SYMBOLS_H */ diff --git a/libpthread/nptl/forward.c b/libpthread/nptl/forward.c index e3b8a4f23..e5f93d475 100644 --- a/libpthread/nptl/forward.c +++ b/libpthread/nptl/forward.c @@ -191,7 +191,6 @@ FORWARD (pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) -#ifndef __UCLIBC__ #define return /* value is void */ FORWARD2(__pthread_unwind, void attribute_hidden __attribute ((noreturn)) __cleanup_fct_attribute @@ -202,4 +201,3 @@ FORWARD2(__pthread_unwind, INTERNAL_SYSCALL (kill, err, 1, SIGKILL); }) #undef return -#endif diff --git a/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c index b0f848708..1c5bb1947 100644 --- a/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c +++ b/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c @@ -22,6 +22,11 @@ #include <unwind.h> #include <pthreadP.h> +#ifdef __UCLIBC__ +#define __libc_dlopen(x) dlopen(x, (RTLD_LOCAL | RTLD_LAZY)) +#define __libc_dlsym dlsym +#endif + static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); static _Unwind_Reason_Code (*libgcc_s_personality) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/libc-lowlevellock.c b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/libc-lowlevellock.c new file mode 100644 index 000000000..3a5c1cde2 --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/libc-lowlevellock.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. + + 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. */ + +/* No difference to lowlevellock.c, except we lose a couple of functions. */ +#include "../lowlevellock.c" diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-fork.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-fork.c index 8569ef0bf..f57f0dfa3 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-fork.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-fork.c @@ -18,9 +18,6 @@ 02111-1307 USA. */ #include <unistd.h> -#ifdef __UCLIBC__ -extern pid_t __libc_fork(void); -#endif pid_t __fork (void) |