|
@@ -7,107 +7,147 @@
|
|
|
|
|
|
subdirs += libpthread/nptl
|
|
subdirs += libpthread/nptl
|
|
|
|
|
|
-libpthread-routines-y = init vars events version \
|
|
+libpthread_DIR = $(top_srcdir)libpthread/nptl
|
|
- pthread_create pthread_exit pthread_detach \
|
|
+libpthread_OUT = $(top_builddir)libpthread/nptl
|
|
- pthread_join pthread_tryjoin pthread_timedjoin \
|
|
+
|
|
- pthread_self pthread_equal pthread_yield \
|
|
+include $(libpthread_DIR)/sysdeps/Makefile.in
|
|
- pthread_getconcurrency pthread_setconcurrency \
|
|
+
|
|
- pthread_getschedparam pthread_setschedparam \
|
|
+libc-shared-routines-y = forward.c libc-cancellation.c
|
|
- pthread_setschedprio \
|
|
+libc-static-routines-y = alloca_cutoff.c libc-cancellation.c
|
|
- pthread_attr_init pthread_attr_destroy \
|
|
+libpthread-shared-only-routines-y = version.c #pt-allocrtsig unwind-forcedunwind
|
|
- pthread_attr_getdetachstate pthread_attr_setdetachstate \
|
|
+libpthread-static-only-routines-y = pthread_atfork.c
|
|
- pthread_attr_getguardsize pthread_attr_setguardsize \
|
|
+libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files
|
|
- pthread_attr_getschedparam pthread_attr_setschedparam \
|
|
+libpthread-routines- += allocatestack.c # dummy included by pthread_create.c
|
|
- pthread_attr_getschedpolicy pthread_attr_setschedpolicy \
|
|
+libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them!
|
|
- pthread_attr_getinheritsched \
|
|
+libpthread-routines-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += res.c
|
|
- pthread_attr_setinheritsched \
|
|
+libpthread-routines-$(UCLIBC_SUSV4_LEGACY) += pthread_getconcurrency.c \
|
|
- pthread_attr_getscope pthread_attr_setscope \
|
|
+ pthread_setconcurrency
|
|
- pthread_attr_getstackaddr pthread_attr_setstackaddr \
|
|
+libpthread_CSRC = $(filter-out $(libpthread-routines-) \
|
|
- pthread_attr_getstacksize pthread_attr_setstacksize \
|
|
+ $(libc-shared-routines-y) \
|
|
- pthread_attr_getstack pthread_attr_setstack \
|
|
+ $(libc-static-routines-y) \
|
|
- pthread_getattr_np \
|
|
+ $(libpthread-shared-only-routines-y) \
|
|
- pthread_mutex_init pthread_mutex_destroy \
|
|
+ $(libpthread-static-only-routines-y) \
|
|
- pthread_mutex_lock pthread_mutex_trylock \
|
|
+ $(notdir $(libpthread_OBJS:.o=.c)), \
|
|
- pthread_mutex_timedlock pthread_mutex_unlock \
|
|
+ $(notdir $(wildcard $(libpthread_DIR)/*.c)))
|
|
- pthread_mutex_consistent \
|
|
+
|
|
- pthread_mutexattr_init pthread_mutexattr_destroy \
|
|
+libpthread_OBJS += $(addprefix $(libpthread_OUT)/,$(libpthread_CSRC:.c=.o))
|
|
- pthread_mutexattr_getpshared \
|
|
+libpthread-so-y += $(addprefix $(libpthread_OUT)/,$(libpthread-shared-only-routines-y:.c=.oS))
|
|
- pthread_mutexattr_setpshared \
|
|
+libpthread-so-y += $(libpthread_OBJS:.o=.oS)
|
|
- pthread_mutexattr_getrobust \
|
|
+libpthread-nonshared-y := $(addprefix $(libpthread_OUT)/,$(libpthread-static-only-routines-y:.c=.oS))
|
|
- pthread_mutexattr_setrobust \
|
|
+libpthread-static-y := $(addprefix $(libpthread_OUT)/,$(libpthread-static-only-routines-y:.c=.o))
|
|
- pthread_mutexattr_getprotocol \
|
|
+libpthread-static-y += $(libpthread_OBJS)
|
|
- pthread_mutexattr_setprotocol \
|
|
+ifeq ($(DOPIC),y)
|
|
- pthread_mutexattr_getprioceiling \
|
|
+libpthread-a-y := $(libpthread-static-y:.o=.os)
|
|
- pthread_mutexattr_setprioceiling \
|
|
+else
|
|
- pthread_mutexattr_gettype pthread_mutexattr_settype \
|
|
+libpthread-a-y := $(libpthread-static-y)
|
|
- pthread_rwlock_init pthread_rwlock_destroy \
|
|
+endif
|
|
- pthread_rwlock_rdlock pthread_rwlock_timedrdlock \
|
|
+
|
|
- pthread_rwlock_wrlock pthread_rwlock_timedwrlock \
|
|
+libc-shared-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-shared-routines-y))
|
|
- pthread_rwlock_tryrdlock pthread_rwlock_trywrlock \
|
|
+libc-static-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-static-routines-y))
|
|
- pthread_rwlock_unlock \
|
|
+libc-shared-routines-y := $(addprefix $(libpthread_OUT)/,$(libc-shared-routines-y:.c=.oS))
|
|
- pthread_rwlockattr_init pthread_rwlockattr_destroy \
|
|
+libc-static-routines-y := $(addprefix $(libpthread_OUT)/,$(libc-static-routines-y:.c=.o))
|
|
- pthread_rwlockattr_getpshared \
|
|
+libc-shared-y += $(libc-shared-routines-y) $(libpthread_libc_OBJS:.o=.oS)
|
|
- pthread_rwlockattr_setpshared \
|
|
+ifeq ($(DOPIC),y)
|
|
- pthread_rwlockattr_getkind_np \
|
|
+libc-static-y += $(libc-static-routines-y:.o=.os) $(libpthread_libc_a_OBJS:.o=.os) # $(libpthread_ld_tls_COBJ:.o=.os)
|
|
- pthread_rwlockattr_setkind_np \
|
|
+else
|
|
- pthread_cond_init pthread_cond_destroy \
|
|
+libc-static-y += $(libc-static-routines-y) $(libpthread_libc_a_OBJS) # $(libpthread_ld_tls_COBJ)
|
|
- pthread_cond_wait pthread_cond_timedwait \
|
|
+endif
|
|
- pthread_cond_signal pthread_cond_broadcast \
|
|
+
|
|
- pthread_condattr_init pthread_condattr_destroy \
|
|
+librt-pt-routines-y := $(patsubst %.c,$(libpthread_pthread_OUT)/%.o,$(filter-out $(notdir $(libpthread_librt_OBJS:.o=.c)), $(librt-pt-routines-y)))
|
|
- pthread_condattr_getpshared pthread_condattr_setpshared \
|
|
+librt-pt-shared-only-routines-y := $(patsubst %.c,$(libpthread_pthread_OUT)/%.o,$(filter-out $(notdir $(libpthread_librt_OBJS:.o=.c)), $(librt-pt-shared-only-routines-y)))
|
|
- pthread_condattr_getclock pthread_condattr_setclock \
|
|
+librt_OBJS = $(libpthread_librt_OBJS) $(librt-pt-routines-y)
|
|
- pthread_spin_init pthread_spin_destroy \
|
|
+ifeq ($(DOPIC),y)
|
|
- pthread_spin_lock pthread_spin_trylock \
|
|
+librt-a-y += $(librt_OBJS:.o=.os)
|
|
- pthread_spin_unlock \
|
|
+else
|
|
- pthread_barrier_init pthread_barrier_destroy \
|
|
+librt-a-y += $(librt_OBJS)
|
|
- pthread_barrier_wait \
|
|
+endif
|
|
- pthread_barrierattr_init pthread_barrierattr_destroy \
|
|
+librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)
|
|
- pthread_barrierattr_getpshared \
|
|
+
|
|
- pthread_barrierattr_setpshared \
|
|
+ifneq ($(UCLIBC_CTOR_DTOR),y)
|
|
- pthread_key_create pthread_key_delete \
|
|
+START_FILE-libpthread.so := $(top_builddir)/libpthread/nptl/sysdeps/pthread/crti.o $(SHARED_START_FILES)
|
|
- pthread_getspecific pthread_setspecific \
|
|
+END_FILE-libpthread.so := $(SHARED_END_FILES) $(top_builddir)/libpthread/nptl/sysdeps/pthread/crtn.o
|
|
- pthread_sigmask pthread_kill \
|
|
+endif
|
|
- pthread_cancel pthread_testcancel \
|
|
+
|
|
- pthread_setcancelstate pthread_setcanceltype \
|
|
+libpthread_FULL_NAME := libpthread-$(VERSION).so
|
|
- pthread_once \
|
|
+lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
|
|
- pthread_atfork \
|
|
+lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
|
|
- pthread_getcpuclockid \
|
|
+
|
|
- pthread_clock_gettime pthread_clock_settime \
|
|
+$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(libdl.depend) $(top_builddir)lib/libpthread_nonshared.a
|
|
- sem_init sem_destroy \
|
|
+ $(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
|
|
- sem_open sem_close sem_unlink \
|
|
+ $(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
|
|
- sem_getvalue \
|
|
+ $(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
|
|
- sem_wait sem_trywait sem_timedwait sem_post \
|
|
+ $(Q)mv $@.tmp $@
|
|
- cleanup cleanup_defer cleanup_compat \
|
|
+
|
|
- cleanup_defer_compat unwind \
|
|
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
|
|
- pt-longjmp pt-cleanup\
|
|
+$(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
|
|
- cancellation \
|
|
+endif
|
|
- lowlevellock \
|
|
+$(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
|
|
- pt-vfork \
|
|
+ $(Q)$(RM) $@
|
|
- ptw-write ptw-read ptw-close ptw-fcntl ptw-accept \
|
|
+ $(do_ar)
|
|
- ptw-connect ptw-recv ptw-recvfrom ptw-recvmsg ptw-send \
|
|
+
|
|
- ptw-sendmsg ptw-sendto ptw-fsync ptw-lseek ptw-llseek \
|
|
+$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
|
|
- ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
|
|
+ $(Q)$(INSTALL) -d $(dir $@)
|
|
- ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
|
|
+ $(Q)$(RM) $@
|
|
- ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
|
|
+ $(do_ar)
|
|
- ptw-sigwait \
|
|
+
|
|
- pt-raise pt-system \
|
|
+#
|
|
- flockfile ftrylockfile funlockfile \
|
|
+# Create 'pthread-errnos.h' header file.
|
|
- sigaction \
|
|
+#
|
|
- errno_location \
|
|
+CFLAGS-gen_pthread-errnos.c = -S
|
|
- herrno \
|
|
+
|
|
- pthread_kill_other_threads \
|
|
+$(libpthread_OUT)/gen_pthread-errnos.c: $(libpthread_DIR)/pthread-errnos.sym | $(libpthread_OUT)
|
|
- pthread_getaffinity pthread_setaffinity \
|
|
+ $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
|
|
- pthread_attr_getaffinity pthread_attr_setaffinity \
|
|
+
|
|
- cleanup_routine unwind-forcedunwind
|
|
+$(libpthread_OUT)/gen_pthread-errnos.s: $(libpthread_OUT)/gen_pthread-errnos.c | headers
|
|
-libpthread-routines-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += res
|
|
+ $(compile.c)
|
|
-
|
|
+libpthread-generated-y += $(libpthread_OUT)/gen_pthread-errnos.s
|
|
-libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind
|
|
+$(libpthread_OUT)/pthread-errnos.h: $(libpthread_OUT)/gen_pthread-errnos.s
|
|
-
|
|
+ $(do_sed) $(PTHREAD_GENERATE_MANGLE) $< > $@
|
|
-ifeq ($(TARGET_ARCH),x86_64)
|
|
+ @if test ! -s $@ ; then rm -f $@ ; false ; fi
|
|
-libpthread-routines-y := $(filter-out cancellation,$(libpthread-routines-y))
|
|
+
|
|
|
|
+pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread_OUT)/pthread-errnos.h
|
|
|
|
+
|
|
|
|
+headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(nptl_headers_bootstrap)
|
|
|
|
+
|
|
|
|
+libpthread_H := $(addprefix $(top_builddir)include/,semaphore.h)
|
|
|
|
+libpthread_include_H := $(addprefix $(top_builddir)include/,pthread.h)
|
|
|
|
+libpthread_include_BITS_H := $(addprefix $(top_builddir)include/bits/,libc-lock.h stdio-lock.h)
|
|
|
|
+libpthread_include_STD_IMPL_OS_ARCH_BITS_H := $(addprefix $(top_builddir)include/bits/,pthreadtypes.h semaphore.h)
|
|
|
|
+
|
|
|
|
+$(libpthread_include_STD_IMPL_OS_ARCH_BITS_H): $(top_builddir)include/bits/%:
|
|
|
|
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/$(@F) $@
|
|
|
|
+$(libpthread_include_BITS_H): $(top_builddir)include/bits/%:
|
|
|
|
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
|
|
|
|
+$(libpthread_include_H): $(top_builddir)include/%:
|
|
|
|
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
|
|
|
|
+$(libpthread_H): $(top_builddir)include/%:
|
|
|
|
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
|
|
|
|
+
|
|
|
|
+nptl_headers_bootstrap = $(libpthread_H) $(libpthread_include_H) $(libpthread_include_BITS_H) $(libpthread_include_STD_IMPL_OS_ARCH_BITS_H)
|
|
|
|
+
|
|
|
|
+objclean-y += CLEAN_libpthread/nptl
|
|
|
|
+headers_clean-y += HEADERCLEAN_libpthread/nptl
|
|
|
|
+
|
|
|
|
+HEADERCLEAN_libpthread/nptl:
|
|
|
|
+ $(do_rm) $(nptl_headers_bootstrap) \
|
|
|
|
+ $(addprefix $(libpthread_OUT)/gen_pthread-errnos., c s) \
|
|
|
|
+ $(libpthread_OUT)/pthread-errnos.h
|
|
|
|
+
|
|
|
|
+CLEAN_libpthread/nptl:
|
|
|
|
+ $(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)
|
|
|
|
+
|
|
|
|
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
|
|
|
|
+LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
|
|
|
|
+else
|
|
|
|
+LDFLAGS-libpthread.so := $(LDFLAGS)
|
|
endif
|
|
endif
|
|
|
|
|
|
-CFLAGS-pthread_atfork.c = -DNOT_IN_libc
|
|
+LDFLAGS-libpthread.so += $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so $(top_builddir)lib/libdl-$(VERSION).so \
|
|
|
|
+ -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal
|
|
|
|
+
|
|
|
|
+LIBS-libpthread.so := $(LIBS)
|
|
|
|
+
|
|
|
|
+CFLAGS-nptl = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 $(SSP_ALL_CFLAGS)
|
|
|
|
|
|
# Since cancellation handling is in large parts handled using exceptions
|
|
# Since cancellation handling is in large parts handled using exceptions
|
|
# we have to compile some files with exception handling enabled, some
|
|
# we have to compile some files with exception handling enabled, some
|
|
@@ -165,7 +205,7 @@ CFLAGS-msgrcv.c = -fexceptions -fasynchronous-unwind-tables
|
|
CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
|
|
CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
|
|
CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
|
|
CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
|
|
|
|
|
|
-CFLAGS-pt-system.c = -fexceptions -I./libc/stdlib
|
|
+CFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib
|
|
|
|
|
|
#
|
|
#
|
|
# The rest of this file is uClibc specific.
|
|
# The rest of this file is uClibc specific.
|
|
@@ -178,167 +218,7 @@ CFLAGS-pthread_barrierattr_getpshared.c = -D_GNU_SOURCE
|
|
CFLAGS-pthread_barrierattr_setpshared.c = -D_GNU_SOURCE
|
|
CFLAGS-pthread_barrierattr_setpshared.c = -D_GNU_SOURCE
|
|
CFLAGS-sem_open.c = -D_GNU_SOURCE
|
|
CFLAGS-sem_open.c = -D_GNU_SOURCE
|
|
|
|
|
|
-CFLAGS-nptl = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 $(SSP_ALL_CFLAGS)
|
|
+CFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-nptl)
|
|
-
|
|
+CFLAGS-OMIT-forward.c = $(CFLAGS-nptl)
|
|
-CFLAGS-OMIT-alloca_cutoff.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
|
|
+CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-nptl)
|
|
-CFLAGS-OMIT-forward.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
|
|
+CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-nptl)
|
|
-CFLAGS-OMIT-libc-lowlevelock.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
|
|
|
|
-CFLAGS-OMIT-libc-cancellation.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
|
|
|
|
-
|
|
|
|
-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_init pthread_barrier_destroy \
|
|
|
|
- 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
|
|
|
|
-
|
|
|
|
-ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
|
|
|
|
-LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
|
|
|
|
-else
|
|
|
|
-LDFLAGS-libpthread.so := $(LDFLAGS)
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-LDFLAGS-libpthread.so += $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so $(top_builddir)lib/libdl-$(VERSION).so -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal
|
|
|
|
-
|
|
|
|
-LIBS-libpthread.so := $(LIBS)
|
|
|
|
-
|
|
|
|
-ifneq ($(UCLIBC_CTOR_DTOR),y)
|
|
|
|
-START_FILE-libpthread.so := $(top_builddir)/libpthread/nptl/sysdeps/pthread/crti.o $(SHARED_START_FILES)
|
|
|
|
-END_FILE-libpthread.so := $(SHARED_END_FILES) $(top_builddir)/libpthread/nptl/sysdeps/pthread/crtn.o
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-libpthread_FULL_NAME := libpthread-$(VERSION).so
|
|
|
|
-
|
|
|
|
-PTHREAD_DIR := $(top_srcdir)libpthread/nptl
|
|
|
|
-PTHREAD_OUT := $(top_builddir)libpthread/nptl
|
|
|
|
-
|
|
|
|
-libpthread_static_SRC := pthread_atfork
|
|
|
|
-
|
|
|
|
-libpthread_a_SRC = $(patsubst %, $(PTHREAD_DIR)/%.c, \
|
|
|
|
- $(filter-out $(libpthread-os-routines) \
|
|
|
|
- $(libpthread-misc-routines) \
|
|
|
|
- $(libpthread-shared-only-routines), \
|
|
|
|
- $(libpthread-routines-y)))
|
|
|
|
-libpthread_so_SRC = $(patsubst %, $(PTHREAD_DIR)/%.c, \
|
|
|
|
- $(filter-out $(libpthread-os-routines) \
|
|
|
|
- $(libpthread-misc-routines), $(libpthread-routines-y)))
|
|
|
|
-
|
|
|
|
-ifeq ($(TARGET_ARCH),x86_64)
|
|
|
|
-libc-static-y += $(patsubst %.c, $(PTHREAD_OUT)/%.o, alloca_cutoff.c)
|
|
|
|
-libc-shared-y += $(patsubst %.c, $(PTHREAD_OUT)/%.oS, forward.c)
|
|
|
|
-else
|
|
|
|
-libc-static-y += $(patsubst %.c, $(PTHREAD_OUT)/%.o, alloca_cutoff.c \
|
|
|
|
- libc-cancellation.c)
|
|
|
|
-libc-shared-y += $(patsubst %.c, $(PTHREAD_OUT)/%.oS, forward.c \
|
|
|
|
- libc-cancellation.c)
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-libpthread-nonshared-y += $(patsubst %,$(PTHREAD_OUT)/%.oS,$(libpthread_static_SRC))
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-ifeq ($(DOPIC),y)
|
|
|
|
-libpthread-a-y := $(patsubst $(PTHREAD_DIR)/%.c,$(PTHREAD_OUT)/%.os,$(libpthread_a_SRC))
|
|
|
|
-else
|
|
|
|
-libpthread-a-y := $(patsubst $(PTHREAD_DIR)/%.c,$(PTHREAD_OUT)/%.o,$(libpthread_a_SRC))
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-libpthread-so-y := $(patsubst $(PTHREAD_DIR)/%.c,$(PTHREAD_OUT)/%.oS,$(libpthread_so_SRC))
|
|
|
|
-libpthread-static-y += $(patsubst $(PTHREAD_DIR)/%.c,$(PTHREAD_OUT)/%.o,$(libpthread_a_SRC) $(libpthread_static_SRC))
|
|
|
|
-
|
|
|
|
-objclean-y += CLEAN_libpthread/nptl
|
|
|
|
-headers_clean-y += HEADERCLEAN_libpthread/nptl
|
|
|
|
-
|
|
|
|
--include $(PTHREAD_DIR)/sysdeps/generic/Makefile.in
|
|
|
|
--include $(PTHREAD_DIR)/sysdeps/pthread/Makefile.in
|
|
|
|
--include $(PTHREAD_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
|
|
|
|
--include $(PTHREAD_DIR)/sysdeps/Makefile.commonarch
|
|
|
|
--include $(PTHREAD_DIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/Makefile.arch
|
|
|
|
--include $(PTHREAD_DIR)/sysdeps/unix/sysv/linux/Makefile.commonarch
|
|
|
|
-
|
|
|
|
-lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
|
|
|
|
-lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
|
|
|
|
-
|
|
|
|
-$(top_builddir)lib/libpthread.so: $(PTHREAD_OUT)/libpthread_so.a $(libc.depend) $(libdl.depend) $(top_builddir)lib/libpthread_nonshared.a
|
|
|
|
- $(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
|
|
|
|
- $(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
|
|
|
|
- $(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
|
|
|
|
- $(Q)mv $@.tmp $@
|
|
|
|
-
|
|
|
|
-ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
|
|
|
|
-$(PTHREAD_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
|
|
|
|
-endif
|
|
|
|
-$(PTHREAD_OUT)/libpthread_so.a: $(libpthread-so-y)
|
|
|
|
- $(Q)$(RM) $@
|
|
|
|
- $(do_ar)
|
|
|
|
-
|
|
|
|
-$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
|
|
|
|
- $(Q)$(INSTALL) -d $(dir $@)
|
|
|
|
- $(Q)$(RM) $@
|
|
|
|
- $(do_ar)
|
|
|
|
-
|
|
|
|
-#
|
|
|
|
-# Create 'pthread-errnos.h' header file.
|
|
|
|
-#
|
|
|
|
-CFLAGS-pthread-errnos.c = -S
|
|
|
|
-
|
|
|
|
-$(PTHREAD_OUT)/pthread-errnos.c: $(PTHREAD_DIR)/pthread-errnos.sym
|
|
|
|
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
|
|
|
|
-
|
|
|
|
-$(PTHREAD_OUT)/pthread-errnos.s: $(PTHREAD_OUT)/pthread-errnos.c
|
|
|
|
- $(compile.c)
|
|
|
|
-
|
|
|
|
-$(PTHREAD_OUT)/pthread-errnos.h: $(PTHREAD_OUT)/pthread-errnos.s
|
|
|
|
- $(do_sed) -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $@
|
|
|
|
-
|
|
|
|
-pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(PTHREAD_OUT)/pthread-errnos.h
|
|
|
|
-
|
|
|
|
-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(nptl_headers_bootstrap)
|
|
|
|
-
|
|
|
|
-LIBPTHREAD_H := $(addprefix $(top_builddir)include/,semaphore.h)
|
|
|
|
-LIBPTHREAD_INCLUDE_H := $(addprefix $(top_builddir)include/,pthread.h)
|
|
|
|
-LIBPTHREAD_INCLUDE_BITS_H := $(addprefix $(top_builddir)include/bits/,libc-lock.h stdio-lock.h)
|
|
|
|
-LIBPTHREAD_INCLUDE_STD_IMPL_OS_ARCH_BITS_H := $(addprefix $(top_builddir)include/bits/,pthreadtypes.h semaphore.h)
|
|
|
|
-
|
|
|
|
-$(LIBPTHREAD_INCLUDE_STD_IMPL_OS_ARCH_BITS_H): $(top_builddir)include/bits/%: | $(top_builddir)include/bits
|
|
|
|
- $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/$(@F) $@
|
|
|
|
-$(LIBPTHREAD_INCLUDE_BITS_H): $(top_builddir)include/bits/%: | $(top_builddir)include/bits
|
|
|
|
- $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
|
|
|
|
-$(LIBPTHREAD_INCLUDE_H): $(top_builddir)include/%: | $(top_builddir)include
|
|
|
|
- $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
|
|
|
|
-$(LIBPTHREAD_H): $(top_builddir)include/%: | $(top_builddir)include
|
|
|
|
- $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
|
|
|
|
-
|
|
|
|
-nptl_headers_bootstrap = $(LIBPTHREAD_H) $(LIBPTHREAD_INCLUDE_H) $(LIBPTHREAD_INCLUDE_BITS_H) $(LIBPTHREAD_INCLUDE_STD_IMPL_OS_ARCH_BITS_H)
|
|
|
|
-
|
|
|
|
-HEADERCLEAN_libpthread/nptl:
|
|
|
|
- $(do_rm) $(nptl_headers_bootstrap) \
|
|
|
|
- $(addprefix $(PTHREAD_OUT)/pthread-errnos., c h s)
|
|
|
|
-
|
|
|
|
-CLEAN_libpthread/nptl:
|
|
|
|
- $(do_rm) $(addprefix $(PTHREAD_OUT)/*., o os oS a)
|
|
|