[git commit master] build system changes needed for nptl

Austin Foxley austinf at cetoncorp.com
Fri Apr 23 14:31:55 UTC 2010


commit: http://git.uclibc.org/uClibc/commit/?id=c94314fa618c682646c07ddd914a5abb77346273
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

 * add include dir for nptl
 * pregen nptl headers
 * add include dir to pick up subarchs
 * a few tweaks for test/* to match state of the code

Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 Makefile.in           |   11 ++++++++++-
 Rules.mak             |    8 +++++---
 test/Makefile         |    5 ++++-
 test/Rules.mak        |    6 +++---
 test/Test.mak         |    5 ++---
 test/dlopen/Makefile  |    5 +++++
 test/pthread/Makefile |    1 +
 7 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index affbe53..65180f3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -114,7 +114,8 @@ target-headers-sysdep := \
 	$(ALL_HEADERS_BITS_ARCH) \
 	$(ALL_HEADERS_BITS_SUBARCH) \
 	$(ALL_HEADERS_SYS_COMMON) \
-	$(ALL_HEADERS_SYS_ARCH)
+	$(ALL_HEADERS_SYS_ARCH) \
+	$(ALL_HEADERS_BITS_PTHREAD)
 
 $(top_builddir)include/fpu_control.h:
 	@$(disp_ln)
@@ -160,6 +161,14 @@ headers-y += $(target-headers-sysdep)
 headers: $(top_builddir)include/bits/uClibc_config.h
 subdirs: $(addprefix $(top_builddir),$(subdirs))
 pregen: $(top_builddir)include/bits/sysnum.h headers subdirs
+	$(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+		$(Q)$(MAKE) nptl_headers
+ifeq ($(shell $(CC) --help 2>&1 > /dev/null && echo yes),yes)
+		$(Q)$(MAKE) nptl_arch_headers
+		$(Q)$(MAKE) nptl_linux_headers
+endif
+endif
 
 $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh
 	$(Q)$(INSTALL) -d $(@D)
diff --git a/Rules.mak b/Rules.mak
index ceb1e10..31304c2 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -225,7 +225,7 @@ CPU_CFLAGS-$(UCLIBC_FORMAT_FLAT_SEP_DATA) += -msep-data
 CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN) += -Wl,-EL
 CPU_LDFLAGS-$(ARCH_BIG_ENDIAN)    += -Wl,-EB
 
-PICFLAG-y := -fPIC
+PICFLAG-y := -fPIC -DPIC
 PICFLAG-$(UCLIBC_FORMAT_FDPIC_ELF) := -mfdpic
 PICFLAG := $(PICFLAG-y)
 PIEFLAG_NAME:=-fPIE
@@ -577,9 +577,9 @@ endif
 
 LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
 ifeq ($(DODEBUG),y)
-CFLAGS += -O0 -g3
+CFLAGS += -O0 -g3 -DDEBUG
 else
-CFLAGS += $(OPTIMIZATION) $(XARCH_CFLAGS)
+CFLAGS += $(OPTIMIZATION) $(XARCH_CFLAGS) -DNDEBUG
 endif
 ifeq ($(DOSTRIP),y)
 LDFLAGS += -Wl,-s
@@ -620,6 +620,7 @@ PTDIR := libpthread/$(PTNAME)
 # set up system dependencies include dirs (NOTE: order matters!)
 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
 PTINC:=	-I$(top_srcdir)$(PTDIR)						\
+	-I$(top_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/$(TARGET_SUBARCH)	\
 	-I$(top_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)	\
 	-I$(top_srcdir)$(PTDIR)/sysdeps/$(TARGET_ARCH)			\
 	-I$(top_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux			\
@@ -659,6 +660,7 @@ else
 	PTNAME :=
 	PTINC  :=
 endif
+CFLAGS += -I$(top_srcdir)libc/sysdeps/linux/common
 CFLAGS += -I$(KERNEL_HEADERS)
 
 #CFLAGS += -iwithprefix include-fixed -iwithprefix include
diff --git a/test/Makefile b/test/Makefile
index bd68884..857ac8a 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -26,6 +26,9 @@ endif
 ifneq ($(UCLIBC_HAS_REGEX),y)
 	DIRS := $(filter-out regex,$(DIRS))
 endif
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+	DIRS := $(filter-out tls nptl,$(DIRS))
+endif
 ifneq ($(UCLIBC_HAS_WCHAR),y)
 	DIRS := $(filter-out locale-mbwc,$(DIRS))
 endif
@@ -41,7 +44,7 @@ endif
 
 test check all: run
 
-run: subdirs_run
+run: compile subdirs_run
 
 compile: $(top_builddir)/$(LOCAL_INSTALL_PATH) subdirs_compile
 
diff --git a/test/Rules.mak b/test/Rules.mak
index 8e154c5..d31372f 100644
--- a/test/Rules.mak
+++ b/test/Rules.mak
@@ -111,9 +111,9 @@ else
 	HOST_LDFLAGS  += -s
 endif
 
-ifneq ($(strip $(HAVE_SHARED)),y)
-	LDFLAGS       += -static
-	HOST_LDFLAGS  += -static
+ifeq ($(strip $(UCLIBC_STATIC)),y)
+	STATIC_LDFLAGS	:= -static
+	HOST_LDFLAGS  	+= -static
 endif
 
 LDFLAGS += -B$(top_builddir)lib -Wl,-rpath,$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
diff --git a/test/Test.mak b/test/Test.mak
index 6656549..e4f4835 100644
--- a/test/Test.mak
+++ b/test/Test.mak
@@ -68,9 +68,8 @@ define exec_test
 endef
 
 test check all: run
-run: $(RUN_TARGETS) compile
-
-$(RUN_TARGETS): $(TARGETS)
+run: $(RUN_TARGETS)
+$(RUN_TARGETS):
 	$(exec_test)
 	$(diff_test)
 ifeq ($(UCLIBC_ONLY),)
diff --git a/test/dlopen/Makefile b/test/dlopen/Makefile
index ef15d86..66a2452 100644
--- a/test/dlopen/Makefile
+++ b/test/dlopen/Makefile
@@ -4,4 +4,9 @@
 top_builddir=../../
 include ../Rules.mak
 -include Makefile.in
+ifeq ($(UCLIBC_STATIC),y)
+TESTS_DISABLED := test3
+LDFLAGS_libtest.so := -lpthread
+endif
+
 include ../Test.mak
diff --git a/test/pthread/Makefile b/test/pthread/Makefile
index d6f00d6..5f2033d 100644
--- a/test/pthread/Makefile
+++ b/test/pthread/Makefile
@@ -1,6 +1,7 @@
 # uClibc pthread tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+TESTS_DISABLED += cancellation-points
 top_builddir=../../
 include ../Rules.mak
 -include Makefile.in
-- 
1.6.3.3



More information about the uClibc-cvs mailing list