From cfbf8abc33d86a0cf5c1bb3e0817a22009b7f301 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 28 Jul 2010 00:11:37 -0700 Subject: Add support for uclibc NPTL toolchain. This patch modifies current toolchain build sequence so that NPTL enabled toolchain can be built. The new sequence works well with linuxthreads as well. It introduces a new pass for gcc cross compilation. The new sequence is binutils->gcc-initial->linux-headers -> uclibc-configured (some cheats to generate phony shared libc.so and libm.o) -> gcc-intermediate(with shared lib support) -> uclibc -> gcc-final I also added a new sample config arm_nptl_toolchain_defconfig which builds the toolchain and busybox. I have only tried it on arm. However it should work for other architectures which support NPTL on uclibc e.g. mips, sh, x86, ppc, x86_64 Signed-off-by: Khem Raj Signed-off-by: Peter Korsgaard --- toolchain/uClibc/uclibc.mk | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'toolchain/uClibc/uclibc.mk') diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index ce1396a97..016f32372 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -16,11 +16,12 @@ UCLIBC_VERSION:=$(call qstrip,$(BR2_UCLIBC_VERSION_STRING)) ifeq ($(BR2_UCLIBC_VERSION_SNAPSHOT),y) UCLIBC_SITE:=http://www.uclibc.org/downloads/snapshots +UCLIBC_DIR:=$(TOOLCHAIN_DIR)/uClibc else UCLIBC_SITE:=http://www.uclibc.org/downloads +UCLIBC_DIR:=$(TOOLCHAIN_DIR)/uClibc-$(UCLIBC_VERSION) endif -UCLIBC_DIR:=$(TOOLCHAIN_DIR)/uClibc-$(UCLIBC_VERSION) UCLIBC_PATCH_DIR:=toolchain/uClibc/ UCLIBC_SOURCE:=uClibc-$(UCLIBC_VERSION).tar.bz2 @@ -407,6 +408,7 @@ $(UCLIBC_DIR)/.configured: $(LINUX_HEADERS_DIR)/.configured $(UCLIBC_DIR)/.confi DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX=$(TOOLCHAIN_DIR)/uClibc_dev/ \ HOSTCC="$(HOSTCC)" headers \ + lib/crt1.o lib/crti.o lib/crtn.o \ $(if $(BR2_UCLIBC_VERSION_0_9_28_3),install_dev,install_headers) # Install the kernel headers to the first stage gcc include dir # if necessary @@ -414,9 +416,12 @@ $(UCLIBC_DIR)/.configured: $(LINUX_HEADERS_DIR)/.configured $(UCLIBC_DIR)/.confi cp -pLR $(LINUX_HEADERS_DIR)/include/* \ $(TOOLCHAIN_DIR)/uClibc_dev/usr/include/; \ fi + $(TARGET_CROSS)gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/libc.so + $(TARGET_CROSS)gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/libm.so + cp -pLR $(UCLIBC_DIR)/lib/crt[1in].o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/ touch $@ -$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(gcc_initial) $(LIBFLOAT_TARGET) +$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(gcc_intermediate) $(LIBFLOAT_TARGET) $(MAKE1) -C $(UCLIBC_DIR) \ ARCH="$(UCLIBC_TARGET_ARCH)" \ PREFIX= \ @@ -501,7 +506,7 @@ UCLIBC_TARGETS+=uclibc-test endif endif -uclibc: $(cross_compiler) $(STAGING_DIR)/usr/lib/libc.a $(UCLIBC_TARGETS) +uclibc: $(gcc_intermediate) $(STAGING_DIR)/usr/lib/libc.a $(UCLIBC_TARGETS) uclibc-source: $(DL_DIR)/$(UCLIBC_SOURCE) @@ -514,7 +519,7 @@ uclibc-oldconfig: $(UCLIBC_DIR)/.oldconfig uclibc-update: uclibc-config cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE) -uclibc-configured: kernel-headers $(UCLIBC_DIR)/.configured +uclibc-configured: gcc_initial kernel-headers $(UCLIBC_DIR)/.configured uclibc-configured-source: uclibc-source @@ -540,7 +545,7 @@ $(TARGET_DIR)/root/uClibc/test/unistd/errno: $(UCLIBC_DIR)/test/unistd/errno $(INSTALL) $(UCLIBC_DIR)/Rules.mak $(TARGET_DIR)/root/uClibc $(INSTALL) $(UCLIBC_DIR)/.config $(TARGET_DIR)/root/uClibc -uclibc-test: uclibc $(TARGET_DIR)/root/uClibc/test/unistd/errno +uclibc-test: $(STAGING_DIR)/usr/lib/libc.a $(TARGET_DIR)/root/uClibc/test/unistd/errno uclibc-test-source: uclibc-source -- cgit v1.2.3