Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 3/5] toolchain: move makefile includes
  2010-06-01 21:52 [Buildroot] [pull request] Preparatory work on toolchains Yann E. MORIN
@ 2010-06-01 21:53 ` Yann E. MORIN
  0 siblings, 0 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-01 21:53 UTC (permalink / raw)
  To: buildroot

Including a bunch of Makefiles with wildcard makes it impossible
to add new toolchain backends. Avoid that by namely including
needed files.

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 Makefile                         |   17 ++---------------
 toolchain/toolchain-buildroot.mk |   15 +++++++++++++++
 toolchain/toolchain-external.mk  |   16 ++++++++++++++++
 3 files changed, 33 insertions(+), 15 deletions(-)
 create mode 100644 toolchain/toolchain-buildroot.mk
 create mode 100644 toolchain/toolchain-external.mk

diff --git a/Makefile b/Makefile
index 68cfebf..035c7ec 100644
--- a/Makefile
+++ b/Makefile
@@ -291,22 +291,9 @@ include .config.cmd
 # each selected package to TARGETS if that package was selected
 # in the .config file.
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-# avoid pulling in external toolchain which is broken for toplvl parallel builds
-# Explicit ordering:
-include toolchain/dependencies/dependencies.mk
-include toolchain/binutils/binutils.mk
-include toolchain/ccache/ccache.mk
-include toolchain/elf2flt/elf2flt.mk
-include toolchain/gcc/gcc-uclibc-3.x.mk
-include toolchain/gcc/gcc-uclibc-4.x.mk
-include toolchain/gdb/gdb.mk
-include toolchain/kernel-headers/kernel-headers.mk
-include toolchain/mklibs/mklibs.mk
-include toolchain/sstrip/sstrip.mk
-include toolchain/uClibc/uclibc.mk
+include toolchain/toolchain-buildroot.mk
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-include toolchain/helpers.mk
-include toolchain/*/*.mk
+include toolchain/toolchain-external.mk
 endif
 
 ifeq ($(BR2_PACKAGE_LINUX),y)
diff --git a/toolchain/toolchain-buildroot.mk b/toolchain/toolchain-buildroot.mk
new file mode 100644
index 0000000..da94b42
--- /dev/null
+++ b/toolchain/toolchain-buildroot.mk
@@ -0,0 +1,15 @@
+# Include files required for the internal toolchain backend
+
+# avoid pulling in external toolchain which is broken for toplvl parallel builds
+# Explicit ordering:
+include toolchain/dependencies/dependencies.mk
+include toolchain/binutils/binutils.mk
+include toolchain/ccache/ccache.mk
+include toolchain/elf2flt/elf2flt.mk
+include toolchain/gcc/gcc-uclibc-3.x.mk
+include toolchain/gcc/gcc-uclibc-4.x.mk
+include toolchain/gdb/gdb.mk
+include toolchain/kernel-headers/kernel-headers.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/uClibc/uclibc.mk
diff --git a/toolchain/toolchain-external.mk b/toolchain/toolchain-external.mk
new file mode 100644
index 0000000..6c00330
--- /dev/null
+++ b/toolchain/toolchain-external.mk
@@ -0,0 +1,16 @@
+# Required includes for the external toolchain backend
+
+# Explicit ordering:
+include toolchain/helpers.mk
+include toolchain/binutils/binutils.mk
+include toolchain/ccache/ccache.mk
+include toolchain/dependencies/dependencies.mk
+include toolchain/elf2flt/elf2flt.mk
+include toolchain/gcc/gcc-uclibc-3.x.mk
+include toolchain/gcc/gcc-uclibc-4.x.mk
+include toolchain/gdb/gdb.mk
+include toolchain/toolchain-external/ext-tool.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/toolchain-external/ext-tool.mk
+include toolchain/uClibc/uclibc.mk
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2
@ 2010-06-25 22:15 Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 1/5] toolchain: move helper functions from external toolchain Yann E. MORIN
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-25 22:15 UTC (permalink / raw)
  To: buildroot

Hello All!

These are preparatory work on toolchain, laying ground to later add
crosstool-NG as a backend. Currently, these are rather an RFC, even
if it works OK for me.

Changes since v1:
- rebased against latest tree
- patches formatted to detect renames/copies

Yann E. MORIN (5):
    toolchain: move helper functions from external toolchain
    toolchain: rename external toolchain dir
    toolchain: move makefile includes
    toolchain: move buildroot config files
    toolchain: rename base target for external toolchains

 Makefile                                                         |   17 +-
 toolchain/Config.in                                              |   16 +-
 toolchain/external-toolchain/ext-tool.mk                         |  322 ------
 toolchain/helpers.mk                                             |  217 ++++
 toolchain/toolchain-buildroot.mk                                 |   14 +
 toolchain/{Config.in.1 => toolchain-buildroot/Config.in}         |    2 +-
 toolchain/toolchain-buildroot/Config.in.2                        |   37 +
 toolchain/{Config.in.2 => toolchain-common.in}                   |   46 +-
 toolchain/toolchain-external.mk                                  |   16 +
 toolchain/{external-toolchain => toolchain-external}/Config.in   |    0
 toolchain/{external-toolchain => toolchain-external}/Config.in.2 |    0
 toolchain/toolchain-external/ext-tool.mk                         |  108 ++
 12 files changed, 410 insertions(+), 385 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 1/5] toolchain: move helper functions from external toolchain
  2010-06-25 22:15 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2 Yann E. MORIN
@ 2010-06-25 22:15 ` Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 2/5] toolchain: rename external toolchain dir Yann E. MORIN
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-25 22:15 UTC (permalink / raw)
  To: buildroot

The helper functions used for external toolchains may also be useful
to alternate toolchain backends (currently, the external toolchain is
the sole user).

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 Makefile                                 |    1 +
 toolchain/external-toolchain/ext-tool.mk |  214 -----------------------------
 toolchain/helpers.mk                     |  217 ++++++++++++++++++++++++++++++
 3 files changed, 218 insertions(+), 214 deletions(-)
 create mode 100644 toolchain/helpers.mk

diff --git a/Makefile b/Makefile
index 09be31b..fe320df 100644
--- a/Makefile
+++ b/Makefile
@@ -306,6 +306,7 @@ include toolchain/mklibs/mklibs.mk
 include toolchain/sstrip/sstrip.mk
 include toolchain/uClibc/uclibc.mk
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+include toolchain/helpers.mk
 include toolchain/*/*.mk
 endif
 
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 8daae15..c8e7892 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -35,220 +35,6 @@
 #  cross-compiler binaries remains external, all libraries and headers
 #  are imported into the Buildroot tree.
 
-#
-# Copy a toolchain library and its symbolic links from the sysroot
-# directory to the target directory. Also optionaly strips the
-# library.
-#
-# $1: arch specific sysroot directory
-# $2: library name
-# $3: destination directory
-# $4: strip (y|n), default is to strip
-#
-copy_toolchain_lib_root = \
-	ARCH_SYSROOT_DIR="$(strip $1)"; \
-	LIB="$(strip $2)"; \
-	STRIP="$(strip $4)"; \
- \
-	LIBS=`(cd $${ARCH_SYSROOT_DIR}; find . -path "./lib/$${LIB}.*" -o -path "./usr/lib/$${LIB}.*")` ; \
-	for FILE in $${LIBS} ; do \
-		LIB=`basename $${FILE}`; \
-		LIBDIR=`dirname $${FILE}` ; \
-		while test \! -z "$${LIB}"; do \
-			FULLPATH="$${ARCH_SYSROOT_DIR}/$${LIBDIR}/$${LIB}" ; \
-			rm -fr $(TARGET_DIR)/$${LIBDIR}/$${LIB}; \
-			mkdir -p $(TARGET_DIR)/$${LIBDIR}; \
-			if test -h $${FULLPATH} ; then \
-				cp -d $${FULLPATH} $(TARGET_DIR)/$${LIBDIR}/; \
-			elif test -f $${FULLPATH}; then \
-				$(INSTALL) -D -m0755 $${FULLPATH} $(TARGET_DIR)/$${LIBDIR}/$${LIB}; \
-				case "$${STRIP}" in \
-				(0 | n | no) \
-;; \
-				(*) \
-					$(TARGET_CROSS)strip "$(TARGET_DIR)/$${LIBDIR}/$${LIB}"; \
-;; \
-				esac; \
-			else \
-				exit -1; \
-			fi; \
-			LIB="`readlink $${FULLPATH}`"; \
-		done; \
-	done; \
- \
-	echo -n
-
-#
-# Copy the full external toolchain sysroot directory to the staging
-# dir. The operation of this function is rendered a little bit
-# complicated by the support for multilib toolchains.
-#
-# We start by copying etc, lib, sbin and usr from the sysroot of the
-# selected architecture variant (as pointed by ARCH_SYSROOT_DIR). This
-# allows to import into the staging directory the C library and
-# companion libraries for the correct architecture variant. We
-# explictly only copy etc, lib, sbin and usr since other directories
-# might exist for other architecture variants (on Codesourcery
-# toolchain, the sysroot for the default architecture variant contains
-# the armv4t and thumb2 subdirectories, which are the sysroot for the
-# corresponding architecture variants), and we don't want to import
-# them.
-#
-# Then, if the selected architecture variant is not the default one
-# (i.e, if SYSROOT_DIR != ARCH_SYSROOT_DIR), then we :
-#
-#  * Import the header files from the default architecture
-#    variant. Header files are typically shared between the sysroots
-#    for the different architecture variants. If we use the
-#    non-default one, header files were not copied by the previous
-#    step, so we copy them here from the sysroot of the default
-#    architecture variant.
-#
-#  * Create a symbolic link that matches the name of the subdirectory
-#    for the architecture variant in the original sysroot. This is
-#    required as the compiler will by default look in
-#    sysroot_dir/arch_variant/ for libraries and headers, when the
-#    non-default architecture variant is used. Without this, the
-#    compiler fails to find libraries and headers.
-#
-# $1: main sysroot directory of the toolchain
-# $2: arch specific sysroot directory of the toolchain
-# $3: arch specific subdirectory in the sysroot
-#
-copy_toolchain_sysroot = \
-	SYSROOT_DIR="$(strip $1)"; \
-	ARCH_SYSROOT_DIR="$(strip $2)"; \
-	ARCH_SUBDIR="$(strip $3)"; \
-	for i in etc lib sbin usr ; do \
-		cp -a $${ARCH_SYSROOT_DIR}/$$i $(STAGING_DIR)/ ; \
-	done ; \
-	if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
-		if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
-			cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
-		fi ; \
-		ln -s . $(STAGING_DIR)/$(ARCH_SUBDIR) ; \
-	fi ; \
-	find $(STAGING_DIR) -type d | xargs chmod 755
-
-#
-# Check the availability of a particular glibc feature. We assume that
-# all Buildroot toolchain options are supported by glibc, so we just
-# check that they are enabled.
-#
-# $1: Buildroot option name
-# $2: feature description
-#
-check_glibc_feature = \
-	if [ x$($(1)) != x"y" ] ; then \
-		echo "$(2) available in C library, please enable $(1)" ; \
-		exit 1 ; \
-	fi
-
-#
-# Check the correctness of a glibc external toolchain configuration.
-#  1. Check that the C library selected in Buildroot matches the one
-#     of the external toolchain
-#  2. Check that all the C library-related features are enabled in the
-#     config, since glibc always supports all of them
-#
-# $1: sysroot directory
-#
-check_glibc = \
-	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* ; then \
-		echo "Incorrect selection of the C library"; \
-		exit -1; \
-	fi; \
-	$(call check_glibc_feature,BR2_LARGEFILE,Large file support) ;\
-	$(call check_glibc_feature,BR2_INET_IPV6,IPv6 support) ;\
-	$(call check_glibc_feature,BR2_INET_RPC,RPC support) ;\
-	$(call check_glibc_feature,BR2_ENABLE_LOCALE,Locale support) ;\
-	$(call check_glibc_feature,BR2_USE_WCHAR,Wide char support) ;\
-	$(call check_glibc_feature,BR2_PROGRAM_INVOCATION,Program invocation support)
-
-#
-# Check the conformity of Buildroot configuration with regard to the
-# uClibc configuration of the external toolchain, for a particular
-# feature.
-#
-# $1: uClibc macro name
-# $2: Buildroot option name
-# $3: uClibc config file
-# $4: feature description
-#
-check_uclibc_feature = \
-	IS_IN_LIBC=`grep -q "\#define $(1) 1" $(3) && echo y` ; \
-	if [ x$($(2)) != x"y" -a x$${IS_IN_LIBC} == x"y" ] ; then \
-		echo "$(4) available in C library, please enable $(2)" ; \
-		exit 1 ; \
-	fi ; \
-	if [ x$($(2)) == x"y" -a x$${IS_IN_LIBC} != x"y" ] ; then \
-		echo "$(4) not available in C library, please disable $(2)" ; \
-		exit 1 ; \
-	fi
-
-#
-# Check the correctness of a uclibc external toolchain configuration
-#  1. Check that the C library selected in Buildroot matches the one
-#     of the external toolchain
-#  2. Check that the features enabled in the Buildroot configuration
-#     match the features available in the uClibc of the external
-#     toolchain
-#
-# $1: sysroot directory
-#
-check_uclibc = \
-	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-uClibc.so.* ; then \
-		echo "Incorrect selection of the C library"; \
-		exit -1; \
-	fi; \
-	UCLIBC_CONFIG_FILE=$${SYSROOT_DIR}/usr/include/bits/uClibc_config.h ; \
-	$(call check_uclibc_feature,__UCLIBC_HAS_LFS__,BR2_LARGEFILE,$${UCLIBC_CONFIG_FILE},Large file support) ;\
-	$(call check_uclibc_feature,__UCLIBC_HAS_IPV6__,BR2_INET_IPV6,$${UCLIBC_CONFIG_FILE},IPv6 support) ;\
-	$(call check_uclibc_feature,__UCLIBC_HAS_RPC__,BR2_INET_RPC,$${UCLIBC_CONFIG_FILE},RPC support) ;\
-	$(call check_uclibc_feature,__UCLIBC_HAS_LOCALE__,BR2_ENABLE_LOCALE,$${UCLIBC_CONFIG_FILE},Locale support) ;\
-	$(call check_uclibc_feature,__UCLIBC_HAS_WCHAR__,BR2_USE_WCHAR,$${UCLIBC_CONFIG_FILE},Wide char support) ;\
-	$(call check_uclibc_feature,__UCLIBC_HAS_PROGRAM_INVOCATION_NAME__,BR2_PROGRAM_INVOCATION,$${UCLIBC_CONFIG_FILE},Program invocation support) ;\
-
-#
-# Check that the Buildroot configuration of the ABI matches the
-# configuration of the external toolchain.
-#
-check_arm_abi = \
-	EXT_TOOLCHAIN_TARGET=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Target | cut -f2 -d ' ') ; \
-	if echo $${EXT_TOOLCHAIN_TARGET} | grep -q 'eabi$$' ; then \
-		EXT_TOOLCHAIN_ABI="eabi" ; \
-	else \
-		EXT_TOOLCHAIN_ABI="oabi" ; \
-	fi ; \
-	if [ x$(BR2_ARM_OABI) == x"y" -a $${EXT_TOOLCHAIN_ABI} == "eabi" ] ; then \
-		echo "Incorrect ABI setting" ; \
-		exit 1 ; \
-	fi ; \
-	if [ x$(BR2_ARM_EABI) == x"y" -a $${EXT_TOOLCHAIN_ABI} == "oabi" ] ; then \
-		echo "Incorrect ABI setting" ; \
-		exit 1 ; \
-	fi ; \
-
-#
-# Check that the external toolchain supports C++
-#
-check_cplusplus = \
-	if ! test -x $(TARGET_CXX) ; then \
-		echo "BR2_INSTALL_LIBSTDCPP is selected but C++ support not available in external toolchain" ; \
-		exit 1 ; \
-	fi ; \
-
-#
-# Check that the cross-compiler given in the configuration exists
-#
-check_cross_compiler_exists = \
-	if ! test -x $(TARGET_CC) ; then \
-		echo "Cannot find cross-compiler $(TARGET_CC)" ; \
-		exit 1 ; \
-	fi ; \
-
 uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
 
 EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
new file mode 100644
index 0000000..2c7d34c
--- /dev/null
+++ b/toolchain/helpers.mk
@@ -0,0 +1,217 @@
+# This Makefile fragment declares helper functions, usefull to handle
+# non- buildroot-built toolchains, eg. purely external toolchains or
+# toolchains (internally) built using crosstool-NG.
+
+#
+# Copy a toolchain library and its symbolic links from the sysroot
+# directory to the target directory. Also optionaly strips the
+# library.
+#
+# $1: arch specific sysroot directory
+# $2: library name
+# $3: destination directory
+# $4: strip (y|n), default is to strip
+#
+copy_toolchain_lib_root = \
+	ARCH_SYSROOT_DIR="$(strip $1)"; \
+	LIB="$(strip $2)"; \
+	STRIP="$(strip $4)"; \
+ \
+	LIBS=`(cd $${ARCH_SYSROOT_DIR}; find . -path "./lib/$${LIB}.*" -o -path "./usr/lib/$${LIB}.*")` ; \
+	for FILE in $${LIBS} ; do \
+		LIB=`basename $${FILE}`; \
+		LIBDIR=`dirname $${FILE}` ; \
+		while test \! -z "$${LIB}"; do \
+			FULLPATH="$${ARCH_SYSROOT_DIR}/$${LIBDIR}/$${LIB}" ; \
+			rm -fr $(TARGET_DIR)/$${LIBDIR}/$${LIB}; \
+			mkdir -p $(TARGET_DIR)/$${LIBDIR}; \
+			if test -h $${FULLPATH} ; then \
+				cp -d $${FULLPATH} $(TARGET_DIR)/$${LIBDIR}/; \
+			elif test -f $${FULLPATH}; then \
+				$(INSTALL) -D -m0755 $${FULLPATH} $(TARGET_DIR)/$${LIBDIR}/$${LIB}; \
+				case "$${STRIP}" in \
+				(0 | n | no) \
+;; \
+				(*) \
+					$(TARGET_CROSS)strip "$(TARGET_DIR)/$${LIBDIR}/$${LIB}"; \
+;; \
+				esac; \
+			else \
+				exit -1; \
+			fi; \
+			LIB="`readlink $${FULLPATH}`"; \
+		done; \
+	done; \
+ \
+	echo -n
+
+#
+# Copy the full external toolchain sysroot directory to the staging
+# dir. The operation of this function is rendered a little bit
+# complicated by the support for multilib toolchains.
+#
+# We start by copying etc, lib, sbin and usr from the sysroot of the
+# selected architecture variant (as pointed by ARCH_SYSROOT_DIR). This
+# allows to import into the staging directory the C library and
+# companion libraries for the correct architecture variant. We
+# explictly only copy etc, lib, sbin and usr since other directories
+# might exist for other architecture variants (on Codesourcery
+# toolchain, the sysroot for the default architecture variant contains
+# the armv4t and thumb2 subdirectories, which are the sysroot for the
+# corresponding architecture variants), and we don't want to import
+# them.
+#
+# Then, if the selected architecture variant is not the default one
+# (i.e, if SYSROOT_DIR != ARCH_SYSROOT_DIR), then we :
+#
+#  * Import the header files from the default architecture
+#    variant. Header files are typically shared between the sysroots
+#    for the different architecture variants. If we use the
+#    non-default one, header files were not copied by the previous
+#    step, so we copy them here from the sysroot of the default
+#    architecture variant.
+#
+#  * Create a symbolic link that matches the name of the subdirectory
+#    for the architecture variant in the original sysroot. This is
+#    required as the compiler will by default look in
+#    sysroot_dir/arch_variant/ for libraries and headers, when the
+#    non-default architecture variant is used. Without this, the
+#    compiler fails to find libraries and headers.
+#
+# $1: main sysroot directory of the toolchain
+# $2: arch specific sysroot directory of the toolchain
+# $3: arch specific subdirectory in the sysroot
+#
+copy_toolchain_sysroot = \
+	SYSROOT_DIR="$(strip $1)"; \
+	ARCH_SYSROOT_DIR="$(strip $2)"; \
+	ARCH_SUBDIR="$(strip $3)"; \
+	for i in etc lib sbin usr ; do \
+		cp -a $${ARCH_SYSROOT_DIR}/$$i $(STAGING_DIR)/ ; \
+	done ; \
+	if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
+		if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
+			cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
+		fi ; \
+		ln -s . $(STAGING_DIR)/$(ARCH_SUBDIR) ; \
+	fi ; \
+	find $(STAGING_DIR) -type d | xargs chmod 755
+
+#
+# Check the availability of a particular glibc feature. We assume that
+# all Buildroot toolchain options are supported by glibc, so we just
+# check that they are enabled.
+#
+# $1: Buildroot option name
+# $2: feature description
+#
+check_glibc_feature = \
+	if [ x$($(1)) != x"y" ] ; then \
+		echo "$(2) available in C library, please enable $(1)" ; \
+		exit 1 ; \
+	fi
+
+#
+# Check the correctness of a glibc external toolchain configuration.
+#  1. Check that the C library selected in Buildroot matches the one
+#     of the external toolchain
+#  2. Check that all the C library-related features are enabled in the
+#     config, since glibc always supports all of them
+#
+# $1: sysroot directory
+#
+check_glibc = \
+	SYSROOT_DIR="$(strip $1)"; \
+	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* ; then \
+		echo "Incorrect selection of the C library"; \
+		exit -1; \
+	fi; \
+	$(call check_glibc_feature,BR2_LARGEFILE,Large file support) ;\
+	$(call check_glibc_feature,BR2_INET_IPV6,IPv6 support) ;\
+	$(call check_glibc_feature,BR2_INET_RPC,RPC support) ;\
+	$(call check_glibc_feature,BR2_ENABLE_LOCALE,Locale support) ;\
+	$(call check_glibc_feature,BR2_USE_WCHAR,Wide char support) ;\
+	$(call check_glibc_feature,BR2_PROGRAM_INVOCATION,Program invocation support)
+
+#
+# Check the conformity of Buildroot configuration with regard to the
+# uClibc configuration of the external toolchain, for a particular
+# feature.
+#
+# $1: uClibc macro name
+# $2: Buildroot option name
+# $3: uClibc config file
+# $4: feature description
+#
+check_uclibc_feature = \
+	IS_IN_LIBC=`grep -q "\#define $(1) 1" $(3) && echo y` ; \
+	if [ x$($(2)) != x"y" -a x$${IS_IN_LIBC} == x"y" ] ; then \
+		echo "$(4) available in C library, please enable $(2)" ; \
+		exit 1 ; \
+	fi ; \
+	if [ x$($(2)) == x"y" -a x$${IS_IN_LIBC} != x"y" ] ; then \
+		echo "$(4) not available in C library, please disable $(2)" ; \
+		exit 1 ; \
+	fi
+
+#
+# Check the correctness of a uclibc external toolchain configuration
+#  1. Check that the C library selected in Buildroot matches the one
+#     of the external toolchain
+#  2. Check that the features enabled in the Buildroot configuration
+#     match the features available in the uClibc of the external
+#     toolchain
+#
+# $1: sysroot directory
+#
+check_uclibc = \
+	SYSROOT_DIR="$(strip $1)"; \
+	if ! test -f $${SYSROOT_DIR}/lib/ld-uClibc.so.* ; then \
+		echo "Incorrect selection of the C library"; \
+		exit -1; \
+	fi; \
+	UCLIBC_CONFIG_FILE=$${SYSROOT_DIR}/usr/include/bits/uClibc_config.h ; \
+	$(call check_uclibc_feature,__UCLIBC_HAS_LFS__,BR2_LARGEFILE,$${UCLIBC_CONFIG_FILE},Large file support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_IPV6__,BR2_INET_IPV6,$${UCLIBC_CONFIG_FILE},IPv6 support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_RPC__,BR2_INET_RPC,$${UCLIBC_CONFIG_FILE},RPC support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_LOCALE__,BR2_ENABLE_LOCALE,$${UCLIBC_CONFIG_FILE},Locale support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_WCHAR__,BR2_USE_WCHAR,$${UCLIBC_CONFIG_FILE},Wide char support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_PROGRAM_INVOCATION_NAME__,BR2_PROGRAM_INVOCATION,$${UCLIBC_CONFIG_FILE},Program invocation support) ;\
+
+#
+# Check that the Buildroot configuration of the ABI matches the
+# configuration of the external toolchain.
+#
+check_arm_abi = \
+	EXT_TOOLCHAIN_TARGET=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Target | cut -f2 -d ' ') ; \
+	if echo $${EXT_TOOLCHAIN_TARGET} | grep -q 'eabi$$' ; then \
+		EXT_TOOLCHAIN_ABI="eabi" ; \
+	else \
+		EXT_TOOLCHAIN_ABI="oabi" ; \
+	fi ; \
+	if [ x$(BR2_ARM_OABI) == x"y" -a $${EXT_TOOLCHAIN_ABI} == "eabi" ] ; then \
+		echo "Incorrect ABI setting" ; \
+		exit 1 ; \
+	fi ; \
+	if [ x$(BR2_ARM_EABI) == x"y" -a $${EXT_TOOLCHAIN_ABI} == "oabi" ] ; then \
+		echo "Incorrect ABI setting" ; \
+		exit 1 ; \
+	fi ; \
+
+#
+# Check that the external toolchain supports C++
+#
+check_cplusplus = \
+	if ! test -x $(TARGET_CXX) ; then \
+		echo "BR2_INSTALL_LIBSTDCPP is selected but C++ support not available in external toolchain" ; \
+		exit 1 ; \
+	fi ; \
+
+#
+# Check that the cross-compiler given in the configuration exists
+#
+check_cross_compiler_exists = \
+	if ! test -x $(TARGET_CC) ; then \
+		echo "Cannot find cross-compiler $(TARGET_CC)" ; \
+		exit 1 ; \
+	fi ; \
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 2/5] toolchain: rename external toolchain dir
  2010-06-25 22:15 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2 Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 1/5] toolchain: move helper functions from external toolchain Yann E. MORIN
@ 2010-06-25 22:15 ` Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 3/5] toolchain: move makefile includes Yann E. MORIN
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-25 22:15 UTC (permalink / raw)
  To: buildroot

Rename the external toolchain directory.
When new backends are here, it will be easier to sort them out
if they are all prefixed the same way.

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 toolchain/Config.in                                |    4 ++--
 .../Config.in                                      |    0
 .../Config.in.2                                    |    0
 .../ext-tool.mk                                    |    0
 4 files changed, 2 insertions(+), 2 deletions(-)
 rename toolchain/{external-toolchain => toolchain-external}/Config.in (100%)
 rename toolchain/{external-toolchain => toolchain-external}/Config.in.2 (100%)
 rename toolchain/{external-toolchain => toolchain-external}/ext-tool.mk (100%)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index ee94143..52b9d8b 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -17,7 +17,7 @@ config BR2_TOOLCHAIN_EXTERNAL
 endchoice
 
 source "toolchain/Config.in.1"
-source "toolchain/external-toolchain/Config.in"
+source "toolchain/toolchain-external/Config.in"
 
 # we want gdb config in the middle of both source and external
 # toolchains, but mconf won't let us source the same file twice,
@@ -26,6 +26,6 @@ source "toolchain/gdb/Config.in"
 comment "Common Toolchain Options"
 
 source "toolchain/Config.in.2"
-source "toolchain/external-toolchain/Config.in.2"
+source "toolchain/toolchain-external/Config.in.2"
 
 endmenu
diff --git a/toolchain/external-toolchain/Config.in b/toolchain/toolchain-external/Config.in
similarity index 100%
rename from toolchain/external-toolchain/Config.in
rename to toolchain/toolchain-external/Config.in
diff --git a/toolchain/external-toolchain/Config.in.2 b/toolchain/toolchain-external/Config.in.2
similarity index 100%
rename from toolchain/external-toolchain/Config.in.2
rename to toolchain/toolchain-external/Config.in.2
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
similarity index 100%
rename from toolchain/external-toolchain/ext-tool.mk
rename to toolchain/toolchain-external/ext-tool.mk
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] toolchain: move makefile includes
  2010-06-25 22:15 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2 Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 1/5] toolchain: move helper functions from external toolchain Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 2/5] toolchain: rename external toolchain dir Yann E. MORIN
@ 2010-06-25 22:15 ` Yann E. MORIN
  2010-06-27 21:06   ` Peter Korsgaard
  2010-06-25 22:15 ` [Buildroot] [PATCH 4/5] toolchain: move buildroot config files Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 5/5] toolchain: rename base target for external toolchains Yann E. MORIN
  4 siblings, 1 reply; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-25 22:15 UTC (permalink / raw)
  To: buildroot

Including a bunch of Makefiles with wildcard makes it impossible
to add new toolchain backends. Avoid that by namely including
needed files.

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 Makefile                         |   16 ++--------------
 toolchain/toolchain-buildroot.mk |   14 ++++++++++++++
 toolchain/toolchain-external.mk  |   16 ++++++++++++++++
 3 files changed, 32 insertions(+), 14 deletions(-)
 create mode 100644 toolchain/toolchain-buildroot.mk
 create mode 100644 toolchain/toolchain-external.mk

diff --git a/Makefile b/Makefile
index fe320df..a167826 100644
--- a/Makefile
+++ b/Makefile
@@ -293,21 +293,9 @@ all: world
 # each selected package to TARGETS if that package was selected
 # in the .config file.
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-# avoid pulling in external toolchain which is broken for toplvl parallel builds
-# Explicit ordering:
-include toolchain/dependencies/dependencies.mk
-include toolchain/binutils/binutils.mk
-include toolchain/ccache/ccache.mk
-include toolchain/elf2flt/elf2flt.mk
-include toolchain/gcc/gcc-uclibc-4.x.mk
-include toolchain/gdb/gdb.mk
-include toolchain/kernel-headers/kernel-headers.mk
-include toolchain/mklibs/mklibs.mk
-include toolchain/sstrip/sstrip.mk
-include toolchain/uClibc/uclibc.mk
+include toolchain/toolchain-buildroot.mk
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-include toolchain/helpers.mk
-include toolchain/*/*.mk
+include toolchain/toolchain-external.mk
 endif
 
 include package/*/*.mk
diff --git a/toolchain/toolchain-buildroot.mk b/toolchain/toolchain-buildroot.mk
new file mode 100644
index 0000000..1bf714b
--- /dev/null
+++ b/toolchain/toolchain-buildroot.mk
@@ -0,0 +1,14 @@
+# Include files required for the internal toolchain backend
+
+# avoid pulling in external toolchain which is broken for toplvl parallel builds
+# Explicit ordering:
+include toolchain/dependencies/dependencies.mk
+include toolchain/binutils/binutils.mk
+include toolchain/ccache/ccache.mk
+include toolchain/elf2flt/elf2flt.mk
+include toolchain/gcc/gcc-uclibc-4.x.mk
+include toolchain/gdb/gdb.mk
+include toolchain/kernel-headers/kernel-headers.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/uClibc/uclibc.mk
diff --git a/toolchain/toolchain-external.mk b/toolchain/toolchain-external.mk
new file mode 100644
index 0000000..6c00330
--- /dev/null
+++ b/toolchain/toolchain-external.mk
@@ -0,0 +1,16 @@
+# Required includes for the external toolchain backend
+
+# Explicit ordering:
+include toolchain/helpers.mk
+include toolchain/binutils/binutils.mk
+include toolchain/ccache/ccache.mk
+include toolchain/dependencies/dependencies.mk
+include toolchain/elf2flt/elf2flt.mk
+include toolchain/gcc/gcc-uclibc-3.x.mk
+include toolchain/gcc/gcc-uclibc-4.x.mk
+include toolchain/gdb/gdb.mk
+include toolchain/toolchain-external/ext-tool.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/toolchain-external/ext-tool.mk
+include toolchain/uClibc/uclibc.mk
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 4/5] toolchain: move buildroot config files
  2010-06-25 22:15 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2 Yann E. MORIN
                   ` (2 preceding siblings ...)
  2010-06-25 22:15 ` [Buildroot] [PATCH 3/5] toolchain: move makefile includes Yann E. MORIN
@ 2010-06-25 22:15 ` Yann E. MORIN
  2010-06-25 22:15 ` [Buildroot] [PATCH 5/5] toolchain: rename base target for external toolchains Yann E. MORIN
  4 siblings, 0 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-25 22:15 UTC (permalink / raw)
  To: buildroot

Handle the internal toolchain backend mechanism the
same way we handle other backends.

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 toolchain/Config.in                                |   12 +----
 .../{Config.in.1 => toolchain-buildroot/Config.in} |    2 +-
 toolchain/toolchain-buildroot/Config.in.2          |   37 ++++++++++++++++
 toolchain/{Config.in.2 => toolchain-common.in}     |   46 ++++----------------
 4 files changed, 50 insertions(+), 47 deletions(-)
 rename toolchain/{Config.in.1 => toolchain-buildroot/Config.in} (82%)
 create mode 100644 toolchain/toolchain-buildroot/Config.in.2
 rename toolchain/{Config.in.2 => toolchain-common.in} (84%)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 52b9d8b..fc9a048 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -16,16 +16,10 @@ config BR2_TOOLCHAIN_EXTERNAL
 
 endchoice
 
-source "toolchain/Config.in.1"
+source "toolchain/toolchain-buildroot/Config.in"
 source "toolchain/toolchain-external/Config.in"
-
-# we want gdb config in the middle of both source and external
-# toolchains, but mconf won't let us source the same file twice,
-# so put it here instead
-source "toolchain/gdb/Config.in"
-comment "Common Toolchain Options"
-
-source "toolchain/Config.in.2"
+source "toolchain/toolchain-common.in"
+source "toolchain/toolchain-buildroot/Config.in.2"
 source "toolchain/toolchain-external/Config.in.2"
 
 endmenu
diff --git a/toolchain/Config.in.1 b/toolchain/toolchain-buildroot/Config.in
similarity index 82%
rename from toolchain/Config.in.1
rename to toolchain/toolchain-buildroot/Config.in
index 5c26858..a9dd192 100644
--- a/toolchain/Config.in.1
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -1,4 +1,4 @@
-#
+# Config entries for internal toolchain backend
 
 if BR2_TOOLCHAIN_BUILDROOT
 source "toolchain/kernel-headers/Config.in"
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
new file mode 100644
index 0000000..512a608
--- /dev/null
+++ b/toolchain/toolchain-buildroot/Config.in.2
@@ -0,0 +1,37 @@
+# Buildroot backend specific options
+
+if BR2_TOOLCHAIN_BUILDROOT
+source "toolchain/elf2flt/Config.in"
+source "toolchain/mklibs/Config.in"
+source "toolchain/sstrip/Config.in"
+
+config BR2_ENABLE_MULTILIB
+	bool "Enable multilib support?"
+	help
+	    Build libraries to support different ABIs.
+
+config BR2_VFP_FLOAT
+	bool "Use ARM Vector Floating Point unit"
+	depends on !BR2_SOFT_FLOAT
+	depends on BR2_arm || BR2_armeb
+	help
+	  Setting this option will enable the "-mfpu=vfp" option.
+	  If your ARM CPU has a Vector Floating Point Unit (VFP)
+	  and the toolchain supports the option, then the
+	  code can be optimized.
+
+	  Most people will answer N.
+
+config BR2_CROSS_TOOLCHAIN_TARGET_UTILS
+	bool "Include target utils in cross toolchain"
+	default y
+	help
+	  When using buildroot to build a deployable cross toolchain,
+	  it is handy to include certain target apps with that toolchain
+	  as a convenience.
+	  Examples include ldd, gdbserver, and strace.
+
+	  Answer Y if you want these apps (if built) copied into the
+	  cross toolchain dir under <arch>-linux-uclibc/target_utils/.
+
+endif
diff --git a/toolchain/Config.in.2 b/toolchain/toolchain-common.in
similarity index 84%
rename from toolchain/Config.in.2
rename to toolchain/toolchain-common.in
index 35263ce..bea0c7c 100644
--- a/toolchain/Config.in.2
+++ b/toolchain/toolchain-common.in
@@ -1,4 +1,12 @@
-#
+# Generic toolchain options
+
+# we want gdb config in the middle of both source and external
+# toolchains, but mconf won't let us source the same file twice,
+# so put it here instead
+source "toolchain/gdb/Config.in"
+
+comment "Common Toolchain Options"
+
 config BR2_LARGEFILE
 	bool "Enable large file (files > 2 GB) support?"
 	depends on !BR2_cris
@@ -162,39 +170,3 @@ config BR2_TARGET_OPTIMIZATION
 	help
 	  Optimizations to use when building for the target host.
 	  NOTE: gcc optimization level is defined in build options.
-
-if BR2_TOOLCHAIN_BUILDROOT
-source "toolchain/elf2flt/Config.in"
-source "toolchain/mklibs/Config.in"
-source "toolchain/sstrip/Config.in"
-
-config BR2_ENABLE_MULTILIB
-	bool "Enable multilib support?"
-	help
-	    Build libraries to support different ABIs.
-
-config BR2_VFP_FLOAT
-	bool "Use ARM Vector Floating Point unit"
-	depends on !BR2_SOFT_FLOAT
-	depends on BR2_arm || BR2_armeb
-	help
-	  Setting this option will enable the "-mfpu=vfp" option.
-	  If your ARM CPU has a Vector Floating Point Unit (VFP)
-	  and the toolchain supports the option, then the 
-	  code can be optimized.
-	  
-	  Most people will answer N.
-
-config BR2_CROSS_TOOLCHAIN_TARGET_UTILS
-	bool "Include target utils in cross toolchain"
-	default y
-	help
-	  When using buildroot to build a deployable cross toolchain,
-	  it is handy to include certain target apps with that toolchain
-	  as a convenience.
-	  Examples include ldd, gdbserver, and strace.
-
-	  Answer Y if you want these apps (if built) copied into the
-	  cross toolchain dir under <arch>-linux-uclibc/target_utils/.
-
-endif
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 5/5] toolchain: rename base target for external toolchains
  2010-06-25 22:15 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2 Yann E. MORIN
                   ` (3 preceding siblings ...)
  2010-06-25 22:15 ` [Buildroot] [PATCH 4/5] toolchain: move buildroot config files Yann E. MORIN
@ 2010-06-25 22:15 ` Yann E. MORIN
  2010-06-27 21:08   ` Peter Korsgaard
  4 siblings, 1 reply; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-25 22:15 UTC (permalink / raw)
  To: buildroot

It is misleeading to name the external toolchain make target 'uclibc', as
external toochains can be based on other C libraries (eg. glibc or eglibc).

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 Makefile                                 |    2 +-
 toolchain/toolchain-external/ext-tool.mk |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index a167826..5b28cbd 100644
--- a/Makefile
+++ b/Makefile
@@ -230,7 +230,7 @@ PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
 BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-BASE_TARGETS:=uclibc
+BASE_TARGETS:=toolchain-prepare
 endif
 TARGETS:=
 
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index c8e7892..d6a759c 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -35,7 +35,7 @@
 #  cross-compiler binaries remains external, all libraries and headers
 #  are imported into the Buildroot tree.
 
-uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
+toolchain-prepare: dependencies $(STAMP_DIR)/ext-toolchain-installed
 
 EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] toolchain: move makefile includes
  2010-06-25 22:15 ` [Buildroot] [PATCH 3/5] toolchain: move makefile includes Yann E. MORIN
@ 2010-06-27 21:06   ` Peter Korsgaard
  2010-06-27 21:28     ` Yann E. MORIN
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Korsgaard @ 2010-06-27 21:06 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@anciens.enib.fr> writes:

 Yann> Including a bunch of Makefiles with wildcard makes it impossible
 Yann> to add new toolchain backends. Avoid that by namely including
 Yann> needed files.

 Yann> --- /dev/null
 Yann> +++ b/toolchain/toolchain-buildroot.mk
 Yann> @@ -0,0 +1,14 @@
 Yann> +# Include files required for the internal toolchain backend
 Yann> +
 Yann> +# avoid pulling in external toolchain which is broken for toplvl parallel builds
 Yann> +# Explicit ordering:
 Yann> +include toolchain/dependencies/dependencies.mk
 Yann> +include toolchain/binutils/binutils.mk
 Yann> +include toolchain/ccache/ccache.mk
 Yann> +include toolchain/elf2flt/elf2flt.mk
 Yann> +include toolchain/gcc/gcc-uclibc-4.x.mk
 Yann> +include toolchain/gdb/gdb.mk
 Yann> +include toolchain/kernel-headers/kernel-headers.mk
 Yann> +include toolchain/mklibs/mklibs.mk
 Yann> +include toolchain/sstrip/sstrip.mk
 Yann> +include toolchain/uClibc/uclibc.mk
 Yann> diff --git a/toolchain/toolchain-external.mk b/toolchain/toolchain-external.mk
 Yann> new file mode 100644
 Yann> index 0000000..6c00330
 Yann> --- /dev/null
 Yann> +++ b/toolchain/toolchain-external.mk
 Yann> @@ -0,0 +1,16 @@
 Yann> +# Required includes for the external toolchain backend
 Yann> +
 Yann> +# Explicit ordering:
 Yann> +include toolchain/helpers.mk
 Yann> +include toolchain/binutils/binutils.mk
 Yann> +include toolchain/ccache/ccache.mk
 Yann> +include toolchain/dependencies/dependencies.mk
 Yann> +include toolchain/elf2flt/elf2flt.mk
 Yann> +include toolchain/gcc/gcc-uclibc-3.x.mk
 Yann> +include toolchain/gcc/gcc-uclibc-4.x.mk
 Yann> +include toolchain/gdb/gdb.mk
 Yann> +include toolchain/toolchain-external/ext-tool.mk
 Yann> +include toolchain/mklibs/mklibs.mk
 Yann> +include toolchain/sstrip/sstrip.mk
 Yann> +include toolchain/toolchain-external/ext-tool.mk
 Yann> +include toolchain/uClibc/uclibc.mk

Why are the order of those includes not the same?
gcc-uclibc-3.x.mk is gone.
2x toolchain-external/ext-tool.mk?
Why do we need to include all these when using an external toolchain?
Most of them doesn't seem to make sense to me.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 5/5] toolchain: rename base target for external toolchains
  2010-06-25 22:15 ` [Buildroot] [PATCH 5/5] toolchain: rename base target for external toolchains Yann E. MORIN
@ 2010-06-27 21:08   ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2010-06-27 21:08 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@anciens.enib.fr> writes:

 Yann> It is misleeading to name the external toolchain make target 'uclibc', as
 Yann> external toochains can be based on other C libraries (eg. glibc or eglibc).

Typo - s/toochains/toolchains/

Otherwise looks good.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] toolchain: move makefile includes
  2010-06-27 21:06   ` Peter Korsgaard
@ 2010-06-27 21:28     ` Yann E. MORIN
  0 siblings, 0 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-06-27 21:28 UTC (permalink / raw)
  To: buildroot

Peter, All,

On Sunday 27 June 2010 23:06:56 Peter Korsgaard wrote:
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@anciens.enib.fr> writes:
>  Yann> Including a bunch of Makefiles with wildcard makes it impossible
>  Yann> to add new toolchain backends. Avoid that by namely including
>  Yann> needed files.
[--SNIP--]
> Why are the order of those includes not the same?

For external toolchains, the original Makefile was doing:
  include toolchain/*/*.mk

So I just did:
  ls -1 toolchain/*/*.mk

and replaced the single include with the output of ls, so as to keep the
inclusion in the same order the original Makefile was doing it.

> gcc-uclibc-3.x.mk is gone.
> 2x toolchain-external/ext-tool.mk?

Hmmm... I seem to have missed something here. Wrong tree, I guess... :-(

> Why do we need to include all these when using an external toolchain?
> Most of them doesn't seem to make sense to me.

I just did what the original Makefile did, just moved the stuff to
toolchain-specific Makefiles.

I guess it is needed when the user wants to have a native toolchain
in his/her rootfs, as the rules to build it are in those files. The
cross-stuff is not built due to the BASE_TARGETS variable that does
include them only for internal toolchain.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] toolchain: move makefile includes
  2010-07-12 20:46 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v3 Yann E. MORIN
@ 2010-07-12 20:46 ` Yann E. MORIN
  0 siblings, 0 replies; 11+ messages in thread
From: Yann E. MORIN @ 2010-07-12 20:46 UTC (permalink / raw)
  To: buildroot

Including a bunch of Makefiles with wildcard makes it impossible to add
new toolchain backends. Avoid that by namely including needed files.

The external toolchain still needs to include all the toolchain/*/*.mk
sub-makefiles, as they are needed to build a toolchain that runs on the
target. It is to be noted that the cross-toolchain is not built in this
case, as the make-targets to build the cross-toolchain are not present
in the $(BASE_TARGETS) variable, which is later used to create the
dependency rules.

Also, the comment 'Explicit ordering' has been removed, as it is mis-
leading. It is make's responsibility to create the proper ordering based
on the dependency rules it finds in the Makefiles

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
 Makefile                         |   16 ++--------------
 toolchain/toolchain-buildroot.mk |   12 ++++++++++++
 toolchain/toolchain-external.mk  |   14 ++++++++++++++
 3 files changed, 28 insertions(+), 14 deletions(-)
 create mode 100644 toolchain/toolchain-buildroot.mk
 create mode 100644 toolchain/toolchain-external.mk

diff --git a/Makefile b/Makefile
index e02b7db..7f6da17 100644
--- a/Makefile
+++ b/Makefile
@@ -293,21 +293,9 @@ all: world
 # each selected package to TARGETS if that package was selected
 # in the .config file.
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-# avoid pulling in external toolchain which is broken for toplvl parallel builds
-# Explicit ordering:
-include toolchain/dependencies/dependencies.mk
-include toolchain/binutils/binutils.mk
-include toolchain/ccache/ccache.mk
-include toolchain/elf2flt/elf2flt.mk
-include toolchain/gcc/gcc-uclibc-4.x.mk
-include toolchain/gdb/gdb.mk
-include toolchain/kernel-headers/kernel-headers.mk
-include toolchain/mklibs/mklibs.mk
-include toolchain/sstrip/sstrip.mk
-include toolchain/uClibc/uclibc.mk
+include toolchain/toolchain-buildroot.mk
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-include toolchain/helpers.mk
-include toolchain/*/*.mk
+include toolchain/toolchain-external.mk
 endif
 
 include package/*/*.mk
diff --git a/toolchain/toolchain-buildroot.mk b/toolchain/toolchain-buildroot.mk
new file mode 100644
index 0000000..d879697
--- /dev/null
+++ b/toolchain/toolchain-buildroot.mk
@@ -0,0 +1,12 @@
+# Include files required for the internal toolchain backend
+
+include toolchain/dependencies/dependencies.mk
+include toolchain/binutils/binutils.mk
+include toolchain/ccache/ccache.mk
+include toolchain/elf2flt/elf2flt.mk
+include toolchain/gcc/gcc-uclibc-4.x.mk
+include toolchain/gdb/gdb.mk
+include toolchain/kernel-headers/kernel-headers.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/uClibc/uclibc.mk
diff --git a/toolchain/toolchain-external.mk b/toolchain/toolchain-external.mk
new file mode 100644
index 0000000..6f1f641
--- /dev/null
+++ b/toolchain/toolchain-external.mk
@@ -0,0 +1,14 @@
+# Required includes for the external toolchain backend
+
+include toolchain/helpers.mk
+include toolchain/binutils/binutils.mk
+include toolchain/ccache/ccache.mk
+include toolchain/dependencies/dependencies.mk
+include toolchain/elf2flt/elf2flt.mk
+include toolchain/gcc/gcc-uclibc-4.x.mk
+include toolchain/gdb/gdb.mk
+include toolchain/kernel-headers/kernel-headers.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/toolchain-external/ext-tool.mk
+include toolchain/uClibc/uclibc.mk
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-07-12 20:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-25 22:15 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v2 Yann E. MORIN
2010-06-25 22:15 ` [Buildroot] [PATCH 1/5] toolchain: move helper functions from external toolchain Yann E. MORIN
2010-06-25 22:15 ` [Buildroot] [PATCH 2/5] toolchain: rename external toolchain dir Yann E. MORIN
2010-06-25 22:15 ` [Buildroot] [PATCH 3/5] toolchain: move makefile includes Yann E. MORIN
2010-06-27 21:06   ` Peter Korsgaard
2010-06-27 21:28     ` Yann E. MORIN
2010-06-25 22:15 ` [Buildroot] [PATCH 4/5] toolchain: move buildroot config files Yann E. MORIN
2010-06-25 22:15 ` [Buildroot] [PATCH 5/5] toolchain: rename base target for external toolchains Yann E. MORIN
2010-06-27 21:08   ` Peter Korsgaard
  -- strict thread matches above, loose matches on Subject: below --
2010-07-12 20:46 [Buildroot] [PATCH 0/5] Preparatory work on toolchains - v3 Yann E. MORIN
2010-07-12 20:46 ` [Buildroot] [PATCH 3/5] toolchain: move makefile includes Yann E. MORIN
2010-06-01 21:52 [Buildroot] [pull request] Preparatory work on toolchains Yann E. MORIN
2010-06-01 21:53 ` [Buildroot] [PATCH 3/5] toolchain: move makefile includes Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox