[uClibc-cvs] svn commit: branches/uClibc-nptl: libc libc/sysdeps/linux/mips libpthread etc...
sjhill at uclibc.org
sjhill at uclibc.org
Tue Aug 9 05:57:07 UTC 2005
Author: sjhill
Date: 2005-08-08 23:57:05 -0600 (Mon, 08 Aug 2005)
New Revision: 11079
Log:
Finally, all of the makefiles that make the magic happen. These changes allow for uClibc to build for NPTL support without breaking the old linuxthreads model. Let the testing begin.
Modified:
branches/uClibc-nptl/Makefile
branches/uClibc-nptl/Rules.mak
branches/uClibc-nptl/libc/Makefile
branches/uClibc-nptl/libc/sysdeps/linux/mips/Makefile
branches/uClibc-nptl/libpthread/Makefile
branches/uClibc-nptl/libpthread/nptl/Makefile
branches/uClibc-nptl/libpthread/nptl/Rules.mak
branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/Makefile
branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile
branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
branches/uClibc-nptl/utils/Makefile
Changeset:
Modified: branches/uClibc-nptl/Makefile
===================================================================
--- branches/uClibc-nptl/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -350,8 +350,9 @@
clean:
- find . \( -name \*.o -o -name \*.a -o -name \*.so -o -name core -o -name .\#\* \) -exec $(RM) {} \;
@$(RM) -r tmp lib include/bits libc/tmp _install
- $(RM) libc/obj.* headers
+ $(RM) libc/obj.* libc/obj-* headers
$(MAKE) -C test clean
+ $(MAKE) -C utils clean
$(MAKE) -C ldso clean
$(MAKE) -C libc/misc/internals clean
$(MAKE) -C libc/misc/wchar clean
Modified: branches/uClibc-nptl/Rules.mak
===================================================================
--- branches/uClibc-nptl/Rules.mak 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/Rules.mak 2005-08-09 05:57:05 UTC (rev 11079)
@@ -302,6 +302,12 @@
-I$(PTDIR)sysdeps/pthread
endif
+#
+# Thread objects linked into C library.
+#
+PTCOBJST := $(TOPDIR)libc/obj-pthread-libc
+PTCOBJSH := $(TOPDIR)libc/obj-pthread-libc_shared
+
ifeq ($(UCLIBC_BUILD_RELRO),y)
LDFLAGS+=-z relro
endif
Modified: branches/uClibc-nptl/libc/Makefile
===================================================================
--- branches/uClibc-nptl/libc/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libc/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -52,7 +52,7 @@
# the wildcard will be evaluated when `make` is run instead of when the make
# target is evaluated. That means if you run `rm obj.* ; make`, the wildcard
# will evaluate to no files :(.
-$(LIBNAME) shared_$(LIBNAME) ar-target: subdirs
+$(LIBNAME) shared_$(LIBNAME) ar-target: subdirs objs-pthread-libc
$(RM) $(LIBNAME) shared_$(LIBNAME)
objs=`cat obj.*` ; \
$(AR) $(ARFLAGS) $(LIBNAME) $$objs && \
@@ -71,9 +71,7 @@
done
cp $(LIBNAME) shared_$(LIBNAME)
$(AR) $(ARFLAGS) $(LIBNAME) misc/internals/static.o
-ifeq ($(PTHREADS_NATIVE),y)
- $(AR) d $(LIBNAME) libc-lowlevellock.os
-endif
+ $(AR) $(ARFLAGS) $(LIBNAME) `cat "$(PTCOBJST)"`
$(RANLIB) $(LIBNAME)
$(LIBNAME_TARGET): $(LIBNAME)
@@ -82,9 +80,7 @@
$(INSTALL) -m 644 $(LIBNAME) $(TOPDIR)lib
shared: shared_$(LIBNAME)
-ifeq ($(PTHREADS_NATIVE),y)
- $(AR) d shared_$(LIBNAME) libc-tls.o libc-lowlevellock.o
-endif
+ $(AR) $(ARFLAGS) shared_$(LIBNAME) `cat "$(PTCOBJSH)"`
$(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \
--whole-archive shared_$(LIBNAME) \
$(TOPDIR)libc/misc/internals/interp.o --no-whole-archive \
@@ -106,7 +102,7 @@
clean: subdirs_clean halfclean
@$(RM) -r tmp
$(RM) include/asm include/linux include/bits
- $(RM) obj.*
+ $(RM) obj.* obj-*
subdirs: $(patsubst %, _dir_%, $(DIRS))
subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
@@ -117,4 +113,8 @@
$(patsubst %, _dirclean_%, $(DIRS)) : dummy
$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
+objs-pthread-libc:
+ $(RM) $(PTCOBJST) $(PTCOBJSH)
+ $(MAKE) -C ../libpthread $@
+
.PHONY: dummy subdirs
Modified: branches/uClibc-nptl/libc/sysdeps/linux/mips/Makefile
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/mips/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libc/sysdeps/linux/mips/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -28,15 +28,9 @@
SOBJS=$(patsubst %.S,%.o, $(SSRC))
CSRC=__longjmp.c brk.c setjmp_aux.c mmap.c __syscall_error.c \
- cacheflush.c pread_write.c sysmips.c _test_and_set.c #sigaction.c
+ cacheflush.c pread_write.c sysmips.c _test_and_set.c sigaction.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
-ifeq ($(PTHREADS_NATIVE),y)
-COBJS += $(PTDIR)sysdeps/$(TARGET_ARCH)/libc-tls.o \
- $(PTDIR)sysdeps/unix/sysv/linux/libc-lowlevellock.o \
- $(PTDIR)sysdeps/unix/sysv/linux/libc-lowlevellock.os
-endif
-
OBJS=$(SOBJS) $(COBJS)
OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
@@ -87,17 +81,6 @@
$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
endif
-ifeq ($(PTHREADS_NATIVE),y)
-$(PTDIR)sysdeps/$(TARGET_ARCH)/libc-tls.o:
- $(MAKE) -C $(PTDIR)sysdeps/$(TARGET_ARCH) libc-tls.o
-
-$(PTDIR)sysdeps/unix/sysv/linux/libc-lowlevellock.o:
- $(MAKE) -C $(PTDIR)sysdeps/unix/sysv/linux libc-lowlevellock.o
-
-$(PTDIR)sysdeps/unix/sysv/linux/libc-lowlevellock.os:
- $(MAKE) -C $(PTDIR)sysdeps/unix/sysv/linux libc-lowlevellock.os
-endif
-
headers:
$(LN) -fs ../libc/sysdeps/linux/mips/sgidefs.h $(TOPDIR)/include/
# $(LN) -fs ../libc/sysdeps/linux/mips/regdef.h $(TOPDIR)/include/
Modified: branches/uClibc-nptl/libpthread/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libpthread/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -80,7 +80,14 @@
$(INSTALL) -m 644 $(LIBTHREAD_DB) $(TOPDIR)lib
endif
+objs-pthread-libc:
+ifeq ($(strip $(PTHREADS_NATIVE)),y)
+ $(MAKE) -C nptl $@
+else
+ touch $(PTCOBJST) $(PTCOBJSH)
+endif
+
$(OBJS): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
@@ -93,7 +100,9 @@
$(LD) $(LDFLAGS_NOSTRIP) -soname=$(LIBPTHREAD_SHARED).$(MAJOR_VERSION) \
-o $(LIBPTHREAD_SHARED_FULLNAME) $(SHARED_START_FILES) --whole-archive $(LIBPTHREAD_SHARED_ARCHIVE) \
--no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
- -L$(TOPDIR)lib -lc -ldl $(LDADD_LIBFLOAT) $(LIBGCC) \
+ -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) \
+ $(TOPDIR)ldso/ldso/ld-uClibc-0.9.27.so \
+ -L$(TOPDIR)ldso/libdl -ldl \
$(SHARED_END_FILES)
else
$(LD) $(LDFLAGS_NOSTRIP) -soname=$(LIBPTHREAD_SHARED).$(MAJOR_VERSION) \
Modified: branches/uClibc-nptl/libpthread/nptl/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libpthread/nptl/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -1,7 +1,6 @@
-# Makefile for uClibc's pthread library
+# Makefile for uClibc's NPTL pthread library (Portions stolen from glibc.)
#
-# Copyright (C) 2002 Erik Andersen <andersen at uclibc.org>
-# Copyright (C) 2003 Paul Mundt <lethal at linux-sh.org>
+# Copyright (C) 2005 Steven J. Hill <sjhill at 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
@@ -20,67 +19,280 @@
TOPDIR=../../
include $(TOPDIR)Rules.mak
+include Rules.mak
-# As long as there is only one subdir, we don't
-# have to worry about race conditions with multiple
-# $(AR)'s in subdirs running on linuxthreads.a.
-DIRS = sysdeps
+routines = alloca_cutoff forward libc-lowlevellock libc-cancellation
+shared-only-routines = forward
-#Adjust the soname version to avoid namespace collisions with glibc's libpthread
-LIBPTHREAD:=../libpthread.a
-ifeq ($(strip $(TARGET_ARCH)),sparc)
-SYSDEPS_DIR:=$(TARGET_ARCH)/sparc32
+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
+# pthread_setuid pthread_seteuid pthread_setreuid \
+# pthread_setresuid \
+# pthread_setgid pthread_setegid pthread_setregid \
+# pthread_setresgid
+
+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.
+#
+
+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_kill_other_threads \
+ 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)
+
+CSRC-LIBP-ST = $(patsubst %, %.c, $(filter-out $(libpthread-os-routines) \
+ $(libpthread-misc-routines) \
+ $(libpthread-shared-only-routines), \
+ $(libpthread-routines)))
+
+CSRC-LIBP-SH = $(patsubst %, %.c, $(filter-out $(libpthread-os-routines) \
+ $(libpthread-misc-routines) \
+ $(libpthread-static-only-routines) pt-allocrtsig, \
+ $(libpthread-routines)))
+
+CSRC-LIBC-ST = $(patsubst %, %.c, $(filter-out $(shared-only-routines) \
+ libc-lowlevellock, $(routines)))
+
+CSRC-LIBC-SH = $(patsubst %, %.c, $(filter-out libc-lowlevellock, $(routines)))
+
+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: version.h banner.h $(COBJ-LIBP-ST) $(COBJ-LIBP-SH) subdirs
+ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
+ $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
else
-SYSDEPS_DIR:=$(TARGET_ARCH)
+ $(STRIPTOOL) -x -R .note -R .comment \
+ $(COBJ-LIBP-ST) $(COBJ-LIBP-SH)
endif
-#This stuff will not compile without at least -O1
-CFLAGS :=$(CFLAGS:-O0=-O1)
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_STATIC_ARCHIVE) $(COBJ-LIBP-ST)
+ $(AR) $(ARFLAGS) $(PTDIR)../$(LIBPTHREAD_SHARED_ARCHIVE) $(COBJ-LIBP-SH)
+version.h:
+ @echo "#define VERSION \""$(VERSION)"\"" > $@
-# set up system dependencies include dirs (NOTE: order matters!)
-PTDIR = $(TOPDIR)libpthread/nptl/
-SYSDEPINC = -I$(PTDIR)sysdeps/unix \
- -I$(PTDIR)sysdeps/unix/sysv/linux \
- -I$(PTDIR)sysdeps/unix/sysv/linux/$(TARGET_ARCH) \
- -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
- -I$(PTDIR)sysdeps/pthread \
- -I$(PTDIR)sysdeps \
- -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH) \
- -I$(TOPDIR)ldso/include
-CFLAGS += $(SYSDEPINC)
+banner.h: Banner
+ sed 's/\(.*\)/"\1\\n"/' $< > $@
-CSRC=init.c vars.c events.c pthread_create.c pthread_exit.c
+$(COBJ-LIBP-ST): %.o : %.c
+ $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -c $< -o $@
-COBJS=$(patsubst %.c,%.o, $(CSRC))
-OBJS=$(COBJS)
+$(COBJ-LIBP-SH): %.os : %.c
+ $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
-# We need to make sure that we put all the top-level $(OBJS) into
-# our archive before executing subdirs. That way, when $(AR) is
-# run in the subdirs, it'll bump the generic top-level objects
-# out of our archive in favor of the machine-specific ones.
-all: version.h $(LIBPTHREAD) subdirs
+$(COBJ-LIBC-ST): %.o : %.c
+ $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -c $< -o $@
-version.h:
- @echo "#define VERSION \""$(VERSION)"\"" > version.h
+$(COBJ-LIBC-SH): %.os : %.c
+ $(CC) $(CFLAGS-$<) $(CFLAGS-LIBC) -DSHARED -c $< -o $@
-$(LIBPTHREAD) ar-target: $(OBJS)
- $(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS)
-
-$(COBJS): %.o : %.c
- $(CC) $(CFLAGS) -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 $*.o
+ $(STRIPTOOL) -X --strip-debug -R .note -R .comment \
+ $(COBJ-LIBC-ST) $(COBJ-LIBC-SH)
else
- $(STRIPTOOL) -x -R .note -R .comment $*.o
+ $(STRIPTOOL) -x -R .note -R .comment \
+ $(COBJ-LIBC-ST) $(COBJ-LIBC-SH)
endif
+ @for objfile in $(COBJ-LIBC-ST); do \
+ echo ../libpthread/nptl/$$objfile >> $(PTCOBJST); \
+ done
+ @for objfile in $(COBJ-LIBC-SH); do \
+ echo ../libpthread/nptl/$$objfile >> $(PTCOBJSH); \
+ done
+ $(MAKE) -C sysdeps/$(TARGET_ARCH) $@
+ $(MAKE) -C sysdeps/unix/sysv/linux $@
+ $(MAKE) -C sysdeps/unix/sysv/linux/$(TARGET_ARCH) $@
clean: subdirs_clean
- $(RM) *.[oa] *~ core version.h
+ $(RM) *.o *.os *~ core banner.h version.h
subdirs: $(patsubst %, _dir_%, $(DIRS))
subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
-$(patsubst %, _dir_%, $(DIRS)): $(LIBPTHREAD)
+$(patsubst %, _dir_%, $(DIRS)):
$(MAKE) -C $(patsubst _dir_%, %, $@)
$(patsubst %, _dirclean_%, $(DIRS)):
Modified: branches/uClibc-nptl/libpthread/nptl/Rules.mak
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/Rules.mak 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libpthread/nptl/Rules.mak 2005-08-09 05:57:05 UTC (rev 11079)
@@ -5,9 +5,9 @@
LIBPTHREAD_STATIC_ARCHIVE := libpthread.a
LIBPTHREAD_SHARED_ARCHIVE := libpthread-shared.a
-CFLAGS-NPTL := $(CFLAGS:-O0=-O2) \
- -I$(PTDIR) \
- -I$(TOPDIR)ldso/include \
- -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -std=gnu99
+CFLAGS-LIBC := $(CFLAGS:-O0=-O2) -I$(PTDIR) -I$(TOPDIR)ldso/include \
+ -std=gnu99
+ASFLAGS-LIBC := $(filter-out -std=gnu99, $(CFLAGS-LIBC)) -D__ASSEMBLER__
-ASFLAGS-NPTL := $(filter-out -std=gnu99, $(CFLAGS-NPTL)) -D__ASSEMBLER__
+CFLAGS-LIBP := $(CFLAGS-LIBC) -DNOT_IN_libc=1 -DIS_IN_libpthread=1
+ASFLAGS-LIBP := $(filter-out -std=gnu99, $(CFLAGS-LIBP)) -D__ASSEMBLER__
Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -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 at 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))
-OBJS = $(SOBJS)
+AOBJ-LIBP-ST = $(patsubst %.S, %.o, $(wildcard *.S))
+AOBJ-LIBP-SH = $(patsubst %.S, %.os, $(wildcard *.S))
-all: $(OBJS)
+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)
-$(SOBJS): %.o : %.S
- echo $(PTDIR)
- $(CC) $(ASFLAGS) -c $< -o $@
+$(AOBJ-LIBP-ST): %.o : %.S
+ $(CC) $(ASFLAGS) $(ASFLAGS-NPTL) -c $< -o $@
+$(AOBJ-LIBP-SH): %.os : %.S
+ $(CC) $(ASFLAGS) $(ASFLAGS-NPTL) -DSHARED -c $< -o $@
+
+$(COBJ-LIBC-ST): %.o : %.c
+ $(CC) $(CFLAGS-LIBC) -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
Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -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 at redhat.com>, 2002.
+# Makefile for uClibc NPTL pthread library (pthread)
+#
+# Copyright (C) 2005 Steven J. Hill <sjhill at 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.
+#
+# 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
-# 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.
+COBJ-LIBP-ST = $(patsubst %.c, %.o, $(CSRC))
+COBJ-LIBP-SH = $(patsubst %.c, %.os, $(CSRC))
-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
+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),nptl)
-libpthread-sysdep_routines += errno-loc
-endif
+$(COBJ-LIBP-ST): %.o : %.c
+ $(CC) $(CFLAGS-LIBP) -c $< -o $@
-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
+$(COBJ-LIBP-SH): %.os : %.c
+ $(CC) $(CFLAGS-LIBP) -DSHARED -c $< -o $@
-ifeq (yes,$(build-shared))
-$(objpfx)tst-timer: $(objpfx)librt.so $(shared-thread-library)
-else
-$(objpfx)tst-timer: $(objpfx)librt.a $(static-thread-library)
-endif
-
-ifeq ($(have-forced-unwind),yes)
-tests += tst-mqueue8x
-CFLAGS-tst-mqueue8x.c += -fexceptions
-endif
-endif
-
-ifeq ($(subdir),posix)
-CFLAGS-confstr.c += -DLIBPTHREAD_VERSION='"NPTL $(version)"'
-endif
+clean:
+ $(RM) *.o *.os *~ core
Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -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 at redhat.com>, 2002.
+# Makefile for uClibc NPTL pthread library (Linux files)
+#
+# Copyright (C) 2005 Steven J. Hill <sjhill at 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
-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 = $(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)
+
+$(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
Modified: branches/uClibc-nptl/utils/Makefile
===================================================================
--- branches/uClibc-nptl/utils/Makefile 2005-08-09 05:55:16 UTC (rev 11078)
+++ branches/uClibc-nptl/utils/Makefile 2005-08-09 05:57:05 UTC (rev 11079)
@@ -43,22 +43,22 @@
readelf.c ldconfig.c ldd.c: headers
readelf: readelf.c
- $(CC) $(CFLAGS) $^ -o $@
- $(STRIPTOOL) -s -x -R .note -R .comment $@
+ $(CC) $(CFLAGS) -Wl,-s $^ -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $@
ldconfig: ldconfig.c
- $(CC) $(CFLAGS) $(if $(filter $(UCLIBC_STATIC_LDCONFIG),y),-static) \
+ $(CC) $(CFLAGS) -Wl,-s $(if $(filter $(UCLIBC_STATIC_LDCONFIG),y),-static) \
-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
$^ -o $@
- $(STRIPTOOL) -s -x -R .note -R .comment $@
+ $(STRIPTOOL) -x -R .note -R .comment $@
ldd: ldd.c
- $(CC) $(CFLAGS) $(PIEFLAG) \
+ $(CC) $(CFLAGS) $(PIEFLAG) -Wl,-s \
-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
$^ -o $@
- $(STRIPTOOL) -s -x -R .note -R .comment $@
+ $(STRIPTOOL) -x -R .note -R .comment $@
iconv: ../libc/misc/wchar/wchar.c
$(CC) $(CFLAGS) $(PIEFLAG) -Wl,-s \
More information about the uClibc-cvs
mailing list