summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-02 02:11:44 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-02 02:11:44 +0000
commit76e3f1c91e7cc21260b08adb60c974fa6515ce52 (patch)
treecc067b62989d94feedd81d74cde596d643ff01c1
parent61257ecf3c60e69e38c2d28fc23040735f2e35b1 (diff)
downloaduClibc-alpine-76e3f1c91e7cc21260b08adb60c974fa6515ce52.tar.bz2
uClibc-alpine-76e3f1c91e7cc21260b08adb60c974fa6515ce52.tar.xz
Final set of changes for NPTL and new build system. NPTL can now build with the new build system.
-rw-r--r--libpthread/nptl/Makefile343
-rw-r--r--libpthread/nptl/allocatestack.c3
-rw-r--r--libpthread/nptl/descr.h1
-rw-r--r--libpthread/nptl/init.c2
-rw-r--r--libpthread/nptl/sem_open.c6
-rw-r--r--libpthread/nptl/sem_unlink.c2
-rw-r--r--libpthread/nptl/sysdeps/alpha/tls.h2
-rw-r--r--libpthread/nptl/sysdeps/i386/tls.h1
-rw-r--r--libpthread/nptl/sysdeps/mips/Makefile89
-rw-r--r--libpthread/nptl/sysdeps/mips/tls.h21
-rw-r--r--libpthread/nptl/sysdeps/powerpc/tls.h2
-rw-r--r--libpthread/nptl/sysdeps/pthread/Makefile113
-rw-r--r--libpthread/nptl/sysdeps/sh/tls.h2
-rw-r--r--libpthread/nptl/sysdeps/sparc/tls.h1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/Makefile123
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile113
-rw-r--r--libpthread/nptl_db/Makefile.in67
18 files changed, 120 insertions, 772 deletions
diff --git a/libpthread/nptl/Makefile b/libpthread/nptl/Makefile
index 5f5864304..f9100219a 100644
--- a/libpthread/nptl/Makefile
+++ b/libpthread/nptl/Makefile
@@ -1,338 +1,13 @@
-# Makefile for uClibc's native pthread library (Portions stolen from glibc.)
-#
-# Copyright (C) 2005 Steven J. Hill <sjhill@realitydiluted.com>
-#
-# 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.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Makefile for uClibc
-
-TOPDIR=../../
-include $(TOPDIR)Rules.mak
-include Rules.mak
-
-routines = alloca_cutoff forward libc-lowlevellock libc-cancellation
-shared-only-routines = forward
-
-libpthread-routines = init vars events version \
- pthread_create pthread_exit pthread_detach \
- pthread_join pthread_tryjoin pthread_timedjoin \
- pthread_self pthread_equal pthread_yield \
- pthread_getconcurrency pthread_setconcurrency \
- pthread_getschedparam pthread_setschedparam \
- pthread_setschedprio \
- pthread_attr_init pthread_attr_destroy \
- pthread_attr_getdetachstate pthread_attr_setdetachstate \
- pthread_attr_getguardsize pthread_attr_setguardsize \
- pthread_attr_getschedparam pthread_attr_setschedparam \
- pthread_attr_getschedpolicy pthread_attr_setschedpolicy \
- pthread_attr_getinheritsched \
- pthread_attr_setinheritsched \
- pthread_attr_getscope pthread_attr_setscope \
- pthread_attr_getstackaddr pthread_attr_setstackaddr \
- pthread_attr_getstacksize pthread_attr_setstacksize \
- pthread_attr_getstack pthread_attr_setstack \
- pthread_getattr_np \
- pthread_mutex_init pthread_mutex_destroy \
- pthread_mutex_lock pthread_mutex_trylock \
- pthread_mutex_timedlock pthread_mutex_unlock \
- pthread_mutexattr_init pthread_mutexattr_destroy \
- pthread_mutexattr_getpshared \
- pthread_mutexattr_setpshared \
- pthread_mutexattr_gettype pthread_mutexattr_settype \
- pthread_rwlock_init pthread_rwlock_destroy \
- pthread_rwlock_rdlock pthread_rwlock_timedrdlock \
- pthread_rwlock_wrlock pthread_rwlock_timedwrlock \
- pthread_rwlock_tryrdlock pthread_rwlock_trywrlock \
- pthread_rwlock_unlock \
- pthread_rwlockattr_init pthread_rwlockattr_destroy \
- pthread_rwlockattr_getpshared \
- pthread_rwlockattr_setpshared \
- pthread_rwlockattr_getkind_np \
- pthread_rwlockattr_setkind_np \
- pthread_cond_init pthread_cond_destroy \
- pthread_cond_wait pthread_cond_timedwait \
- pthread_cond_signal pthread_cond_broadcast \
- old_pthread_cond_init old_pthread_cond_destroy \
- old_pthread_cond_wait old_pthread_cond_timedwait \
- old_pthread_cond_signal old_pthread_cond_broadcast \
- pthread_condattr_init pthread_condattr_destroy \
- pthread_condattr_getpshared pthread_condattr_setpshared \
- pthread_condattr_getclock pthread_condattr_setclock \
- pthread_spin_init pthread_spin_destroy \
- pthread_spin_lock pthread_spin_trylock \
- pthread_spin_unlock \
- pthread_barrier_init pthread_barrier_destroy \
- pthread_barrier_wait \
- pthread_barrierattr_init pthread_barrierattr_destroy \
- pthread_barrierattr_getpshared \
- pthread_barrierattr_setpshared \
- pthread_key_create pthread_key_delete \
- pthread_getspecific pthread_setspecific \
- pthread_sigmask pthread_kill \
- pthread_cancel pthread_testcancel \
- pthread_setcancelstate pthread_setcanceltype \
- pthread_once \
- old_pthread_atfork pthread_atfork \
- pthread_getcpuclockid \
- pthread_clock_gettime pthread_clock_settime \
- sem_init sem_destroy \
- sem_open sem_close sem_unlink \
- sem_getvalue \
- sem_wait sem_trywait sem_timedwait sem_post \
- cleanup cleanup_defer cleanup_compat \
- cleanup_defer_compat unwind \
- pt-longjmp pt-cleanup\
- cancellation \
- lowlevellock \
- pt-vfork \
- ptw-write ptw-read ptw-close ptw-fcntl ptw-accept \
- ptw-connect ptw-recv ptw-recvfrom ptw-recvmsg ptw-send \
- ptw-sendmsg ptw-sendto ptw-fsync ptw-lseek ptw-llseek \
- ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
- ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
- ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
- ptw-sigwait \
- pt-raise pt-system \
- flockfile ftrylockfile funlockfile \
- sigaction \
- herrno res pt-allocrtsig \
- pthread_kill_other_threads \
- pthread_getaffinity pthread_setaffinity \
- pthread_attr_getaffinity pthread_attr_setaffinity \
- cleanup_routine unwind-forcedunwind
-
-libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind
-libpthread-static-only-routines = pthread_atfork
-
-CFLAGS-pthread_atfork.c = -DNOT_IN_libc
-
-# Since cancellation handling is in large parts handled using exceptions
-# we have to compile some files with exception handling enabled, some
-# even with asynchronous unwind tables.
-
-# init.c contains sigcancel_handler().
-CFLAGS-init.c = -fexceptions -fasynchronous-unwind-tables
-# The unwind code itself,
-CFLAGS-unwind.c = -fexceptions
-CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables
-
-# The following three functions must be async-cancel safe.
-CFLAGS-pthread_cancel.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_setcancelstate.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_setcanceltype.c = -fexceptions -fasynchronous-unwind-tables
-
-# These are internal functions which similar functionality as setcancelstate
-# and setcanceltype.
-CFLAGS-cancellation.c = -fasynchronous-unwind-tables
-CFLAGS-libc-cancellation.c = -fasynchronous-unwind-tables
-
-# Calling pthread_exit() must cause the registered cancel handlers to
-# be executed. Therefore exceptions have to be thrown through this
-# function.
-CFLAGS-pthread_exit.c = -fexceptions
-
-# Among others, __pthread_unwind is forwarded. This function must handle
-# exceptions.
-CFLAGS-forward.c = -fexceptions
-
-# The following are cancellation points. Some of the functions can
-# block and therefore temporarily enable asynchronous cancellation.
-# Those must be compiled asynchronous unwind tables.
-CFLAGS-pthread_testcancel.c = -fexceptions
-CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \
- -fasynchronous-unwind-tables
-CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sem_timedwait.c = -fexceptions -fasynchronous-unwind-tables
-
-# These are the function wrappers we have to duplicate here.
-CFLAGS-fcntl.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf.c = -fexceptions
-CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-waitpid.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sigwait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msgrcv.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
-
-CFLAGS-pt-system.c = -fexceptions
-
#
-# The rest of this file is uClibc specific.
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-pthread_barrier_init.c = -D_GNU_SOURCE
-CFLAGS-pthread_barrier_destroy.c = -D_GNU_SOURCE
-CFLAGS-pthread_barrierattr_init.c = -D_GNU_SOURCE
-CFLAGS-pthread_barrierattr_destroy.c = -D_GNU_SOURCE
-CFLAGS-pthread_barrierattr_getpshared.c = -D_GNU_SOURCE
-CFLAGS-pthread_barrierattr_setpshared.c = -D_GNU_SOURCE
-CFLAGS-sem_open.c = -D_GNU_SOURCE
-
-libpthread-os-routines = pthread_yield
-libpthread-misc-routines = pthread_rwlock_rdlock pthread_rwlock_timedrdlock \
- pthread_rwlock_wrlock pthread_rwlock_timedwrlock \
- pthread_rwlock_unlock pthread_cond_wait \
- pthread_cond_timedwait pthread_cond_signal \
- pthread_cond_broadcast pthread_spin_init \
- pthread_spin_destroy pthread_spin_lock \
- pthread_spin_trylock pthread_spin_unlock \
- pthread_barrier_wait pthread_sigmask \
- pthread_kill pthread_once \
- pthread_getcpuclockid sem_wait \
- sem_trywait sem_timedwait \
- sem_post pt-longjmp \
- lowlevellock pt-vfork \
- ptw-close ptw-read ptw-write \
- ptw-fcntl ptw-accept ptw-connect \
- ptw-recv ptw-recvfrom ptw-recvmsg \
- ptw-send ptw-sendmsg ptw-sendto \
- ptw-fsync ptw-lseek ptw-llseek \
- ptw-msync ptw-nanosleep ptw-open \
- ptw-open64 ptw-pause ptw-pread \
- ptw-pread64 ptw-pwrite ptw-pwrite64 \
- ptw-tcdrain ptw-wait ptw-waitpid \
- ptw-msgrcv ptw-msgsnd ptw-sigwait \
- pt-raise flockfile ftrylockfile \
- funlockfile sigaction \
- pthread_getaffinity \
- pthread_setaffinity \
- pthread_attr_getaffinity \
- pthread_attr_setaffinity \
- unwind-forcedunwind
-
-DIRS := sysdeps/pthread sysdeps/$(TARGET_ARCH) sysdeps/unix/sysv/linux \
- sysdeps/unix/sysv/linux/$(TARGET_ARCH)
-
-AR_LIBP_CSRC = $(patsubst %, %.c, $(filter-out $(libpthread-os-routines) \
- $(libpthread-misc-routines) \
- $(libpthread-shared-only-routines), \
- $(libpthread-routines)))
-SO_LIBP_CSRC = $(patsubst %, %.c, $(filter-out $(libpthread-os-routines) \
- $(libpthread-misc-routines) \
- $(libpthread-static-only-routines), $(libpthread-routines)))
-AR_LIBC_CSRC = $(patsubst %, %.c, $(filter-out $(shared-only-routines) \
- libc-lowlevellock, $(routines)))
-SO_LIBC_CSRC = $(patsubst %, %.c, $(filter-out libc-lowlevellock, $(routines)))
-
-AR_LIBP_COBJS = $(patsubst %.c, %.o, $(AR_LIBP_CSRC))
-SO_LIBP_COBJS = $(patsubst %.c, %.os, $(SO_LIBP_CSRC))
-AR_LIBC_COBJS = $(patsubst %.c, %.o, $(AR_LIBC_CSRC))
-SO_LIBC_COBJS = $(patsubst %.c, %.os, $(SO_LIBC_CSRC))
-
-ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
-SHARED_START_FILES = sysdeps/pthread/crti.o $(LIBGCC_DIR)crtbeginS.o
-SHARED_END_FILES = $(LIBGCC_DIR)crtendS.o sysdeps/pthread/crtn.o
-endif
-
-all: headers $(AR_LIB_NAME) $(SO_LIB_NAME)
-
-headers: version.h banner.h
-
-version.h:
- @echo "#define VERSION \""$(VERSION)"\"" > $@
-
-banner.h: Banner
- sed 's/\(.*\)/"\1\\n"/' $< > $@
-
-$(AR_LIB_NAME): $(AR_LIBP_COBJS)
- $(INSTALL) -d $(TOPDIR)lib
- $(RM) $(AR_LIB_NAME)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(AR_LIBP_COBJS)
-
-$(AR_SO_LIB_NAME): $(SO_LIBP_COBJS)
- $(INSTALL) -d $(TOPDIR)lib
- $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) \
- $(SO_LIB_NAME) $(AR_SO_LIB_NAME)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(SO_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(SO_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_SO_LIB_NAME) $(SO_LIBP_COBJS)
-
-$(SO_LIB_NAME): $(AR_SO_LIB_NAME) subdirs
- $(LD) $(LDFLAGS_NOSTRIP) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \
- -o $(TOPDIR)lib/$(SO_FULL_NAME) $(SHARED_START_FILES) --whole-archive $(AR_SO_LIB_NAME) \
- --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
- -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) \
- $(TOPDIR)lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
- -L$(TOPDIR)ldso/libdl -ldl \
- $(SHARED_END_FILES)
- $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION)
- $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME)
-
-obj.pthread.ar: $(AR_LIBC_COBJS)
- $(RM) $(TOPDIR)libc/$@
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBC_COBJS)
-endif
- @for objfile in $(AR_LIBC_COBJS); do \
- echo ../libpthread/nptl/$$objfile >> $(TOPDIR)libc/$@; \
- done
- $(MAKE) -C sysdeps/$(TARGET_ARCH) $@
- $(MAKE) -C sysdeps/unix/sysv/linux $@
- $(MAKE) -C sysdeps/unix/sysv/linux/$(TARGET_ARCH) $@
-
-obj.pthread.so: $(SO_LIBC_COBJS)
- $(RM) $(TOPDIR)libc/$@
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(SO_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(SO_LIBC_COBJS)
-endif
- @for objfile in $(SO_LIBC_COBJS); do \
- echo ../libpthread/nptl/$$objfile >> $(TOPDIR)libc/$@; \
- done
- $(MAKE) -C sysdeps/unix/sysv/linux $@
- $(MAKE) -C sysdeps/unix/sysv/linux/$(TARGET_ARCH) $@
-
-$(AR_LIBP_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -c $< -o $@
-
-$(SO_LIBP_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
-
-$(AR_LIBC_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -c $< -o $@
-
-$(SO_LIBC_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -DSHARED -c $< -o $@
-
-clean: subdirs_clean
- $(RM) *.o *.os *~ core banner.h version.h
-
-subdirs: $(patsubst %, _dir_%, $(DIRS))
-subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
-
-$(patsubst %, _dir_%, $(DIRS)):
- $(MAKE) -C $(patsubst _dir_%, %, $@)
-
-$(patsubst %, _dirclean_%, $(DIRS)):
- $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
-.PHONY: dummy
+top_srcdir=../../
+top_builddir=../../
+include $(top_builddir)Rules.mak
+all: libs
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c
index a228d090e..969c569a9 100644
--- a/libpthread/nptl/allocatestack.c
+++ b/libpthread/nptl/allocatestack.c
@@ -25,7 +25,6 @@
#include <unistd.h>
#include <sys/mman.h>
#include <sys/param.h>
-#include <dl-sysdep.h>
#include <tls.h>
#include <lowlevellock.h>
#include <link.h>
@@ -936,7 +935,7 @@ init_one_static_tls (struct pthread *curp, struct link_map *map)
dtv[map->l_tls_modid].pointer.is_static = true;
/* Initialize the memory. */
- memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
+ memset (mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
'\0', map->l_tls_blocksize - map->l_tls_initimage_size);
}
diff --git a/libpthread/nptl/descr.h b/libpthread/nptl/descr.h
index 77251d5e4..474fa9caa 100644
--- a/libpthread/nptl/descr.h
+++ b/libpthread/nptl/descr.h
@@ -29,7 +29,6 @@
#include <list.h>
#include <lowlevellock.h>
#include <pthreaddef.h>
-#include <dl-sysdep.h>
#include "../nptl_db/thread_db.h"
#include <tls.h>
#ifdef HAVE_FORCED_UNWIND
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index ab48fa7b8..6d1ead43b 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -296,7 +296,7 @@ __pthread_initialize_minimal_internal (void)
else
{
/* Round the resource limit up to page size. */
- const uintptr_t pagesz = __sysconf (_SC_PAGESIZE);
+ const uintptr_t pagesz = sysconf (_SC_PAGESIZE);
__default_stacksize = (limit.rlim_cur + pagesz - 1) & -pagesz;
}
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
index e388d99de..3cdf76479 100644
--- a/libpthread/nptl/sem_open.c
+++ b/libpthread/nptl/sem_open.c
@@ -117,7 +117,7 @@ __where_is_shmfs (void)
mountpoint.dir = (char *) malloc (namelen + 4 + 2);
if (mountpoint.dir != NULL)
{
- char *cp = __mempcpy (mountpoint.dir, mp->mnt_dir, namelen);
+ char *cp = mempcpy (mountpoint.dir, mp->mnt_dir, namelen);
if (cp[-1] != '/')
*cp++ = '/';
cp = stpcpy (cp, "sem.");
@@ -264,7 +264,7 @@ sem_open (const char *name, int oflag, ...)
/* Create the name of the final file. */
finalname = (char *) alloca (mountpoint.dirlen + namelen);
- __mempcpy (__mempcpy (finalname, mountpoint.dir, mountpoint.dirlen),
+ mempcpy (mempcpy (finalname, mountpoint.dir, mountpoint.dirlen),
name, namelen);
/* If the semaphore object has to exist simply open it. */
@@ -321,7 +321,7 @@ sem_open (const char *name, int oflag, ...)
sizeof (sem_t) - sizeof (struct sem));
tmpfname = (char *) alloca (mountpoint.dirlen + 6 + 1);
- char *xxxxxx = __mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen);
+ char *xxxxxx = mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen);
int retries = 0;
#define NRETRIES 50
diff --git a/libpthread/nptl/sem_unlink.c b/libpthread/nptl/sem_unlink.c
index 17074774d..7ec6663a0 100644
--- a/libpthread/nptl/sem_unlink.c
+++ b/libpthread/nptl/sem_unlink.c
@@ -56,7 +56,7 @@ sem_unlink (name)
/* Create the name of the file. */
fname = (char *) alloca (mountpoint.dirlen + namelen + 1);
- __mempcpy (__mempcpy (fname, mountpoint.dir, mountpoint.dirlen),
+ mempcpy (mempcpy (fname, mountpoint.dir, mountpoint.dirlen),
name, namelen + 1);
/* Now try removing it. */
diff --git a/libpthread/nptl/sysdeps/alpha/tls.h b/libpthread/nptl/sysdeps/alpha/tls.h
index fa3c832a6..99cd27a03 100644
--- a/libpthread/nptl/sysdeps/alpha/tls.h
+++ b/libpthread/nptl/sysdeps/alpha/tls.h
@@ -20,8 +20,6 @@
#ifndef _TLS_H
#define _TLS_H 1
-# include <dl-sysdep.h>
-
#ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h>
diff --git a/libpthread/nptl/sysdeps/i386/tls.h b/libpthread/nptl/sysdeps/i386/tls.h
index 65566ff7a..ac6084879 100644
--- a/libpthread/nptl/sysdeps/i386/tls.h
+++ b/libpthread/nptl/sysdeps/i386/tls.h
@@ -20,7 +20,6 @@
#ifndef _TLS_H
#define _TLS_H 1
-#include <dl-sysdep.h>
#ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h>
diff --git a/libpthread/nptl/sysdeps/mips/Makefile b/libpthread/nptl/sysdeps/mips/Makefile
index 851d3b841..6371d2871 100644
--- a/libpthread/nptl/sysdeps/mips/Makefile
+++ b/libpthread/nptl/sysdeps/mips/Makefile
@@ -1,84 +1,13 @@
-# Makefile for uClibc NPTL pthread library (MIPS)
+# Makefile for uClibc NPTL
#
-# Copyright (C) 2005 Steven J. Hill <sjhill@realitydiluted.com>
+# Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
#
-# 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.
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# 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.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# Makefile for uClibc
-
-TOPDIR=../../../../
-include $(TOPDIR)Rules.mak
-include ../../Rules.mak
-
-CFLAGS-dl-support.c = -D_GNU_SOURCE
-
-AR_LIBP_AOBJS = $(patsubst %.S, %.o, $(wildcard *.S))
-SO_LIBP_AOBJS = $(patsubst %.S, %.os, $(wildcard *.S))
-AR_LIBP_COBJS = $(patsubst %.c, %.o, pt-raise.c)
-SO_LIBP_COBJS = $(patsubst %.c, %.os, pt-raise.c)
-
-AR_LIBC_COBJS = $(patsubst %.c, %.o, dl-support.c dl-tls.c libc-tls.c)
-
-all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
-
-$(AR_LIB_NAME): $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
- $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment \
- $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-
-$(AR_SO_LIB_NAME): $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
- $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment \
- $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_SO_LIB_NAME) $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-
-obj.pthread.ar: $(AR_LIBC_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBC_COBJS)
-endif
- @for objfile in $(AR_LIBC_COBJS); do \
- echo ../libpthread/nptl/sysdeps/mips/$$objfile >> \
- $(TOPDIR)libc/$@; \
- done
-
-$(AR_LIBP_AOBJS): %.o : %.S
- $(CC) $(ASFLAGS-NPTL) -c $< -o $@
-
-$(SO_LIBP_AOBJS): %.os : %.S
- $(CC) $(ASFLAGS-NPTL) -DSHARED -c $< -o $@
-
-$(AR_LIBP_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -c $< -o $@
-
-$(SO_LIBP_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
-
-$(AR_LIBC_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -c $< -o $@
-
-clean:
- $(RM) *.o *.os *~ core
-.PHONY: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
+top_srcdir=../../../../
+top_builddir=../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.arch
+include $(top_srcdir)Makerules
diff --git a/libpthread/nptl/sysdeps/mips/tls.h b/libpthread/nptl/sysdeps/mips/tls.h
index 2a9dde161..cb0021f3f 100644
--- a/libpthread/nptl/sysdeps/mips/tls.h
+++ b/libpthread/nptl/sysdeps/mips/tls.h
@@ -20,8 +20,6 @@
#ifndef _TLS_H
#define _TLS_H 1
-#include <dl-sysdep.h>
-
#ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h>
@@ -55,21 +53,10 @@ typedef union dtv
.set pop
#endif /* __ASSEMBLER__ */
-
/* We require TLS support in the tools. */
-/*
- * NPTL - These defines would normally be handled by the top-level
- * configure script in glibc.
- */
-#ifdef __UCLIBC__
#define HAVE_TLS_SUPPORT 1
#define HAVE_TLS_MODEL_ATTRIBUTE 1
#define HAVE___THREAD 1
-#endif
-
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
/* Signal that TLS support is available. */
#define USE_TLS 1
@@ -83,12 +70,8 @@ typedef union dtv
# define TLS_DTV_AT_TP 1
/* Get the thread descriptor definition. */
-#ifdef __UCLIBC__
-# include <libc-symbols.h>
-# include <../../descr.h>
-#else
-# include <nptl/descr.h>
-#endif
+#include <libc-symbols.h>
+#include <../../descr.h>
typedef struct
{
diff --git a/libpthread/nptl/sysdeps/powerpc/tls.h b/libpthread/nptl/sysdeps/powerpc/tls.h
index b2322b09b..1157116a3 100644
--- a/libpthread/nptl/sysdeps/powerpc/tls.h
+++ b/libpthread/nptl/sysdeps/powerpc/tls.h
@@ -20,8 +20,6 @@
#ifndef _TLS_H
#define _TLS_H 1
-# include <dl-sysdep.h>
-
#ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h>
diff --git a/libpthread/nptl/sysdeps/pthread/Makefile b/libpthread/nptl/sysdeps/pthread/Makefile
index 0f03668e1..a30ded527 100644
--- a/libpthread/nptl/sysdeps/pthread/Makefile
+++ b/libpthread/nptl/sysdeps/pthread/Makefile
@@ -1,108 +1,13 @@
-# Makefile for uClibc NPTL pthread library (pthread)
+# Makefile for uClibc NPTL
#
-# Copyright (C) 2005 Steven J. Hill <sjhill@realitydiluted.com>
+# Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
#
-# 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.
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# 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.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# Makefile for uClibc
-
-TOPDIR=../../../../
-include $(TOPDIR)Rules.mak
-include ../../Rules.mak
-
-#
-# NOTE: glibc puts flockfile.c, ftrylockfile.c, funlockfile.c, and
-# pt-longjmp.c in libc and libpthread. For uClibc, they are
-# in libc only.
-#
-CSRC = pthread_barrier_wait.c pthread_cond_broadcast.c pthread_cond_signal.c \
- pthread_cond_timedwait.c pthread_cond_wait.c pthread_getcpuclockid.c \
- pthread_once.c pthread_rwlock_rdlock.c pthread_rwlock_timedrdlock.c \
- pthread_rwlock_timedwrlock.c pthread_rwlock_unlock.c \
- pthread_rwlock_wrlock.c pthread_sigmask.c pthread_spin_destroy.c \
- pthread_spin_init.c pthread_spin_unlock.c sigaction.c \
- sigfillset.c sigprocmask.c unwind-forcedunwind.c
-
-CFLAGS-pthread_barrier_wait.c = -D_GNU_SOURCE
-CFLAGS-pthread_spin_destroy.c = -D_GNU_SOURCE
-CFLAGS-pthread_spin_init.c = -D_GNU_SOURCE
-CFLAGS-pthread_spin_unlock.c = -D_GNU_SOURCE
-CFLAGS-sigaction.c = -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH) \
- -I$(TOPDIR)libc/signal
-CFLAGS-sigfillset.c = -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH) \
- -I$(TOPDIR)libc/signal
-CFLAGS-sigprocmask.c = -I$(TOPDIR)libc/sysdeps/linux/common
-
-AR_LIBP_COBJS = $(patsubst %.c, %.o, $(CSRC))
-SO_LIBP_COBJS = $(patsubst %.c, %.os, $(CSRC))
-
-ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
-all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME) crti.o crtn.o
-else
-all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
-endif
-
-$(AR_LIB_NAME): $(AR_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(AR_LIBP_COBJS)
-
-$(AR_SO_LIB_NAME): $(SO_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(SO_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(SO_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_SO_LIB_NAME) $(SO_LIBP_COBJS)
-
-$(AR_LIBP_COBJS): %.o : %.c
- $(CC) $(CFLAGS-LIBP) $(CFLAGS-$<) -c $< -o $@
-
-$(SO_LIBP_COBJS): %.os : %.c
- $(CC) $(CFLAGS-LIBP) $(CFLAGS-$<) -DSHARED -c $< -o $@
-
-pt-initfini.s: pt-initfini.c
- $(CC) -S $(CFLAGS-LIBP) -g0 -fPIC -fno-inline-functions \
- $(call check_gcc,-fno-unit-at-a-time,) \
- -finhibit-size-directive \
- $(patsubst -f%,-fno-%,$(call check_gcc,-fexceptions,)) \
- $< -o $@
-
-crti.S: pt-initfini.s
- sed -n -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@
-
-crtn.S: pt-initfini.s
- sed -n -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@
-
-defs.h: pt-initfini.s defs.awk
- sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
- awk -f defs.awk > $@
-
-crti.o: crti.S defs.h
- $(CC) -g0 $(ASFLAGS-LIBC) -c $< -o $@
-
-crtn.o: crtn.S defs.h
- $(CC) -g0 $(ASFLAGS-LIBC) -c $< -o $@
-
-clean:
- $(RM) *.o *.os *.s crt* *~ core defs.h
-.PHONY: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
+top_srcdir=../../../../
+top_builddir=../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/libpthread/nptl/sysdeps/sh/tls.h b/libpthread/nptl/sysdeps/sh/tls.h
index e883bae99..cf9827a2a 100644
--- a/libpthread/nptl/sysdeps/sh/tls.h
+++ b/libpthread/nptl/sysdeps/sh/tls.h
@@ -20,8 +20,6 @@
#ifndef _TLS_H
#define _TLS_H
-# include <dl-sysdep.h>
-
#ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h>
diff --git a/libpthread/nptl/sysdeps/sparc/tls.h b/libpthread/nptl/sysdeps/sparc/tls.h
index ddc484855..ea26ed32f 100644
--- a/libpthread/nptl/sysdeps/sparc/tls.h
+++ b/libpthread/nptl/sysdeps/sparc/tls.h
@@ -20,7 +20,6 @@
#ifndef _TLS_H
#define _TLS_H
-#include <dl-sysdep.h>
#ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
index 43f4bb409..34d647527 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -1,118 +1,13 @@
-# Makefile for uClibc NPTL pthread library (Linux files)
+# Makefile for uClibc NPTL
#
-# Copyright (C) 2005 Steven J. Hill <sjhill@realitydiluted.com>
+# Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
#
-# 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.
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# 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.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# Makefile for uClibc
-
-TOPDIR=../../../../../../
-include $(TOPDIR)Rules.mak
-include ../../../../Rules.mak
-
-AR_LIBP_CSRC = pt-raise.c pthread_attr_getaffinity.c \
- pthread_attr_setaffinity.c pthread_getaffinity.c \
- pthread_getcpuclockid.c pthread_kill.c \
- pthread_mutex_cond_lock.c pthread_setaffinity.c \
- pthread_yield.c sem_post.c sem_timedwait.c \
- sem_trywait.c sem_wait.c pt-fork.c
-SO_LIBP_CSRC = $(AR_LIBP_CSRC)
-AR_LIBC_CSRC = libc_pthread_init.c libc_multiple_threads.c \
- register-atfork.c unregister-atfork.c
-SO_LIBC_CSRC = $(AR_LIBC_CSRC)
-
-ifeq ($(strip $(TARGET_ARCH)),alpha)
-AR_LIBC_CSRC += libc-lowlevellock.c
-AR_LIBP_CSRC += lowlevellock.c
-endif
-ifeq ($(strip $(TARGET_ARCH)),mips)
-AR_LIBC_CSRC += libc-lowlevellock.c
-AR_LIBP_CSRC += lowlevellock.c
-endif
-ifeq ($(strip $(TARGET_ARCH)),powerpc)
-AR_LIBC_CSRC += libc-lowlevellock.c
-AR_LIBP_CSRC += lowlevellock.c
-endif
-ifeq ($(strip $(TARGET_ARCH)),sparc)
-AR_LIBC_CSRC += libc-lowlevellock.c
-AR_LIBP_CSRC += lowlevellock.c
-endif
-
-#
-# Needed to get pthread types.
-#
-CFLAGS-pt-fork.c = -D_GNU_SOURCE
-CFLAGS-pthread_getcpuclockid.c = -I$(TOPDIR)/librt
-
-AR_LIBP_COBJS = $(patsubst %.c, %.o, $(AR_LIBP_CSRC))
-SO_LIBP_COBJS = $(patsubst %.c, %.os, $(SO_LIBP_CSRC))
-AR_LIBC_COBJS = $(patsubst %.c, %.o, $(AR_LIBC_CSRC))
-SO_LIBC_COBJS = $(patsubst %.c, %.os, $(SO_LIBC_CSRC))
-
-all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
-
-$(AR_LIB_NAME): $(AR_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(AR_LIBP_COBJS)
-
-$(AR_SO_LIB_NAME): $(SO_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(SO_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(SO_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_SO_LIB_NAME) $(SO_LIBP_COBJS)
-
-obj.pthread.ar: $(AR_LIBC_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBC_COBJS)
-endif
- @for objfile in $(AR_LIBC_COBJS); do \
- echo ../libpthread/nptl/sysdeps/unix/sysv/linux/$$objfile >> \
- $(TOPDIR)libc/$@; \
- done
-
-obj.pthread.so: $(SO_LIBC_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(SO_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(SO_LIBC_COBJS)
-endif
- @for objfile in $(SO_LIBC_COBJS); do \
- echo ../libpthread/nptl/sysdeps/unix/sysv/linux/$$objfile >> \
- $(TOPDIR)libc/$@; \
- done
-
-$(AR_LIBP_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -c $< -o $@
-
-$(SO_LIBP_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
-
-$(AR_LIBC_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -c $< -o $@
-
-$(SO_LIBC_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -DSHARED -c $< -o $@
-
-clean:
- $(RM) *.o *.os *~ core
-.PHONY: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
+top_srcdir=../../../../../../
+top_builddir=../../../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c b/libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
index 3d1c02181..cf5150341 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
@@ -20,7 +20,6 @@
#include <unistd.h>
#include <list.h>
#include "fork.h"
-#include <dl-sysdep.h>
#include <tls.h>
#include <string.h>
#include <pthreadP.h>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile
index 084708397..43a6fad84 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile
@@ -1,108 +1,13 @@
-# Makefile for uClibc NPTL pthread library (Linux/MIPS)
+# Makefile for uClibc NPTL
#
-# Copyright (C) 2005 Steven J. Hill <sjhill@realitydiluted.com>
+# Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
#
-# 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.
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# 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.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# Makefile for uClibc
-
-TOPDIR=../../../../../../../
-include $(TOPDIR)Rules.mak
-include ../../../../../Rules.mak
-
-#AR_LIBP_ASRC = pt-vfork.S clone.S
-AR_LIBP_ASRC = pt-vfork.S
-SO_LIBP_ASRC = $(AR_LIBP_ASRC)
-AR_LIBP_CSRC = pthread_once.c
-SO_LIBP_CSRC = $(AR_LIBP_CSRC)
-AR_LIBC_CSRC = fork-nptl.c
-SO_LIBC_CSRC = $(AR_LIBC_CSRC)
-
-AR_LIBP_AOBJS = $(patsubst %.S, %.o, $(AR_LIBP_ASRC))
-SO_LIBP_AOBJS = $(patsubst %.S, %.os, $(SO_LIBP_ASRC))
-AR_LIBP_COBJS = $(patsubst %.c, %.o, $(AR_LIBP_CSRC))
-SO_LIBP_COBJS = $(patsubst %.c, %.os, $(SO_LIBP_CSRC))
-AR_LIBC_COBJS = $(patsubst %.c, %.o, $(AR_LIBC_CSRC))
-SO_LIBC_COBJS = $(patsubst %.c, %.os, $(SO_LIBC_CSRC))
-
-ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
-CFLAGS-fork-nptl.c = -D__USE_STDIO_FUTEXES__
-endif
-
-all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
-
-$(AR_LIB_NAME): $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
- $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment \
- $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(AR_LIBP_AOBJS) $(AR_LIBP_COBJS)
-
-$(AR_SO_LIB_NAME): $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
- $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment \
- $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-endif
- $(AR) $(ARFLAGS) $(AR_SO_LIB_NAME) $(SO_LIBP_AOBJS) $(SO_LIBP_COBJS)
-
-obj.pthread.ar: $(AR_LIBC_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(AR_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(AR_LIBC_COBJS)
-endif
- @for objfile in $(AR_LIBC_COBJS); do \
- echo ../libpthread/nptl/sysdeps/unix/sysv/linux/mips/$$objfile \
- >> $(TOPDIR)libc/$@; \
- done
-
-obj.pthread.so: $(SO_LIBC_COBJS)
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
- $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(SO_LIBC_COBJS)
-else
- $(STRIPTOOL) -x -R .note -R .comment $(SO_LIBC_COBJS)
-endif
- @for objfile in $(SO_LIBC_COBJS); do \
- echo ../libpthread/nptl/sysdeps/unix/sysv/linux/mips/$$objfile \
- >> $(TOPDIR)libc/$@; \
- done
-
-$(AR_LIBP_AOBJS): %.o : %.S
- $(CC) $(ASFLAGS-LIBP) -c $< -o $@
-
-$(SO_LIBP_AOBJS): %.os : %.S
- $(CC) $(ASFLAGS-LIBP) -DSHARED -c $< -o $@
-
-$(AR_LIBP_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -c $< -o $@
-
-$(SO_LIBP_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
-
-$(AR_LIBC_COBJS): %.o : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -c $< -o $@
-
-$(SO_LIBC_COBJS): %.os : %.c
- $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -DSHARED -c $< -o $@
-
-clean:
- $(RM) *.o *.os *~ core
-.PHONY: $(AR_LIB_NAME) $(AR_SO_LIB_NAME)
+top_srcdir=../../../../../../../
+top_builddir=../../../../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.arch
+include $(top_srcdir)Makerules
diff --git a/libpthread/nptl_db/Makefile.in b/libpthread/nptl_db/Makefile.in
new file mode 100644
index 000000000..18503339c
--- /dev/null
+++ b/libpthread/nptl_db/Makefile.in
@@ -0,0 +1,67 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+# Get the thread include dependencies and shared object name
+CFLAGS-nptl_db := -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
+CFLAGS-nptl_db += -I$(top_srcdir)libpthread/nptl -D_GNU_SOURCE
+CFLAGS-nptl_db += -DIS_IN_libthread_db=1 -std=gnu99 -I$(top_srcdir)ldso/include
+
+LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols
+
+LIBS-libthread_db.so := $(LIBS)
+
+libthread_db_FULL_NAME := libthread_db-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+
+libthread_db_DIR := $(top_srcdir)libpthread/nptl_db
+libthread_db_OUT := $(top_builddir)libpthread/nptl_db
+
+libthread_db_SRC := $(wildcard $(libthread_db_DIR)/td_*.c) \
+ $(libthread_db_DIR)/fetch-value.c
+
+libthread_db_OBJ := $(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC))
+
+libthread_db-so-y := $(libthread_db_OBJ:.o=.oS)
+ifeq ($(DOPIC),y)
+libthread_db-a-y := $(libthread_db-so-y)
+else
+libthread_db-a-y := $(libthread_db_OBJ)
+endif
+
+libthread_db-multi-y := $(libthread_db_SRC)
+
+lib-a-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.a
+lib-so-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.so
+objclean-y += libthread_db_clean
+headers-$(PTHREADS_DEBUG_SUPPORT) += nptl_db_headers
+headers_clean-y += nptl_db_headers_clean
+
+ifeq ($(DOPIC),y)
+$(top_builddir)lib/libthread_db.so: $(top_builddir)lib/libthread_db.a $(libc)
+else
+$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db_so.a $(libc)
+endif
+ $(call link.so,$(libthread_db_FULL_NAME),1)
+
+$(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
+
+$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
+ $(Q)$(INSTALL) -d $(dir $@)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
+
+nptl_db_headers:
+ $(LN) -sf ../$(PTDIR)_db/thread_db.h $(top_builddir)include/
+
+nptl_db_headers_clean:
+ $(RM) $(top_builddir)include/thread_db.h
+
+libthread_db_clean:
+ $(RM) $(libthread_db_OUT)/*.{o,oS,a}