summaryrefslogtreecommitdiff
path: root/libpthread/nptl
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-06-12 13:29:14 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-07-06 18:33:22 +0200
commitc06619d7ab2ebbbc93427ca6a49dcc8d479db549 (patch)
treedcacc00551066b7c1881c0bc33e8d63383eee63d /libpthread/nptl
parenta8f396655b8cca3518ac20d07246d91eb138ce07 (diff)
nptl: simplify buildsys
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libpthread/nptl')
-rw-r--r--libpthread/nptl/Makefile.in3
-rw-r--r--libpthread/nptl/sysdeps/Makefile.commonarch57
-rw-r--r--libpthread/nptl/sysdeps/arm/Makefile.arch47
-rw-r--r--libpthread/nptl/sysdeps/generic/Makefile.in18
-rw-r--r--libpthread/nptl/sysdeps/i386/Makefile.arch40
-rw-r--r--libpthread/nptl/sysdeps/mips/Makefile.arch46
-rw-r--r--libpthread/nptl/sysdeps/powerpc/Makefile.arch41
-rw-r--r--libpthread/nptl/sysdeps/sh/Makefile.arch39
-rw-r--r--libpthread/nptl/sysdeps/sparc/Makefile.arch39
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/Makefile2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch (renamed from libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in)1
-rw-r--r--libpthread/nptl/sysdeps/x86_64/Makefile.arch39
12 files changed, 66 insertions, 306 deletions
diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
index da0568985..b32ee3fe7 100644
--- a/libpthread/nptl/Makefile.in
+++ b/libpthread/nptl/Makefile.in
@@ -279,8 +279,9 @@ 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/unix/sysv/linux/Makefile.in
+-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
diff --git a/libpthread/nptl/sysdeps/Makefile.commonarch b/libpthread/nptl/sysdeps/Makefile.commonarch
new file mode 100644
index 000000000..669e9d318
--- /dev/null
+++ b/libpthread/nptl/sysdeps/Makefile.commonarch
@@ -0,0 +1,57 @@
+# Makefile template to be included by libpthread/nptl/sysdeps/<ARCH>/Makefile.arch
+#
+# Copyright (C) 2010 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/$(TARGET_ARCH)
+PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/$(TARGET_ARCH)
+
+PTHREAD_ARCH_CSRC := $(patsubst %.c,$(PTHREAD_ARCH_DIR)/%.c,$(libpthread_CSRC))
+PTHREAD_ARCH_COBJ := $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
+PTHREAD_ARCH_SSRC := $(patsubst %.s,$(PTHREAD_ARCH_DIR)/%.s,$(patsubst %.S,$(PTHREAD_ARCH_DIR)/%.S,$(libpthread_SSRC)))
+PTHREAD_ARCH_SOBJ := $(patsubst %.s,$(PTHREAD_ARCH_OUT)/%.o,$(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC)))
+PTHREAD_ARCH_OBJS := $(PTHREAD_ARCH_COBJ) $(PTHREAD_ARCH_SOBJ)
+
+LIBRT_ARCH_COBJ := $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(librt_CSRC))
+LIBRT_ARCH_SOBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(librt_SSRC))
+LIBRT_ARCH_OBJS := $(LIBRT_ARCH_COBJ) $(LIBRT_ARCH_SOBJ)
+
+LIBC_ARCH_COBJ := $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libc_a_CSRC))
+LIBC_ARCH_SOBJ := $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libc_a_SSRC))
+LIBC_ARCH_OBJS := $(LIBC_ARCH_COBJ) $(LIBC_ARCH_SOBJ)
+
+PTHREAD_LIBC_TLS_CSRC := $(filter-out $(notdir $(PTHREAD_ARCH_OBJS:.o=.c)),$(notdir $(PTHREAD_LIBC_TLS_CSRC)))
+PTHREAD_OBJS := $(PTHREAD_ARCH_OBJS)
+
+libpthread-a-y += $(if $(DOPIC),$(PTHREAD_OBJS:.o=.os),$(PTHREAD_OBJS))
+libpthread-so-y += $(PTHREAD_OBJS:.o=.oS)
+
+librt-a-y += $(LIBRT_ARCH_OBJS)
+librt-so-y += $(LIBRT_ARCH_OBJS:.o=.oS)
+
+libc-static-y += $(LIBC_ARCH_OBJS) $(PTHREAD_LIBC_TLS_OBJS)
+
+CFLAGS-tcb-offsets.c = -S
+$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym | $(PTHREAD_ARCH_OUT)
+ $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
+
+$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
+ $(compile.c)
+
+PTHREAD_TCB_OFFSET_MANGLE ?= -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*\$$/\#define \1 \2/p"
+$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
+ $(do_sed) $(PTHREAD_TCB_OFFSET_MANGLE) $< > $@
+ @if test ! -s $@ ; then rm -f $@ ; false ; fi
+
+pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(PTHREAD_ARCH_OUT)/tcb-offsets.h
+
+objclean-y += CLEAN_$(subst $(top_builddir),,$(PTHREAD_ARCH_OUT))
+headers_clean-y+= HEADERCLEAN_$(subst $(top_builddir),,$(PTHREAD_ARCH_OUT))
+
+CLEAN_$(subst $(top_builddir),,$(PTHREAD_ARCH_OUT)):
+ $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)
+HEADERCLEAN_$(subst $(top_builddir),,$(PTHREAD_ARCH_OUT)):
+ $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c h s)
+
diff --git a/libpthread/nptl/sysdeps/arm/Makefile.arch b/libpthread/nptl/sysdeps/arm/Makefile.arch
index 8b4ce70e4..87e81896a 100644
--- a/libpthread/nptl/sysdeps/arm/Makefile.arch
+++ b/libpthread/nptl/sysdeps/arm/Makefile.arch
@@ -22,50 +22,3 @@ ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
ASFLAGS-aeabi_read_tp.S = -DNOT_IN_libc=1
CFLAGS-arm = $(SSP_ALL_CFLAGS)
-
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/arm
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/arm
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
-LIBRT_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(librt_SSRC))
-LIBRT_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(librt_CSRC))
-
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-librt-a-y += $(LIBRT_ARCH_OBJ)
-librt-so-y += $(LIBRT_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
-objclean-y += nptl_arch_objclean
-headers_clean-y += nptl_arch_headers_clean
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_headers_clean:
- $(RM) $(PTHREAD_ARCH_OUT)/tcb-offsets.c \
- $(PTHREAD_ARCH_OUT)/tcb-offsets.s \
- $(PTHREAD_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_objclean:
- $(RM) $(PTHREAD_ARCH_OUT)/*.{o,os,oS}
diff --git a/libpthread/nptl/sysdeps/generic/Makefile.in b/libpthread/nptl/sysdeps/generic/Makefile.in
index 96bf2ac6d..2091dca0a 100644
--- a/libpthread/nptl/sysdeps/generic/Makefile.in
+++ b/libpthread/nptl/sysdeps/generic/Makefile.in
@@ -10,22 +10,16 @@
# their architecture specific directory which will override
# the one here.
#
-ifneq ($(TARGET_ARCH),mips)
- libc_a_CSRC = libc-tls.c
-endif
-CFLAGS-generic = $(SSP_ALL_CFLAGS)
-#CFLAGS:=$(CFLAGS:-O1=-O2)
-
-PTHREAD_GENERIC_OUT:=$(top_builddir)libpthread/nptl/sysdeps/generic
+PTHREAD_LIBC_TLS_DIR := $(top_srcdir)libpthread/nptl/sysdeps/generic
+PTHREAD_LIBC_TLS_OUT := $(top_builddir)libpthread/nptl/sysdeps/generic
-LIBC_GENERIC_OBJ:=$(patsubst %.c,$(PTHREAD_GENERIC_OUT)/%.o,$(libc_a_CSRC))
+PTHREAD_LIBC_TLS_CSRC = dl-tls.c libc-tls.c
+PTHREAD_LIBC_TLS_OBJS = $(patsubst %.c,$(PTHREAD_LIBC_TLS_OUT)/%.o,$(PTHREAD_LIBC_TLS_CSRC))
-libc-static-y+=$(LIBC_GENERIC_OBJ)
-
-libc-nomulti-y+=$(LIBC_GENERIC_OBJ)
+CFLAGS-generic = $(SSP_ALL_CFLAGS)
objclean-y += CLEAN_libpthread/nptl/sysdeps/generic
CLEAN_libpthread/nptl/sysdeps/generic:
- $(do_rm) $(addprefix $(PTHREAD_GENERIC_OUT)/*., o os oS)
+ $(do_rm) $(addprefix $(PTHREAD_LIBC_TLS_OUT)/*., o os oS)
diff --git a/libpthread/nptl/sysdeps/i386/Makefile.arch b/libpthread/nptl/sysdeps/i386/Makefile.arch
index bc0117489..03b9972eb 100644
--- a/libpthread/nptl/sysdeps/i386/Makefile.arch
+++ b/libpthread/nptl/sysdeps/i386/Makefile.arch
@@ -11,43 +11,3 @@ libpthread_SSRC = i486/pthread_spin_trylock.S
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
CFLAGS-i386 = $(SSP_ALL_CFLAGS)
-#CFLAGS:=$(CFLAGS:-O1=-O2)
-
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/i386
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/i386
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
-objclean-y += CLEAN_libpthread/nptl/sysdeps/i386
-headers_clean-y += HEADERCLEAN_libpthread/nptl/sysdeps/i386
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-HEADERCLEAN_libpthread/nptl/sysdeps/i386:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
-
-CLEAN_libpthread/nptl/sysdeps/i386:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)
diff --git a/libpthread/nptl/sysdeps/mips/Makefile.arch b/libpthread/nptl/sysdeps/mips/Makefile.arch
index 2992f35f1..7b6bfd48e 100644
--- a/libpthread/nptl/sysdeps/mips/Makefile.arch
+++ b/libpthread/nptl/sysdeps/mips/Makefile.arch
@@ -19,50 +19,4 @@ ASFLAGS-nptl-sysdep.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1 \
-I$(top_srcdir)libc/sysdeps/linux/mips
CFLAGS-mips = $(SSP_ALL_CFLAGS)
-#CFLAGS:=$(CFLAGS:-O1=-O2)
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/mips
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/mips
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
-LIBC_ARCH_OBJ := $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libc_a_CSRC))
-
-libc-static-y += $(LIBC_ARCH_OBJ)
-
-libc-nomulti-y += $(LIBC_ARCH_OBJ)
-
-objclean-y += nptl_arch_objclean
-headers_clean-y += nptl_arch_headers_clean
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_headers_clean:
- $(RM) $(PTHREAD_ARCH_OUT)/tcb-offsets.c \
- $(PTHREAD_ARCH_OUT)/tcb-offsets.s \
- $(PTHREAD_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_objclean:
- $(RM) $(PTHREAD_ARCH_OUT)/*.{o,os,oS}
diff --git a/libpthread/nptl/sysdeps/powerpc/Makefile.arch b/libpthread/nptl/sysdeps/powerpc/Makefile.arch
index 71695c88b..48a54cc73 100644
--- a/libpthread/nptl/sysdeps/powerpc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/powerpc/Makefile.arch
@@ -5,48 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/powerpc
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/powerpc
-
libpthread_SSRC =
libpthread_CSRC = pthread_spin_lock.c pthread_spin_trylock.c
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
CFLAGS-powerpc = $(SSP_ALL_CFLAGS)
-objclean-y += nptl_arch_objclean
-headers_clean-y += nptl_arch_headers_clean
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_headers_clean:
- $(RM) $(PTHREAD_ARCH_OUT)/tcb-offsets.c \
- $(PTHREAD_ARCH_OUT)/tcb-offsets.s \
- $(PTHREAD_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_objclean:
- $(RM) $(PTHREAD_ARCH_OUT)/*.{o,os,oS}
diff --git a/libpthread/nptl/sysdeps/sh/Makefile.arch b/libpthread/nptl/sysdeps/sh/Makefile.arch
index 5c36a7992..15830f55c 100644
--- a/libpthread/nptl/sysdeps/sh/Makefile.arch
+++ b/libpthread/nptl/sysdeps/sh/Makefile.arch
@@ -14,43 +14,4 @@ ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
CFLAGS-sh = $(SSP_ALL_CFLAGS)
-#CFLAGS:=$(CFLAGS:-O1=-O2)
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/sh
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/sh
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
-objclean-y += CLEAN_libpthread/nptl/sysdeps/sh
-headers_clean-y += HEADERCLEAN_libpthread/nptl/sysdeps/sh
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-HEADERCLEAN_libpthread/nptl/sysdeps/sh:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
-
-CLEAN_libpthread/nptl/sysdeps/sh:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)
diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch b/libpthread/nptl/sysdeps/sparc/Makefile.arch
index b9b1c9cfd..3cd2e67e6 100644
--- a/libpthread/nptl/sysdeps/sparc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
@@ -11,43 +11,4 @@ libpthread_CSRC = sparc32/pthread_spin_lock.c \
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
CFLAGS-sparc = $(SSP_ALL_CFLAGS)
-#CFLAGS:=$(CFLAGS:-O1=-O2)
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/sparc
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/sparc
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
-objclean-y += CLEAN_libpthread/nptl/sysdeps/sparc
-headers_clean-y += HEADERCLEAN_libpthread/nptl/sysdeps/sparc
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-nptl_arch_headers_clean:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
-
-nptl_arch_clean:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
index 34d647527..930ff5654 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -9,5 +9,5 @@ top_srcdir=../../../../../../
top_builddir=../../../../../../
all: objs
include $(top_builddir)Rules.mak
-include Makefile.in
+include Makefile.commonarch
include $(top_srcdir)Makerules
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch
index b1a35c352..09d967616 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch
@@ -251,6 +251,5 @@ HEADERCLEAN_libpthread/nptl/sysdeps/unix/sysv/linux:
$(PTHREAD_LINUX_OUT)/structsem.h \
$(PTHREAD_LINUX_OUT)/pthread-pi-defines.h
-
CLEAN_libpthread/nptl/sysdeps/unix/sysv/linux:
$(do_rm) $(addprefix $(PTHREAD_LINUX_OUT)/*., o os oS)
diff --git a/libpthread/nptl/sysdeps/x86_64/Makefile.arch b/libpthread/nptl/sysdeps/x86_64/Makefile.arch
index dc7e484e5..5a3c4a2fc 100644
--- a/libpthread/nptl/sysdeps/x86_64/Makefile.arch
+++ b/libpthread/nptl/sysdeps/x86_64/Makefile.arch
@@ -11,43 +11,4 @@ libpthread_SSRC = pthread_spin_trylock.S
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
CFLAGS-x86_64 = $(SSP_ALL_CFLAGS)
-#CFLAGS:=$(CFLAGS:-O1=-O2)
-PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/x86_64
-PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/x86_64
-PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
-PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
-
-ifeq ($(DOPIC),y)
-libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
-else
-libpthread-a-y += $(PTHREAD_ARCH_OBJ)
-endif
-libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
-
-libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
-
-objclean-y += CLEAN_libpthread/nptl/sysdeps/x86_64
-headers_clean-y += HEADERCLEAN_libpthread/nptl/sysdeps/x86_64
-
-#
-# Create 'tcb-offsets.h' header file.
-#
-CFLAGS-tcb-offsets.c = -S
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
- $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
- $(compile.c)
-
-$(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.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_ARCH_OUT)/tcb-offsets.h
-
-HEADERCLEAN_libpthread/nptl/sysdeps/x86_64:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
-
-CLEAN_libpthread/nptl/sysdeps/x86_64:
- $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)