summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps')
-rw-r--r--libpthread/nptl/sysdeps/mips/Makefile46
-rw-r--r--libpthread/nptl/sysdeps/pthread/Makefile102
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/Makefile118
3 files changed, 180 insertions, 86 deletions
diff --git a/libpthread/nptl/sysdeps/mips/Makefile b/libpthread/nptl/sysdeps/mips/Makefile
index 29ee02c5a..2528194f3 100644
--- a/libpthread/nptl/sysdeps/mips/Makefile
+++ b/libpthread/nptl/sysdeps/mips/Makefile
@@ -1,4 +1,4 @@
-# Makefile for uClibc's NPTL pthread library
+# Makefile for uClibc NPTL pthread library (MIPS)
#
# Copyright (C) 2005 Steven J. Hill <sjhill@realitydiluted.com>
#
@@ -19,21 +19,41 @@
TOPDIR=../../../../
include $(TOPDIR)Rules.mak
+include ../../Rules.mak
-#
-# FIX ME: We should probably be including 'nptl-sysdep.S' which needs
-# the new '__syscall_error' function for per-thread 'errno'. Maybe
-# this work and maybe it will not.
-#
-SOBJS = $(patsubst %.S,%.o, $(filter-out nptl-sysdep.S, $(wildcard *.S)))
+COBJ-LIBC-ST = $(patsubst %.c, %.o, $(wildcard *.c))
+
+AOBJ-LIBP-ST = $(patsubst %.S, %.o, $(wildcard *.S))
+AOBJ-LIBP-SH = $(patsubst %.S, %.os, $(wildcard *.S))
+
+ar-target all: $(AOBJ-LIBP-ST) $(AOBJ-LIBP-SH)
+ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
+ $(AOBJ-LIBP-ST) $(AOBJ-LIBP-SH)
+else
+ $(STRIPTOOL) -x -R .note -R .comment $(AOBJ-LIBP-ST) $(AOBJ-LIBP-SH)
+endif
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_STATIC_ARCHIVE) $(AOBJ-LIBP-ST)
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_SHARED_ARCHIVE) $(AOBJ-LIBP-SH)
+
+$(AOBJ-LIBP-ST): %.o : %.S
+ $(CC) $(ASFLAGS) $(ASFLAGS-NPTL) -c $< -o $@
-OBJS = $(SOBJS)
+$(AOBJ-LIBP-SH): %.os : %.S
+ $(CC) $(ASFLAGS) $(ASFLAGS-NPTL) -DSHARED -c $< -o $@
-all: $(OBJS)
+$(COBJ-LIBC-ST): %.o : %.c
+ $(CC) $(CFLAGS-LIBC) -c $< -o $@
-$(SOBJS): %.o : %.S
- echo $(PTDIR)
- $(CC) $(ASFLAGS) -c $< -o $@
+objs-pthread-libc: $(COBJ-LIBC-ST)
+ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment $(COBJ-LIBC-ST)
+else
+ $(STRIPTOOL) -x -R .note -R .comment $(COBJ-LIBC-ST)
+endif
+ @for objfile in $(COBJ-LIBC-ST); do \
+ echo ../libpthread/nptl/sysdeps/mips/$$objfile >> $(PTCOBJST); \
+ done
clean:
- $(RM) *.[oa] *~ core
+ $(RM) *.o *.os *~ core
diff --git a/libpthread/nptl/sysdeps/pthread/Makefile b/libpthread/nptl/sysdeps/pthread/Makefile
index 207e10fad..0bd102d6e 100644
--- a/libpthread/nptl/sysdeps/pthread/Makefile
+++ b/libpthread/nptl/sysdeps/pthread/Makefile
@@ -1,52 +1,58 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
-
-# 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.
-
-ifeq ($(subdir),csu)
-CFLAGS-libc-start.c += -I../nptl
-routines += unwind-resume
-shared-only-routines += unwind-resume
-CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
-endif
-
-ifeq ($(subdir),nptl)
-libpthread-sysdep_routines += errno-loc
-endif
-
-ifeq ($(subdir),rt)
-librt-sysdep_routines += timer_routines librt-cancellation rt-unwind-resume
-librt-shared-only-routines += rt-unwind-resume
-CPPFLAGS-timer_routines.c = -I../nptl
-CFLAGS-librt-cancellation.c += -fexceptions -fasynchronous-unwind-tables
-CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
-
-ifeq (yes,$(build-shared))
-$(objpfx)tst-timer: $(objpfx)librt.so $(shared-thread-library)
+# Makefile for uClibc NPTL pthread library (pthread)
+#
+# 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
+
+#
+# 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 \
+ unwind-forcedunwind.c
+
+COBJ-LIBP-ST = $(patsubst %.c, %.o, $(CSRC))
+COBJ-LIBP-SH = $(patsubst %.c, %.os, $(CSRC))
+
+ar-target all: $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
+ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
+ $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
else
-$(objpfx)tst-timer: $(objpfx)librt.a $(static-thread-library)
+ $(STRIPTOOL) -x -R .note -R .comment \
+ $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
endif
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_STATIC_ARCHIVE) $(COBJ-LIBP-ST)
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_SHARED_ARCHIVE) $(COBJ-LIBP-SH)
-ifeq ($(have-forced-unwind),yes)
-tests += tst-mqueue8x
-CFLAGS-tst-mqueue8x.c += -fexceptions
-endif
-endif
+$(COBJ-LIBP-ST): %.o : %.c
+ $(CC) $(CFLAGS-LIBP) -c $< -o $@
-ifeq ($(subdir),posix)
-CFLAGS-confstr.c += -DLIBPTHREAD_VERSION='"NPTL $(version)"'
-endif
+$(COBJ-LIBP-SH): %.os : %.c
+ $(CC) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
+
+clean:
+ $(RM) *.o *.os *~ core
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
index 991398242..e29cf113b 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -1,34 +1,102 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+# Makefile for uClibc NPTL pthread library (Linux files)
+#
+# 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
-# 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.
+TOPDIR=../../../../../../
+include $(TOPDIR)Rules.mak
+include ../../../../Rules.mak
-# 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.
+CSRC-LIBP-ST = 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
-# 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. */
+CSRC-LIBP-SH = $(CSRC-LIBP-ST)
-ifeq ($(subdir),nptl)
-sysdep_routines += register-atfork unregister-atfork libc_pthread_init \
- libc_multiple_threads
+CSRC-LIBC-ST = libc_pthread_init.c libc_multiple_threads.c \
+ register-atfork.c unregister-atfork.c
-libpthread-sysdep_routines += pt-fork pthread_mutex_cond_lock
+CSRC-LIBC-SH = $(CSRC-LIBC-ST)
-gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
- lowlevelbarrier.sym unwindbuf.sym
+ifeq ($(strip $(TARGET_ARCH)),alpha)
+CSRC-LIBC-ST += libc-lowlevellock.c
+CSRC-LIBP-ST += rtld-libc-lowlevellock.c
endif
+ifeq ($(strip $(TARGET_ARCH)),mips)
+CSRC-LIBC-ST += libc-lowlevellock.c
+CSRC-LIBP-ST += rtld-libc-lowlevellock.c
+endif
+ifeq ($(strip $(TARGET_ARCH)),powerpc)
+CSRC-LIBC-ST += libc-lowlevellock.c
+CSRC-LIBP-ST += rtld-libc-lowlevellock.c
+endif
+ifeq ($(strip $(TARGET_ARCH)),sparc)
+CSRC-LIBC-ST += libc-lowlevellock.c
+CSRC-LIBP-ST += rtld-libc-lowlevellock.c
+endif
+
+COBJ-LIBP-ST = $(patsubst %.c, %.o, $(CSRC-LIBP-ST))
+COBJ-LIBP-SH = $(patsubst %.c, %.os, $(CSRC-LIBP-SH))
+COBJ-LIBC-ST = $(patsubst %.c, %.o, $(CSRC-LIBC-ST))
+COBJ-LIBC-SH = $(patsubst %.c, %.os, $(CSRC-LIBC-SH))
+
+ar-target all: $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
+ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
+ $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
+else
+ $(STRIPTOOL) -x -R .note -R .comment \
+ $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
+endif
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_STATIC_ARCHIVE) $(COBJ-LIBP-ST)
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_SHARED_ARCHIVE) $(COBJ-LIBP-SH)
-ifeq ($(subdir),posix)
-CFLAGS-fork.c = -D_IO_MTSAFE_IO
-CFLAGS-getpid.o = -fomit-frame-pointer
-CFLAGS-getpid.os = -fomit-frame-pointer
+$(COBJ-LIBP-ST): %.o : %.c
+ $(CC) $(CFLAGS-LIBP) -c $< -o $@
+
+$(COBJ-LIBP-SH): %.os : %.c
+ $(CC) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
+
+$(COBJ-LIBC-ST): %.o : %.c
+ $(CC) $(CFLAGS-LIBC) -c $< -o $@
+
+$(COBJ-LIBC-SH): %.os : %.c
+ $(CC) $(CFLAGS-LIBC) -DSHARED -c $< -o $@
+
+objs-pthread-libc: $(COBJ-LIBC-ST) $(COBJ-LIBC-SH)
+ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
+ $(COBJ-LIBC-ST) $(COBJ-LIBC-SH)
+else
+ $(STRIPTOOL) -x -R .note -R .comment \
+ $(COBJ-LIBC-ST) $(COBJ-LIBC-SH)
endif
+ @for objfile in $(COBJ-LIBC-ST); do \
+ echo ../libpthread/nptl/sysdeps/unix/sysv/linux/$$objfile >> $(PTCOBJST); \
+ done
+ @for objfile in $(COBJ-LIBC-SH); do \
+ echo ../libpthread/nptl/sysdeps/unix/sysv/linux/$$objfile >> $(PTCOBJSH); \
+ done
+
+rtld-libc-lowlevellock.c: libc-lowlevellock.c
+ $(LN) -fs $< $@
+
+clean:
+ $(RM) *.o *.os *~ core rtld-libc-lowlevellock.c