* [Buildroot] [PATCH 1/6] toolchain: move helper functions from external toolchain
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
@ 2010-05-09 23:11 ` Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 2/6] toolchain: rename external toolchain dir Yann E. MORIN
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-05-09 23:11 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
The helper functions used for external toolchains may also be useful
to alternate toolchain backends (currently, only 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 | 205 ------------------------------
toolchain/helpers.mk | 208 ++++++++++++++++++++++++++++++
3 files changed, 209 insertions(+), 205 deletions(-)
create mode 100644 toolchain/helpers.mk
diff --git a/Makefile b/Makefile
index a4bf4b5..899ec58 100644
--- a/Makefile
+++ b/Makefile
@@ -305,6 +305,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 2c2562c..f1c2a25 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -35,211 +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 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 libpthread.so libresolv.so librt.so libutil.so
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
new file mode 100644
index 0000000..925c9d2
--- /dev/null
+++ b/toolchain/helpers.mk
@@ -0,0 +1,208 @@
+# 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 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 ; \
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 2/6] toolchain: rename external toolchain dir
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 1/6] toolchain: move helper functions from external toolchain Yann E. MORIN
@ 2010-05-09 23:11 ` Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 3/6] toolchain: move makefile includes Yann E. MORIN
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-05-09 23:11 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
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 +
toolchain/external-toolchain/Config.in | 22 -------
toolchain/external-toolchain/Config.in.2 | 17 -----
toolchain/external-toolchain/ext-tool.mk | 98 ------------------------------
toolchain/toolchain-external/Config.in | 22 +++++++
toolchain/toolchain-external/Config.in.2 | 17 +++++
toolchain/toolchain-external/ext-tool.mk | 98 ++++++++++++++++++++++++++++++
7 files changed, 139 insertions(+), 139 deletions(-)
delete mode 100644 toolchain/external-toolchain/Config.in
delete mode 100644 toolchain/external-toolchain/Config.in.2
delete mode 100644 toolchain/external-toolchain/ext-tool.mk
create mode 100644 toolchain/toolchain-external/Config.in
create mode 100644 toolchain/toolchain-external/Config.in.2
create mode 100644 toolchain/toolchain-external/ext-tool.mk
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/external-toolchain/Config.in
deleted file mode 100644
index efc8378..0000000
--- a/toolchain/external-toolchain/Config.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-
-if BR2_TOOLCHAIN_EXTERNAL
-choice
- prompt "External toolchain C library"
- default BR2_TOOLCHAIN_EXTERNAL_UCLIBC
-
-config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
- bool "uClibc"
-
-config BR2_TOOLCHAIN_EXTERNAL_GLIBC
- bool "glibc"
-
-endchoice
-
-config BR2_TOOLCHAIN_EXTERNAL_STRIP
- bool
- default y
- prompt "Strip shared libraries"
- help
- Strip shared libraries copied from the external toolchain.
-endif
diff --git a/toolchain/external-toolchain/Config.in.2 b/toolchain/external-toolchain/Config.in.2
deleted file mode 100644
index 489558c..0000000
--- a/toolchain/external-toolchain/Config.in.2
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-
-if BR2_TOOLCHAIN_EXTERNAL
-config BR2_TOOLCHAIN_EXTERNAL_PATH
- string "External toolchain path"
- default "/path/to/staging_dir/usr"
- help
- Path to where the external toolchain is installed.
-
-config BR2_TOOLCHAIN_EXTERNAL_PREFIX
- string "External toolchain prefix"
- default "$(ARCH)-linux"
- help
- This the the external toolchain prefix. For example:
- armeb-unknown-linux-gnu, mipsel-unknown-linux-gnu, etc.
-
-endif
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
deleted file mode 100644
index f1c2a25..0000000
--- a/toolchain/external-toolchain/ext-tool.mk
+++ /dev/null
@@ -1,98 +0,0 @@
-
-#
-# This file implements the support for external toolchains, i.e
-# toolchains that have not been produced by Buildroot itself and that
-# are already available on the system on which Buildroot runs. So far,
-# we have tested this with:
-#
-# * Toolchains generated by Crosstool-NG
-# * Toolchains generated by Buildroot
-# * ARM toolchains made available by Codesourcery
-#
-# The basic principle is the following
-#
-# 1. Perform some checks on the conformity between the toolchain
-# configuration described in the Buildroot menuconfig system, and the
-# real configuration of the external toolchain. This is for example
-# important to make sure that the Buildroot configuration system
-# knows whether the toolchain supports RPC, IPv6, locales, large
-# files, etc. Unfortunately, these things cannot be detected
-# automatically, since the value of these options (such as
-# BR2_INET_RPC) are needed at configuration time because these
-# options are used as dependencies for other options. And at
-# configuration time, we are not able to retrieve the external
-# toolchain configuration.
-#
-# 2. Copy the libraries needed at runtime to the target directory,
-# $(TARGET_DIR). Obviously, things such as the C library, the dynamic
-# loader and a few other utility libraries are needed if dynamic
-# applications are to be executed on the target system.
-#
-# 3. Copy the libraries and headers to the staging directory. This
-# will allow all further calls to gcc to be made using --sysroot
-# $(STAGING_DIR), which greatly simplifies the compilation of the
-# packages when using external toolchains. So in the end, only the
-# cross-compiler binaries remains external, all libraries and headers
-# are imported into the Buildroot tree.
-
-uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
-
-EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
-EXTERNAL_LIBS+=ld-uClibc.so
-else
-EXTERNAL_LIBS+=ld-linux.so libnss_files.so libnss_dns.so
-endif
-
-ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
-EXTERNAL_LIBS+=libstdc++.so
-endif
-
-# SYSROOT_DIR selection. We first try the -print-sysroot option,
-# available in gcc 4.4.x and in some Codesourcery toolchains. If this
-# option is not available, we fallback to the value of --with-sysroot
-# as visible in CROSS-gcc -v. We don't pass the -march= option to gcc
-# as we want the "main" sysroot, which contains all variants of the C
-# library in the case of multilib toolchains.
-SYSROOT_DIR=$(shell $(TARGET_CC) -print-sysroot 2>/dev/null)
-ifeq ($(SYSROOT_DIR),)
-SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC) -print-file-name=libc.a |sed -r -e 's:usr/lib/libc\.a::;'))
-endif
-
-# Now, find if the toolchain specifies a sub-directory for the
-# specific architecture variant we're interested in. This is the case
-# with multilib toolchain, when the selected architecture variant is
-# not the default one. To do so, we ask the compiler by passing the
-# appropriate -march= flags. ARCH_SUBDIR will contain the
-# subdirectory, in the main SYSROOT_DIR, that corresponds to the
-# selected architecture variant. ARCH_SYSROOT_DIR will contain the
-# full path to this location.
-ifneq ($(CC_TARGET_ARCH_),)
-TARGET_CC_ARCH_CFLAGS+=-march=$(CC_TARGET_ARCH_)
-endif
-ARCH_SUBDIR=$(shell $(TARGET_CC) $(TARGET_CC_ARCH_CFLAGS) -print-multi-directory)
-ARCH_SYSROOT_DIR=$(SYSROOT_DIR)/$(ARCH_SUBDIR)
-
-$(STAMP_DIR)/ext-toolchain-installed:
- @echo "Checking external toolchain settings"
- $(Q)$(call check_cross_compiler_exists)
-ifeq ($(strip $(SYSROOT_DIR)),)
- @echo "External toolchain doesn't support --sysroot. Cannot use."
- exit 1
-endif
-ifeq ($(BR2_arm),y)
- $(Q)$(call check_arm_abi)
-endif
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
- $(Q)$(call check_uclibc,$(SYSROOT_DIR))
-else
- $(Q)$(call check_glibc,$(SYSROOT_DIR))
-endif
- mkdir -p $(TARGET_DIR)/lib
- @echo "Copy external toolchain libraries to target..."
- $(Q)for libs in $(EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
- done
- @echo "Copy external toolchain sysroot to staging..."
- $(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR),$(ARCH_SYSROOT_DIR),$(ARCH_SUBDIR))
- @touch $@
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
new file mode 100644
index 0000000..efc8378
--- /dev/null
+++ b/toolchain/toolchain-external/Config.in
@@ -0,0 +1,22 @@
+#
+
+if BR2_TOOLCHAIN_EXTERNAL
+choice
+ prompt "External toolchain C library"
+ default BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+
+config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ bool "uClibc"
+
+config BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ bool "glibc"
+
+endchoice
+
+config BR2_TOOLCHAIN_EXTERNAL_STRIP
+ bool
+ default y
+ prompt "Strip shared libraries"
+ help
+ Strip shared libraries copied from the external toolchain.
+endif
diff --git a/toolchain/toolchain-external/Config.in.2 b/toolchain/toolchain-external/Config.in.2
new file mode 100644
index 0000000..489558c
--- /dev/null
+++ b/toolchain/toolchain-external/Config.in.2
@@ -0,0 +1,17 @@
+#
+
+if BR2_TOOLCHAIN_EXTERNAL
+config BR2_TOOLCHAIN_EXTERNAL_PATH
+ string "External toolchain path"
+ default "/path/to/staging_dir/usr"
+ help
+ Path to where the external toolchain is installed.
+
+config BR2_TOOLCHAIN_EXTERNAL_PREFIX
+ string "External toolchain prefix"
+ default "$(ARCH)-linux"
+ help
+ This the the external toolchain prefix. For example:
+ armeb-unknown-linux-gnu, mipsel-unknown-linux-gnu, etc.
+
+endif
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
new file mode 100644
index 0000000..f1c2a25
--- /dev/null
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -0,0 +1,98 @@
+
+#
+# This file implements the support for external toolchains, i.e
+# toolchains that have not been produced by Buildroot itself and that
+# are already available on the system on which Buildroot runs. So far,
+# we have tested this with:
+#
+# * Toolchains generated by Crosstool-NG
+# * Toolchains generated by Buildroot
+# * ARM toolchains made available by Codesourcery
+#
+# The basic principle is the following
+#
+# 1. Perform some checks on the conformity between the toolchain
+# configuration described in the Buildroot menuconfig system, and the
+# real configuration of the external toolchain. This is for example
+# important to make sure that the Buildroot configuration system
+# knows whether the toolchain supports RPC, IPv6, locales, large
+# files, etc. Unfortunately, these things cannot be detected
+# automatically, since the value of these options (such as
+# BR2_INET_RPC) are needed at configuration time because these
+# options are used as dependencies for other options. And at
+# configuration time, we are not able to retrieve the external
+# toolchain configuration.
+#
+# 2. Copy the libraries needed at runtime to the target directory,
+# $(TARGET_DIR). Obviously, things such as the C library, the dynamic
+# loader and a few other utility libraries are needed if dynamic
+# applications are to be executed on the target system.
+#
+# 3. Copy the libraries and headers to the staging directory. This
+# will allow all further calls to gcc to be made using --sysroot
+# $(STAGING_DIR), which greatly simplifies the compilation of the
+# packages when using external toolchains. So in the end, only the
+# cross-compiler binaries remains external, all libraries and headers
+# are imported into the Buildroot tree.
+
+uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
+
+EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
+EXTERNAL_LIBS+=ld-uClibc.so
+else
+EXTERNAL_LIBS+=ld-linux.so libnss_files.so libnss_dns.so
+endif
+
+ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
+EXTERNAL_LIBS+=libstdc++.so
+endif
+
+# SYSROOT_DIR selection. We first try the -print-sysroot option,
+# available in gcc 4.4.x and in some Codesourcery toolchains. If this
+# option is not available, we fallback to the value of --with-sysroot
+# as visible in CROSS-gcc -v. We don't pass the -march= option to gcc
+# as we want the "main" sysroot, which contains all variants of the C
+# library in the case of multilib toolchains.
+SYSROOT_DIR=$(shell $(TARGET_CC) -print-sysroot 2>/dev/null)
+ifeq ($(SYSROOT_DIR),)
+SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC) -print-file-name=libc.a |sed -r -e 's:usr/lib/libc\.a::;'))
+endif
+
+# Now, find if the toolchain specifies a sub-directory for the
+# specific architecture variant we're interested in. This is the case
+# with multilib toolchain, when the selected architecture variant is
+# not the default one. To do so, we ask the compiler by passing the
+# appropriate -march= flags. ARCH_SUBDIR will contain the
+# subdirectory, in the main SYSROOT_DIR, that corresponds to the
+# selected architecture variant. ARCH_SYSROOT_DIR will contain the
+# full path to this location.
+ifneq ($(CC_TARGET_ARCH_),)
+TARGET_CC_ARCH_CFLAGS+=-march=$(CC_TARGET_ARCH_)
+endif
+ARCH_SUBDIR=$(shell $(TARGET_CC) $(TARGET_CC_ARCH_CFLAGS) -print-multi-directory)
+ARCH_SYSROOT_DIR=$(SYSROOT_DIR)/$(ARCH_SUBDIR)
+
+$(STAMP_DIR)/ext-toolchain-installed:
+ @echo "Checking external toolchain settings"
+ $(Q)$(call check_cross_compiler_exists)
+ifeq ($(strip $(SYSROOT_DIR)),)
+ @echo "External toolchain doesn't support --sysroot. Cannot use."
+ exit 1
+endif
+ifeq ($(BR2_arm),y)
+ $(Q)$(call check_arm_abi)
+endif
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
+ $(Q)$(call check_uclibc,$(SYSROOT_DIR))
+else
+ $(Q)$(call check_glibc,$(SYSROOT_DIR))
+endif
+ mkdir -p $(TARGET_DIR)/lib
+ @echo "Copy external toolchain libraries to target..."
+ $(Q)for libs in $(EXTERNAL_LIBS); do \
+ $(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ done
+ @echo "Copy external toolchain sysroot to staging..."
+ $(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR),$(ARCH_SYSROOT_DIR),$(ARCH_SUBDIR))
+ @touch $@
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 3/6] toolchain: move makefile includes
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 1/6] toolchain: move helper functions from external toolchain Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 2/6] toolchain: rename external toolchain dir Yann E. MORIN
@ 2010-05-09 23:11 ` Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 4/6] toolchain: move buildroot config files Yann E. MORIN
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-05-09 23:11 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
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 899ec58..e947e9b 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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 4/6] toolchain: move buildroot config files
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
` (2 preceding siblings ...)
2010-05-09 23:11 ` [Buildroot] [PATCH 3/6] toolchain: move makefile includes Yann E. MORIN
@ 2010-05-09 23:11 ` Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 5/6] toolchain: rename base target for external toolchains Yann E. MORIN
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-05-09 23:11 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
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 --
toolchain/Config.in.1 | 9 -
toolchain/Config.in.2 | 185 -----------------------------
toolchain/toolchain-buildroot/Config.in | 9 +
toolchain/toolchain-buildroot/Config.in.2 | 37 ++++++
toolchain/toolchain-common.in | 157 +++++++++++++++++++++++++
6 files changed, 206 insertions(+), 203 deletions(-)
delete mode 100644 toolchain/Config.in.1
delete mode 100644 toolchain/Config.in.2
create mode 100644 toolchain/toolchain-buildroot/Config.in
create mode 100644 toolchain/toolchain-buildroot/Config.in.2
create mode 100644 toolchain/toolchain-common.in
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/Config.in.1
deleted file mode 100644
index 5c26858..0000000
--- a/toolchain/Config.in.1
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-
-if BR2_TOOLCHAIN_BUILDROOT
-source "toolchain/kernel-headers/Config.in"
-source "toolchain/uClibc/Config.in"
-source "toolchain/binutils/Config.in"
-source "toolchain/gcc/Config.in"
-source "toolchain/ccache/Config.in"
-endif
diff --git a/toolchain/Config.in.2 b/toolchain/Config.in.2
deleted file mode 100644
index f04f18a..0000000
--- a/toolchain/Config.in.2
+++ /dev/null
@@ -1,185 +0,0 @@
-#
-config BR2_LARGEFILE
- bool "Enable large file (files > 2 GB) support?"
- depends on !BR2_cris
- help
- If you are building your own toolchain and you want to
- support files larger than 2GB then enable this option.
- If you have an external binary toolchain that has been
- built with large file support (files > 2GB) then enable
- this option.
-
-config BR2_INET_IPV6
- bool "Enable IPv6"
- help
- If you are building your own toolchain and you want to
- enable IPV6 support then enable this option.
- If you have an external binary toolchain that has been
- built with IPV6 support then enable this option.
-
-config BR2_INET_RPC
- bool "Enable RPC"
- help
- Enable RPC. RPC support is needed for nfs.
- If you are building your own toolchain and you want to
- enable RPC support then enable this option.
- If you have an external binary toolchain that has been
- built with RPC support then enable this option.
-
-config BR2_ENABLE_LOCALE
- bool "Enable toolchain locale/i18n support?"
- select BR2_USE_WCHAR
- help
- If you are building your own toolchain and you want to
- enable locale/i18n support then enable this option.
- If you have an external binary toolchain that has been
- built with locale/i18n support then enable this option.
-
-config BR2_ENABLE_LOCALE_PURGE
- bool "Purge unwanted locales"
- help
- Explicitly specify what locales to install on target. If N
- then all locales supported by packages are installed.
-
-config BR2_ENABLE_LOCALE_WHITELIST
- string "Locales to keep"
- default "C en_US de fr"
- depends on BR2_ENABLE_LOCALE_PURGE
- help
- Whitespace seperated list of locales to allow on target.
- Locales not listed here will be removed from the target.
- See 'locale -a' on your host for a list of locales available
- on your build host, or have a look in /usr/share/locale in
- the target file system for available locales.
-
- Notice that listing a locale here doesn't guarantee that it
- will be available on the target - That purely depends on the
- support for that locale in the selected packages.
-
-config BR2_USE_WCHAR
- bool "Enable WCHAR support"
- help
- If you are building your own toolchain and you want to
- enable WCHAR support then enable this option.
- If you have an external binary toolchain that has been built
- with WCHAR support then enable this option.
-
-config BR2_PREFER_SOFT_FLOAT
- bool
- default y if BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel
-
-config BR2_SOFT_FLOAT
- bool "Use software floating point by default"
- depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc
- default $(BR2_PREFER_SOFT_FLOAT)
- help
- If your target CPU does not have a Floating Point Unit (FPU) or a
- kernel FPU emulator, but you still wish to support floating point
- functions, then everything will need to be compiled with soft
- floating point support (-msoft-float).
-
-config BR2_USE_SSP
- bool "Enable stack protection support"
- help
- Enable stack smashing protection support using GCCs
- -fstack-protector[-all] option.
-
- See http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
- for details.
-
-choice
- prompt "Thread library implementation"
- default BR2_PTHREADS_OLD
- help
- If you are building your own toolchain then select the type of
- libpthreads you want to use.
- Not all thread variants work with all versions of uClibc,
- the "linuxthreads (stable/old)" may be a working fallback
- if you need threading at all.
- If you have an external binary toolchain then select the type
- of libpthreads it was built with.
-
- config BR2_PTHREADS_NONE
- bool "none"
-
- config BR2_PTHREADS
- bool "linuxthreads"
-
- config BR2_PTHREADS_OLD
- bool "linuxthreads (stable/old)"
-
- config BR2_PTHREADS_NATIVE
- bool "Native POSIX Threading (NPTL)"
- depends on BR2_UCLIBC_VERSION_SNAPSHOT
-endchoice
-
-config BR2_PROGRAM_INVOCATION
- bool "Enable 'program invocation name'"
- help
- Support for the GNU-specific program_invocation_name and
- program_invocation_short_name strings. Some GNU packages
- (like tar and coreutils) utilize these for extra useful
- output, but in general are not required.
- If you have an external binary toolchain that has been built
- with program invocation support then enable this option.
-
-config BR2_GCC_CROSS_CXX
- bool
- help
- If you are building your own toolchain and want to build
- a C++ cross-compiler this needs to be enabled.
- If you have an external binary toolchain that has a C++ compiler
- and you want to use it then you need to enable this option.
-
-config BR2_INSTALL_LIBSTDCPP
- bool "Build/install c++ compiler and libstdc++?"
- select BR2_LARGEFILE if (!BR2_GCC_SUPPORTS_SYSROOT && BR2_TOOLCHAIN_BUILDROOT)
- select BR2_GCC_CROSS_CXX
- help
- If you are building your own toolchain and want to build and install
- the C++ compiler and library then you need to enable this option.
- If you have an external toolchain that has been built with C++
- support and you want to use the compiler / library then you need
- to select this option.
-
-config BR2_TARGET_OPTIMIZATION
- string "Target Optimizations"
- default "-Os -pipe"
- help
- Optimizations to use when building for the target host.
-
-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/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
new file mode 100644
index 0000000..5c26858
--- /dev/null
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -0,0 +1,9 @@
+#
+
+if BR2_TOOLCHAIN_BUILDROOT
+source "toolchain/kernel-headers/Config.in"
+source "toolchain/uClibc/Config.in"
+source "toolchain/binutils/Config.in"
+source "toolchain/gcc/Config.in"
+source "toolchain/ccache/Config.in"
+endif
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
new file mode 100644
index 0000000..3b8b09e
--- /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/toolchain-common.in b/toolchain/toolchain-common.in
new file mode 100644
index 0000000..006c942
--- /dev/null
+++ b/toolchain/toolchain-common.in
@@ -0,0 +1,157 @@
+# 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
+ help
+ If you are building your own toolchain and you want to
+ support files larger than 2GB then enable this option.
+ If you have an external binary toolchain that has been
+ built with large file support (files > 2GB) then enable
+ this option.
+
+config BR2_INET_IPV6
+ bool "Enable IPv6"
+ help
+ If you are building your own toolchain and you want to
+ enable IPV6 support then enable this option.
+ If you have an external binary toolchain that has been
+ built with IPV6 support then enable this option.
+
+config BR2_INET_RPC
+ bool "Enable RPC"
+ help
+ Enable RPC. RPC support is needed for nfs.
+ If you are building your own toolchain and you want to
+ enable RPC support then enable this option.
+ If you have an external binary toolchain that has been
+ built with RPC support then enable this option.
+
+config BR2_ENABLE_LOCALE
+ bool "Enable toolchain locale/i18n support?"
+ select BR2_USE_WCHAR
+ help
+ If you are building your own toolchain and you want to
+ enable locale/i18n support then enable this option.
+ If you have an external binary toolchain that has been
+ built with locale/i18n support then enable this option.
+
+config BR2_ENABLE_LOCALE_PURGE
+ bool "Purge unwanted locales"
+ help
+ Explicitly specify what locales to install on target. If N
+ then all locales supported by packages are installed.
+
+config BR2_ENABLE_LOCALE_WHITELIST
+ string "Locales to keep"
+ default "C en_US de fr"
+ depends on BR2_ENABLE_LOCALE_PURGE
+ help
+ Whitespace seperated list of locales to allow on target.
+ Locales not listed here will be removed from the target.
+ See 'locale -a' on your host for a list of locales available
+ on your build host, or have a look in /usr/share/locale in
+ the target file system for available locales.
+
+ Notice that listing a locale here doesn't guarantee that it
+ will be available on the target - That purely depends on the
+ support for that locale in the selected packages.
+
+config BR2_USE_WCHAR
+ bool "Enable WCHAR support"
+ help
+ If you are building your own toolchain and you want to
+ enable WCHAR support then enable this option.
+ If you have an external binary toolchain that has been built
+ with WCHAR support then enable this option.
+
+config BR2_PREFER_SOFT_FLOAT
+ bool
+ default y if BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel
+
+config BR2_SOFT_FLOAT
+ bool "Use software floating point by default"
+ depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc
+ default $(BR2_PREFER_SOFT_FLOAT)
+ help
+ If your target CPU does not have a Floating Point Unit (FPU) or a
+ kernel FPU emulator, but you still wish to support floating point
+ functions, then everything will need to be compiled with soft
+ floating point support (-msoft-float).
+
+config BR2_USE_SSP
+ bool "Enable stack protection support"
+ help
+ Enable stack smashing protection support using GCCs
+ -fstack-protector[-all] option.
+
+ See http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
+ for details.
+
+choice
+ prompt "Thread library implementation"
+ default BR2_PTHREADS_OLD
+ help
+ If you are building your own toolchain then select the type of
+ libpthreads you want to use.
+ Not all thread variants work with all versions of uClibc,
+ the "linuxthreads (stable/old)" may be a working fallback
+ if you need threading at all.
+ If you have an external binary toolchain then select the type
+ of libpthreads it was built with.
+
+ config BR2_PTHREADS_NONE
+ bool "none"
+
+ config BR2_PTHREADS
+ bool "linuxthreads"
+
+ config BR2_PTHREADS_OLD
+ bool "linuxthreads (stable/old)"
+
+ config BR2_PTHREADS_NATIVE
+ bool "Native POSIX Threading (NPTL)"
+ depends on BR2_UCLIBC_VERSION_SNAPSHOT
+endchoice
+
+config BR2_PROGRAM_INVOCATION
+ bool "Enable 'program invocation name'"
+ help
+ Support for the GNU-specific program_invocation_name and
+ program_invocation_short_name strings. Some GNU packages
+ (like tar and coreutils) utilize these for extra useful
+ output, but in general are not required.
+ If you have an external binary toolchain that has been built
+ with program invocation support then enable this option.
+
+config BR2_GCC_CROSS_CXX
+ bool
+ help
+ If you are building your own toolchain and want to build
+ a C++ cross-compiler this needs to be enabled.
+ If you have an external binary toolchain that has a C++ compiler
+ and you want to use it then you need to enable this option.
+
+config BR2_INSTALL_LIBSTDCPP
+ bool "Build/install c++ compiler and libstdc++?"
+ select BR2_LARGEFILE if (!BR2_GCC_SUPPORTS_SYSROOT && BR2_TOOLCHAIN_BUILDROOT)
+ select BR2_GCC_CROSS_CXX
+ help
+ If you are building your own toolchain and want to build and install
+ the C++ compiler and library then you need to enable this option.
+ If you have an external toolchain that has been built with C++
+ support and you want to use the compiler / library then you need
+ to select this option.
+
+config BR2_TARGET_OPTIMIZATION
+ string "Target Optimizations"
+ default "-Os -pipe"
+ help
+ Optimizations to use when building for the target host.
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 5/6] toolchain: rename base target for external toolchains
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
` (3 preceding siblings ...)
2010-05-09 23:11 ` [Buildroot] [PATCH 4/6] toolchain: move buildroot config files Yann E. MORIN
@ 2010-05-09 23:11 ` Yann E. MORIN
2010-05-09 23:11 ` [Buildroot] [PATCH 6/6] toolchain: add new toolchain backend: crosstool-NG Yann E. MORIN
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-05-09 23:11 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
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 e947e9b..0559a34 100644
--- a/Makefile
+++ b/Makefile
@@ -202,7 +202,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 f1c2a25..c2c565a 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 libpthread.so libresolv.so librt.so libutil.so
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 6/6] toolchain: add new toolchain backend: crosstool-NG
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
` (4 preceding siblings ...)
2010-05-09 23:11 ` [Buildroot] [PATCH 5/6] toolchain: rename base target for external toolchains Yann E. MORIN
@ 2010-05-09 23:11 ` Yann E. MORIN
2010-05-14 10:11 ` [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Thomas Petazzoni
2010-06-01 7:15 ` Thomas Petazzoni
7 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-05-09 23:11 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
Makefile | 4
toolchain/Config.in | 4
toolchain/toolchain-crosstool-NG.mk | 16 +
toolchain/toolchain-crosstool-NG/Config.in | 53 +++
.../toolchain-crosstool-NG/crosstool-NG.config | 360 ++++++++++++++++++++
toolchain/toolchain-crosstool-NG/crosstool-NG.mk | 118 +++++++
6 files changed, 554 insertions(+), 1 deletions(-)
create mode 100644 toolchain/toolchain-crosstool-NG.mk
create mode 100644 toolchain/toolchain-crosstool-NG/Config.in
create mode 100644 toolchain/toolchain-crosstool-NG/crosstool-NG.config
create mode 100644 toolchain/toolchain-crosstool-NG/crosstool-NG.mk
diff --git a/Makefile b/Makefile
index 0559a34..845e260 100644
--- a/Makefile
+++ b/Makefile
@@ -201,7 +201,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)
+else
BASE_TARGETS:=toolchain-prepare
endif
TARGETS:=
@@ -294,6 +294,8 @@ ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
include toolchain/toolchain-buildroot.mk
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
include toolchain/toolchain-external.mk
+else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
+include toolchain/toolchain-crosstool-NG.mk
endif
ifeq ($(BR2_PACKAGE_LINUX),y)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index fc9a048..819ae50 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -14,10 +14,14 @@ config BR2_TOOLCHAIN_BUILDROOT
config BR2_TOOLCHAIN_EXTERNAL
bool "External toolchain"
+config BR2_TOOLCHAIN_CTNG
+ bool "Crosstool-NG toolchain"
+
endchoice
source "toolchain/toolchain-buildroot/Config.in"
source "toolchain/toolchain-external/Config.in"
+source "toolchain/toolchain-crosstool-NG/Config.in
source "toolchain/toolchain-common.in"
source "toolchain/toolchain-buildroot/Config.in.2"
source "toolchain/toolchain-external/Config.in.2"
diff --git a/toolchain/toolchain-crosstool-NG.mk b/toolchain/toolchain-crosstool-NG.mk
new file mode 100644
index 0000000..c5807a8
--- /dev/null
+++ b/toolchain/toolchain-crosstool-NG.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-crosstool-NG/crosstool-NG.mk
+include toolchain/mklibs/mklibs.mk
+include toolchain/sstrip/sstrip.mk
+include toolchain/toolchain-external/ext-tool.mk
+include toolchain/uClibc/uclibc.mk
diff --git a/toolchain/toolchain-crosstool-NG/Config.in b/toolchain/toolchain-crosstool-NG/Config.in
new file mode 100644
index 0000000..60ba0ab
--- /dev/null
+++ b/toolchain/toolchain-crosstool-NG/Config.in
@@ -0,0 +1,53 @@
+# Selection options for crosstool-NG
+
+if BR2_TOOLCHAIN_CTNG
+
+choice
+ bool
+ prompt "Crosstool-NG C library"
+
+config BR2_TOOLCHAIN_CTNG_uClibc
+ bool
+ prompt "uClibc"
+
+# Although eglibc can be configured to opt-out some features,
+# let's not deal with that for the time being, it's complex...
+config BR2_TOOLCHAIN_CTNG_eglibc
+ bool
+ prompt "eglibc"
+ select BR2_LARGEFILE
+ select BR2_INET_IPV6
+ select BR2_INET_RPC
+ select BR2_ENABLE_LOCALE
+ select BR2_USE_WCHAR
+ select BR2_PROGRAM_INVOCATION
+
+config BR2_TOOLCHAIN_CTNG_glibc
+ bool
+ prompt "glibc"
+ select BR2_LARGEFILE
+ select BR2_INET_IPV6
+ select BR2_INET_RPC
+ select BR2_ENABLE_LOCALE
+ select BR2_USE_WCHAR
+ select BR2_PROGRAM_INVOCATION
+
+endchoice # C library
+
+config BR2_TOOLCHAIN_CTNG_LIBC
+ string
+ default "uClibc" if BR2_TOOLCHAIN_CTNG_uClibc
+ default "eglibc" if BR2_TOOLCHAIN_CTNG_eglibc
+ default "glibc" if BR2_TOOLCHAIN_CTNG_glibc
+
+config BR2_TOOLCHAIN_CTNG_CONFIG
+ string
+ prompt "crosstool-NG configuration file to use"
+ default "toolchain/toolchain-crosstool-NG/crosstool-NG.config"
+ help
+ Enter here the crosstool-NG's .config file to use.
+ If unsure, use the default.
+ To finely tune your toolchain, you can also call:
+ make ctng-menuconfig
+
+endif # BR2_TOOLCHAIN_CTNG
diff --git a/toolchain/toolchain-crosstool-NG/crosstool-NG.config b/toolchain/toolchain-crosstool-NG/crosstool-NG.config
new file mode 100644
index 0000000..4df366d
--- /dev/null
+++ b/toolchain/toolchain-crosstool-NG/crosstool-NG.config
@@ -0,0 +1,360 @@
+#
+# Automatically generated make config: don't edit
+# crosstool-NG version: hg_default at 1943_48e107b35ba9
+# Sat May 8 16:27:31 2010
+#
+CT_BACKEND=y
+
+#
+# Paths and misc options
+#
+
+#
+# crosstool-NG behavior
+#
+# CT_OBSOLETE is not set
+# CT_EXPERIMENTAL is not set
+
+#
+# Paths
+#
+CT_LOCAL_TARBALLS_DIR=""
+CT_SAVE_TARBALLS=y
+CT_WORK_DIR="${CT_TOP_DIR}/targets"
+CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
+CT_INSTALL_DIR="${CT_PREFIX_DIR}"
+CT_REMOVE_DOCS=y
+CT_INSTALL_DIR_RO=y
+
+#
+# Downloading
+#
+# CT_FORBID_DOWNLOAD is not set
+# CT_FORCE_DOWNLOAD is not set
+# CT_USE_MIRROR is not set
+CT_CONNECT_TIMEOUT=10
+CT_DOWNLOAD_MAX_CHUNKS=5
+# CT_ONLY_DOWNLOAD is not set
+
+#
+# Extracting
+#
+# CT_FORCE_EXTRACT is not set
+CT_OVERIDE_CONFIG_GUESS_SUB=y
+# CT_ONLY_EXTRACT is not set
+CT_PATCH_BUNDLED=y
+# CT_PATCH_LOCAL is not set
+# CT_PATCH_BUNDLED_LOCAL is not set
+# CT_PATCH_LOCAL_BUNDLED is not set
+# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
+# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
+# CT_PATCH_NONE is not set
+CT_PATCH_ORDER="bundled"
+# CT_PATCH_SINGLE is not set
+# CT_PATCH_USE_LOCAL is not set
+
+#
+# Build behavior
+#
+
+#
+# Build options hiden
+#
+CT_PARALLEL_JOBS=1
+CT_LOAD=0
+CT_USE_PIPES=y
+CT_CONFIG_SHELL="custom"
+CT_CONFIG_SHELL_CUSTOM_PATH="/bin/sh"
+
+#
+# Logging
+#
+# CT_LOG_ERROR is not set
+# CT_LOG_WARN is not set
+# CT_LOG_INFO is not set
+CT_LOG_EXTRA=y
+# CT_LOG_ALL is not set
+# CT_LOG_DEBUG is not set
+CT_LOG_LEVEL_MAX="EXTRA"
+# CT_LOG_SEE_TOOLS_WARN is not set
+CT_LOG_PROGRESS_BAR=y
+CT_LOG_TO_FILE=y
+CT_LOG_FILE_COMPRESS=y
+
+#
+# Target options
+#
+CT_ARCH="blackfin"
+# CT_ARCH_SUPPORTS_BOTH_MMU is not set
+# CT_ARCH_SUPPORTS_BOTH_ENDIAN is not set
+CT_ARCH_SUPPORTS_32=y
+# CT_ARCH_SUPPORTS_64 is not set
+CT_ARCH_SUPPORT_ARCH=y
+# CT_ARCH_SUPPORT_ABI is not set
+CT_ARCH_SUPPORT_CPU=y
+CT_ARCH_SUPPORT_TUNE=y
+CT_ARCH_SUPPORT_FPU=y
+# CT_ARCH_DEFAULT_HAS_MMU is not set
+# CT_ARCH_DEFAULT_BE is not set
+CT_ARCH_DEFAULT_LE=y
+CT_ARCH_DEFAULT_32=y
+# CT_ARCH_DEFAULT_64 is not set
+CT_ARCH_ARCH=""
+CT_ARCH_CPU=""
+CT_ARCH_TUNE=""
+CT_ARCH_FPU=""
+# CT_ARCH_BE is not set
+# CT_ARCH_LE is not set
+CT_ARCH_32=y
+# CT_ARCH_64 is not set
+CT_ARCH_BITNESS=32
+CT_ARCH_FLOAT_HW=y
+# CT_ARCH_FLOAT_SW is not set
+CT_TARGET_CFLAGS=""
+CT_TARGET_LDFLAGS=""
+
+#
+# General target options
+#
+# CT_ARCH_alpha is not set
+# CT_ARCH_arm is not set
+# CT_ARCH_avr32 is not set
+CT_ARCH_blackfin=y
+# CT_ARCH_ia64 is not set
+# CT_ARCH_m68k is not set
+# CT_ARCH_mips is not set
+# CT_ARCH_powerpc is not set
+# CT_ARCH_s390 is not set
+# CT_ARCH_sh is not set
+# CT_ARCH_x86 is not set
+CT_ARCH_alpha_AVAILABLE=y
+# CT_ARCH_ALPHA_EV4 is not set
+# CT_ARCH_ALPHA_EV45 is not set
+# CT_ARCH_ALPHA_EV5 is not set
+# CT_ARCH_ALPHA_EV56 is not set
+# CT_ARCH_ALPHA_EV6 is not set
+# CT_ARCH_ALPHA_EV67 is not set
+CT_ARCH_arm_AVAILABLE=y
+# CT_ARCH_ARM_MODE_ARM is not set
+# CT_ARCH_ARM_MODE_THUMB is not set
+CT_ARCH_avr32_AVAILABLE=y
+CT_ARCH_blackfin_AVAILABLE=y
+CT_ARCH_ia64_AVAILABLE=y
+CT_ARCH_m68k_AVAILABLE=y
+CT_ARCH_mips_AVAILABLE=y
+CT_ARCH_powerpc_AVAILABLE=y
+CT_ARCH_s390_AVAILABLE=y
+CT_ARCH_sh_AVAILABLE=y
+# CT_ARCH_SH_SH3 is not set
+# CT_ARCH_SH_SH4 is not set
+# CT_ARCH_SH_SH4A is not set
+CT_ARCH_x86_AVAILABLE=y
+# CT_ARCH_USE_MMU is not set
+
+#
+# Target optimisations
+#
+
+#
+# Toolchain options
+#
+
+#
+# General toolchain options
+#
+CT_USE_SYSROOT=y
+CT_SYSROOT_DIR_PREFIX=""
+
+#
+# Tuple completion and aliasing
+#
+CT_TARGET_VENDOR="unknown"
+CT_TARGET_ALIAS_SED_EXPR=""
+CT_TARGET_ALIAS=""
+
+#
+# Toolchain type
+#
+# CT_NATIVE is not set
+CT_CROSS=y
+# CT_CROSS_NATIVE is not set
+# CT_CANADIAN is not set
+CT_TOOLCHAIN_TYPE="cross"
+
+#
+# Build system
+#
+CT_BUILD=""
+CT_BUILD_PREFIX=""
+CT_BUILD_SUFFIX=""
+
+#
+# Operating System
+#
+CT_BARE_METAL=y
+# CT_KERNEL_SUPPORTS_SHARED_LIBS is not set
+CT_KERNEL="bare-metal"
+CT_KERNEL_bare_metal=y
+# CT_KERNEL_linux is not set
+CT_KERNEL_bare_metal_AVAILABLE=y
+CT_KERNEL_linux_AVAILABLE=y
+
+#
+# Common kernel options
+#
+
+#
+# Binary utilities
+#
+CT_ARCH_BINFMT_ELF=y
+# CT_ARCH_BINFMT_FLAT is not set
+# CT_ARCH_BINFMT_FDPIC is not set
+
+#
+# GNU binutils
+#
+CT_BINUTILS_V_2_20=y
+# CT_BINUTILS_V_2_19_1 is not set
+# CT_BINUTILS_V_2_19 is not set
+# CT_BINUTILS_V_2_18 is not set
+# CT_BINUTILS_V_2_17 is not set
+# CT_BINUTILS_V_2_16_1 is not set
+CT_BINUTILS_VERSION="2.20"
+CT_BINUTILS_EXTRA_CONFIG=""
+
+#
+# sstrip
+#
+# CT_SSTRIP is not set
+
+#
+# C compiler
+#
+CT_CC="gcc"
+CT_CC_VERSION="4.4.3"
+CT_CC_gcc=y
+# CT_CC_V_4_5_0 is not set
+CT_CC_V_4_4_3=y
+# CT_CC_V_4_4_2 is not set
+# CT_CC_V_4_4_1 is not set
+# CT_CC_V_4_4_0 is not set
+# CT_CC_V_4_3_4 is not set
+# CT_CC_V_4_3_3 is not set
+# CT_CC_V_4_3_2 is not set
+# CT_CC_V_4_3_1 is not set
+# CT_CC_V_4_2_4 is not set
+# CT_CC_V_4_2_3 is not set
+# CT_CC_V_4_2_2 is not set
+# CT_CC_V_4_2_1 is not set
+# CT_CC_V_4_2_0 is not set
+# CT_CC_V_4_1_2 is not set
+# CT_CC_V_4_0_4 is not set
+# CT_CC_V_3_4_6 is not set
+CT_CC_GCC_4_2_or_later=y
+CT_CC_GCC_4_3_or_later=y
+CT_CC_GCC_4_4_or_later=y
+# CT_CC_GCC_4_5_or_later is not set
+CT_CC_GCC_USE_GMP_MPFR=y
+CT_CC_GCC_USE_PPL_CLOOG_MPC=y
+# CT_CC_GCC_USE_LIBELF is not set
+CT_CC_ENABLE_CXX_FLAGS=""
+CT_CC_CORE_EXTRA_CONFIG=""
+CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
+CT_CC_BUGURL=""
+CT_CC_SUPPORT_CXX=y
+CT_CC_SUPPORT_FORTRAN=y
+CT_CC_SUPPORT_JAVA=y
+CT_CC_SUPPORT_ADA=y
+CT_CC_SUPPORT_OBJC=y
+CT_CC_SUPPORT_OBJCXX=y
+
+#
+# Additional supported languages:
+#
+# CT_CC_LANG_CXX is not set
+
+#
+# C-library
+#
+CT_LIBC="newlib"
+CT_LIBC_VERSION="1.17.0"
+# CT_LIBC_eglibc is not set
+# CT_LIBC_glibc is not set
+CT_LIBC_newlib=y
+# CT_LIBC_none is not set
+# CT_LIBC_uClibc is not set
+CT_LIBC_eglibc_AVAILABLE=y
+CT_LIBC_glibc_AVAILABLE=y
+CT_LIBC_newlib_AVAILABLE=y
+# CT_LIBC_NEWLIB_V_1_18_0 is not set
+CT_LIBC_NEWLIB_V_1_17_0=y
+# CT_LIBC_NEWLIB_CVS is not set
+
+#
+# Architecture specific options
+#
+CT_LIBC_none_AVAILABLE=y
+CT_LIBC_uClibc_AVAILABLE=y
+# CT_LIBC_SUPPORT_NPTL is not set
+# CT_LIBC_SUPPORT_LINUXTHREADS is not set
+CT_THREADS="none"
+
+#
+# Common C library options
+#
+# CT_THREADS_NPTL is not set
+# CT_THREADS_LINUXTHREADS is not set
+CT_THREADS_NONE=y
+
+#
+# Debug facilities
+#
+# CT_DEBUG_gdb is not set
+
+#
+# Companion libraries
+#
+
+#
+# FIXME: check real dependencies!!!
+#
+CT_COMPLIBS=y
+# CT_WRAPPER_NEEDED is not set
+CT_GMP=y
+CT_MPFR=y
+CT_PPL=y
+CT_CLOOG=y
+CT_MPC=y
+# CT_GMP_V_5_0_1 is not set
+CT_GMP_V_4_3_2=y
+# CT_GMP_V_4_3_1 is not set
+# CT_GMP_V_4_3_0 is not set
+# CT_GMP_V_4_2_4 is not set
+# CT_GMP_V_4_2_2 is not set
+CT_GMP_VERSION="4.3.2"
+CT_MPFR_V_2_4_2=y
+# CT_MPFR_V_2_4_1 is not set
+# CT_MPFR_V_2_4_0 is not set
+# CT_MPFR_V_2_3_2 is not set
+# CT_MPFR_V_2_3_1 is not set
+CT_MPFR_VERSION="2.4.2"
+CT_PPL_V_0_10_2=y
+CT_PPL_VERSION="0.10.2"
+CT_CLOOG_V_0_15_9=y
+# CT_CLOOG_V_0_15_8 is not set
+# CT_CLOOG_V_0_15_7 is not set
+# CT_CLOOG_V_0_15_6 is not set
+# CT_CLOOG_V_0_15_5 is not set
+# CT_CLOOG_V_0_15_4 is not set
+# CT_CLOOG_V_0_15_3 is not set
+CT_CLOOG_VERSION="0.15.9"
+CT_MPC_V_0_8_1=y
+# CT_MPC_V_0_7 is not set
+# CT_MPC_V_0_6 is not set
+CT_MPC_VERSION="0.8.1"
+
+#
+# Companion libraries common options
+#
+# CT_COMPLIBS_CHECK is not set
+# CT_COMPLIBS_SHARED is not set
diff --git a/toolchain/toolchain-crosstool-NG/crosstool-NG.mk b/toolchain/toolchain-crosstool-NG/crosstool-NG.mk
new file mode 100644
index 0000000..3d9409b
--- /dev/null
+++ b/toolchain/toolchain-crosstool-NG/crosstool-NG.mk
@@ -0,0 +1,118 @@
+# Makefile fragment for building toolchain with crosstool-NG
+
+# As a reference, you can look at toolchain/toolchain-external/ext-tool.mk
+# for a generic approach to external toolchains.
+# crosdtool-NG as a backend is but a kind of external toolchains,
+# except that it is not pre-built.
+
+#-----------------------------------------------------------------------------
+# toolchain-prepare is the target to depend on to get the toolchain
+# and prepare staging and co.
+toolchain-prepare: dependencies $(STAMP_DIR)/ct-ng-toolchain-installed
+
+#-----------------------------------------------------------------------------
+# Internal variables
+
+# Crostool-NG hard-coded configuration options
+CTNG_VERSION:=1.7.0
+CTNG_SITE:=http://ymorin.is-a-geek.org/download/crosstool-ng/
+CTNG_SOURCE:=crosstool-ng-$(CTNG_VERSION).tar.bz2
+CTNG_DIR:=$(BUILD_DIR)/crosstool-ng-$(CTNG_VERSION)
+CTNG_CAT:=bzcat
+CTNG_PATCH_DIR:=toolchain/toolchain-crosstool-NG
+CTNG_CONFIG_FILE:=$(call qstrip,$(BR2_TOOLCHAIN_CTNG_CONFIG))
+
+# Hack! ct-ng is in fact a Makefile script. As such, it accepts all
+# make options, such as -C, which makes it uneeded to chdir prior
+# to calling ct-ng.
+CTNG:=$(CTNG_DIR)/ct-ng -C $(CTNG_DIR) --no-print-directory
+
+# The 'system' libraries
+# Note: it may be needed to tweak the NSS libs in the glibc and eglibc cases...
+CTNG_LIBS := EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so
+
+ifeq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_LIBC)),uClibc)
+ CTNG_LIBS += ld-uClibc.so
+else ifeq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_LIBC)),eglibc)
+ CTNG_LIBS += ld-linux.so libnss_files.so libnss_dns.so
+else ifeq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_LIBC)),glibc)
+ CTNG_LIBS += ld-linux.so libnss_files.so libnss_dns.so
+endif
+
+# YEM: This will have to be tested only after crosstool-NG has been configured.
+ifneq ($(shell grep -E '^CT_CC_LANG_CXX=y$$' $(CTNG_DIR)/.config 2>/dev/null),)
+ CTNG_LIBS += libstdc++.so
+endif
+
+#-----------------------------------------------------------------------------
+# Building the toolchain with crosstool-NG
+
+# YEM: needs to set up a proper uClibc .config file
+$(STAMP_DIR)/ct-ng-toolchain-installed: $(CTNG_DIR)/.config $(CTNG_DIR)/ct-ng
+ $(Q)$(CTNG) build.$(BR2_JLEVEL)
+ $(Q)touch $@
+# $(Q)CTNG_TUPLE=$$( $(CTNG) show-tuple ); \
+# CTNG_SYSROOT=$$( true )
+
+#-----------------------------------------------------------------------------
+# Configuring the toolchain via crosstool-NG
+
+# Massage BR2_ARCH so that it matches CT-NG's ARCH YEM: MISSING!
+CTNG_ARCH:=$(call qstrip,$(BR2_ARCH))
+CTNG_LIBC:=$(call qstrip,$(BR2_TOOLCHAIN_CTNG_LIBC))
+
+# Massage BR options into CTNG .config file
+define fix-ctng-dot-config
+ $(Q)sed -r -i -e 's:^(CT_PREFIX_DIR)=.*:\1="$(TOOLCHAIN_DIR)":;' $1
+ $(Q)sed -r -i -e 's:^(CT_LOCAL_TARBALLS_DIR)=.*:\1="$(DL_DIR)":;' $1
+endef
+# Lots of other awfull sed manipulations go here, to YEM: MISSING!
+# override CT-NG's .config with BR2 config options
+# Known missing: MMU, endianness, bitness...
+
+# Default configuration
+$(CTNG_DIR)/.config: $(CTNG_CONFIG_FILE) $(CTNG_DIR)/ct-ng .config
+ $(Q)cp -f $< $@
+ $(Q)yes '' |\
+ $(CTNG) CT_IS_A_BACKEND=y \
+ CT_BACKEND_ARCH=$(CTNG_ARCH) \
+ CT_BACKEND_KERNEL=linux \
+ CT_BACKEND_LIBC=$(BR2_TOOLCHAIN_CTNG_LIBC) \
+ oldconfig
+ $(call fix-ctng-dot-config,$@)
+
+# Manual configuration
+ctng-menuconfig: $(CTNG_DIR)/.config
+ $(Q)$(CTNG) CT_IS_A_BACKEND=y \
+ CT_BACKEND_ARCH=$(CTNG_ARCH) \
+ CT_BACKEND_KERNEL=linux \
+ CT_BACKEND_LIBC=$(CTNG_LIBC) \
+ menuconfig
+ $(call fix-ctng-dot-config,$<)
+
+#-----------------------------------------------------------------------------
+# Retrieving, configuring and building crosstool-NG
+
+$(CTNG_DIR)/ct-ng: $(CTNG_DIR)/.configured
+ $(Q)make -C $(CTNG_DIR) --no-print-directory
+ $(Q)touch $@
+
+$(CTNG_DIR)/.configured: $(CTNG_DIR)/.patched
+ $(Q)cd $(CTNG_DIR) && ./configure --local
+ $(Q)touch $@
+
+$(CTNG_DIR)/.patched: $(CTNG_DIR)/.unpacked
+ $(Q)toolchain/patch-kernel.sh $(CTNG_DIR) \
+ $(CTNG_PATCH_DIR) \
+ \*.patch \
+ \*.patch.$(ARCH)
+ $(Q)touch $@
+
+$(CTNG_DIR)/.unpacked: $(DL_DIR)/$(CTNG_SOURCE)
+ $(Q)rm -rf $(CTNG_DIR)
+ $(Q)mkdir -p $(BUILD_DIR)
+ $(Q)$(CTNG_CAT) $(DL_DIR)/$(CTNG_SOURCE) |tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ $(Q)touch $@
+
+$(DL_DIR)/$(CTNG_SOURCE):
+ $(Q)$(call DOWNLOAD,$(CTNG_SITE),$(CTNG_SOURCE))
^ permalink raw reply related [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
` (5 preceding siblings ...)
2010-05-09 23:11 ` [Buildroot] [PATCH 6/6] toolchain: add new toolchain backend: crosstool-NG Yann E. MORIN
@ 2010-05-14 10:11 ` Thomas Petazzoni
2010-06-01 7:15 ` Thomas Petazzoni
7 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2010-05-14 10:11 UTC (permalink / raw)
To: buildroot
Hello Yann,
I did a quick review of your patches, and found nothing specific to
say, it looks good to me.
I would at least like patches 1 -> 5 to be merged early in the release
cycle of 2010.08, because I have other changes to make on external
toolchain support that will depend on these. So don't wait for the
CT-NG support to be fully ready to send preliminary patches cleaning up
things that you need for CT-NG integration.
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain
2010-05-09 23:10 [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Yann E. MORIN
` (6 preceding siblings ...)
2010-05-14 10:11 ` [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain Thomas Petazzoni
@ 2010-06-01 7:15 ` Thomas Petazzoni
2010-06-01 17:55 ` Yann E. MORIN
7 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2010-06-01 7:15 UTC (permalink / raw)
To: buildroot
Hello Yann,
I'd like to make some changes in the configuration options related to
toolchains. As I don't want to break your work on Crosstool-NG, could
you please send an official pull request for patches 1 to 5 to the
list, so that Peter can merge this early cleanup/preparation work, and
I can base my changes on top of it ?
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread* [Buildroot] [PATCH 0/6] [WIP] Add crostool-NG as backend to generate toolchain
2010-06-01 7:15 ` Thomas Petazzoni
@ 2010-06-01 17:55 ` Yann E. MORIN
0 siblings, 0 replies; 10+ messages in thread
From: Yann E. MORIN @ 2010-06-01 17:55 UTC (permalink / raw)
To: buildroot
Thomas, All,
On Tuesday 01 June 2010 09:15:55 Thomas Petazzoni wrote:
> I'd like to make some changes in the configuration options related to
> toolchains. As I don't want to break your work on Crosstool-NG, could
> you please send an official pull request for patches 1 to 5 to the
> list, so that Peter can merge this early cleanup/preparation work, and
> I can base my changes on top of it ?
I'll push tonight, then!
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] 10+ messages in thread