* [Buildroot] [PATCH 01/14] toolchain: Improve C library option selection
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 19:44 ` Yann E. MORIN
2010-12-13 16:27 ` [Buildroot] [PATCH 02/14] toolchain: remove ending semi-colon in helpers Thomas Petazzoni
` (13 subsequent siblings)
14 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
Turn BR2_LARGEFILE, BR2_INET_IPV6, BR2_INET_RPC, BR2_USE_WCHAR,
BR2_ENABLE_LOCALE and BR2_PROGRAM_INVOCATION into hidden options.
Then, for Buildroot toolchains, external toolchains and Crosstool-NG
toolchains, provide visible options that selects the hidden options.
This allows :
* To show a different label and help text in the case of Buildroot
toolchain (do you want to enable feature X ?) and in the case of
external toolchain (is feature X available in your toolchain ?)
* To not show any option when a glibc external toolchain is selected
(since glibc is assumed to support all of largefile, IPv6, RPC,
WCHAR, locale and program invocation) and have them all selected in
that case.
There is some amount of duplication between Buildroot toolchain config
options and Crosstool-NG toolchain config options, because kconfig
doesn't allow to source the same Config.in file twice (even if under
mutually exclusive conditions). This duplication is more readable that
the hack that consists in splitting files in multiple pieces.
However, this commit changes the name of the options visible in the
configuration interface, so existing .config files will have to be
updated accordingly.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-buildroot/Config.in.2 | 50 +++++++++++++++++++++++
toolchain/toolchain-common.in | 57 +++++----------------------
toolchain/toolchain-crosstool-ng/Config.in | 53 +++++++++++++++++++++++++
toolchain/toolchain-external/Config.in | 59 ++++++++++++++++++++++++++++
4 files changed, 172 insertions(+), 47 deletions(-)
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
index 2a17796..2a8dcf5 100644
--- a/toolchain/toolchain-buildroot/Config.in.2
+++ b/toolchain/toolchain-buildroot/Config.in.2
@@ -1,6 +1,56 @@
# Buildroot backend specific options
if BR2_TOOLCHAIN_BUILDROOT
+
+comment "Toolchain Options"
+
+config BR2_TOOLCHAIN_BUILDROOT_LARGEFILE
+ bool "Enable large file (files > 2 GB) support"
+ select BR2_LARGEFILE
+ help
+ Enable this option if you want your toolchain to support
+ files bigger than 2 GB.
+
+config BR2_TOOLCHAIN_BUILDROOT_INET_IPV6
+ bool "Enable IPv6 support"
+ select BR2_INET_IPV6
+ help
+ Enable this option if you want your toolchain to support
+ IPv6.
+
+config BR2_TOOLCHAIN_BUILDROOT_INET_RPC
+ bool "Enable RPC support"
+ select BR2_INET_RPC
+ help
+ Enable this option if you want your toolchain to support
+ RPC (needed for NFS, for example).
+
+config BR2_TOOLCHAIN_BUILDROOT_WCHAR
+ bool "Enable WCHAR support"
+ select BR2_USE_WCHAR
+ help
+ Enable this option if you want your toolchain to support
+ wide characters (i.e characters longer than 8 bits, needed
+ for locale support).
+
+config BR2_TOOLCHAIN_BUILDROOT_LOCALE
+ bool "Enable toolchain locale/i18n support"
+ select BR2_TOOLCHAIN_BUILDROOT_WCHAR
+ select BR2_ENABLE_LOCALE
+ help
+ Enable this option if you want your toolchain to support
+ localization and internationalization.
+
+config BR2_TOOLCHAIN_BUILDROOT_PROGRAM_INVOCATION
+ bool "Enable 'program invocation name' support"
+ select BR2_PROGRAM_INVOCATION
+ help
+ Enable this option if you want your toolchain to support 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.
+
source "toolchain/elf2flt/Config.in"
source "toolchain/mklibs/Config.in"
source "toolchain/sstrip/Config.in"
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index f67c30a..ea47466 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -5,42 +5,23 @@
# 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?"
- 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.
+ bool
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.
+ bool
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.
+ bool
+
+config BR2_USE_WCHAR
+ bool
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.
+ bool
+
+config BR2_PROGRAM_INVOCATION
+ bool
config BR2_ENABLE_LOCALE_PURGE
bool "Purge unwanted locales"
@@ -78,14 +59,6 @@ config BR2_NEEDS_GETTEXT_IF_LOCALE
bool
default y if (BR2_NEEDS_GETTEXT && BR2_ENABLE_LOCALE)
-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
@@ -135,16 +108,6 @@ choice
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
diff --git a/toolchain/toolchain-crosstool-ng/Config.in b/toolchain/toolchain-crosstool-ng/Config.in
index f9b7e69..4f30588 100644
--- a/toolchain/toolchain-crosstool-ng/Config.in
+++ b/toolchain/toolchain-crosstool-ng/Config.in
@@ -45,6 +45,59 @@ config BR2_TOOLCHAIN_CTNG_CONFIG
To finetune your toolchain, you can also call:
make ctng-menuconfig
+if BR2_TOOLCHAIN_CTNG_uClibc
+
+comment "Toolchain Options"
+
+config BR2_TOOLCHAIN_CTNG_uClibc_LARGEFILE
+ bool "Enable large file (files > 2 GB) support"
+ select BR2_LARGEFILE
+ help
+ Enable this option if you want your toolchain to support
+ files bigger than 2 GB.
+
+config BR2_TOOLCHAIN_CTNG_uClibc_INET_IPV6
+ bool "Enable IPv6 support"
+ select BR2_INET_IPV6
+ help
+ Enable this option if you want your toolchain to support
+ IPv6.
+
+config BR2_TOOLCHAIN_CTNG_uClibc_INET_RPC
+ bool "Enable RPC support"
+ select BR2_INET_RPC
+ help
+ Enable this option if you want your toolchain to support
+ RPC (needed for NFS, for example).
+
+config BR2_TOOLCHAIN_CTNG_uClibc_WCHAR
+ bool "Enable WCHAR support"
+ select BR2_USE_WCHAR
+ help
+ Enable this option if you want your toolchain to support
+ wide characters (i.e characters longer than 8 bits, needed
+ for locale support).
+
+config BR2_TOOLCHAIN_CTNG_uClibc_LOCALE
+ bool "Enable toolchain locale/i18n support"
+ select BR2_TOOLCHAIN_CTNG_uClibc_WCHAR
+ select BR2_ENABLE_LOCALE
+ help
+ Enable this option if you want your toolchain to support
+ localization and internationalization.
+
+config BR2_TOOLCHAIN_CTNG_uClibc_PROGRAM_INVOCATION
+ bool "Enable 'program invocation name' support"
+ select BR2_PROGRAM_INVOCATION
+ help
+ Enable this option if you want your toolchain to support 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.
+
+endif # BR2_TOOLCHAIN_CTNG_uClibc
+
config BR2_TOOLCHAIN_CTNG_STRIP_LIBS
bool "Strip libs copied to target"
default !BR2_STRIP_none
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index a340de6..f0268a7 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -10,9 +10,68 @@ config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
config BR2_TOOLCHAIN_EXTERNAL_GLIBC
bool "glibc"
+ select BR2_LARGEFILE
+ select BR2_INET_IPV6
+ select BR2_INET_RPC
+ select BR2_USE_WCHAR
+ select BR2_ENABLE_LOCALE
+ select BR2_PROGRAM_INVOCATION
endchoice
+if BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+
+config BR2_TOOLCHAIN_EXTERNAL_LARGEFILE
+ bool "Toolchain has large file support?"
+ select BR2_LARGEFILE
+ help
+ Select this option if your external toolchain supports
+ largefile. If you don't know, leave the default value,
+ Buildroot will tell you if it's correct or not.
+
+config BR2_TOOLCHAIN_EXTERNAL_INET_IPV6
+ bool "Toolchain has IPv6 support?"
+ select BR2_INET_IPV6
+ help
+ Select this option if your external toolchain supports
+ IPv6. If you don't know, leave the default value, Buildroot
+ will tell you if it's correct or not.
+
+config BR2_TOOLCHAIN_EXTERNAL_INET_RPC
+ bool "Toolchain has RPC support ?"
+ select BR2_INET_RPC
+ help
+ Select this option if your external toolchain supports
+ RPC. If you don't know, leave the default value, Buildroot
+ will tell you if it's correct or not.
+
+config BR2_TOOLCHAIN_EXTERNAL_WCHAR
+ bool "Toolchain has WCHAR support?"
+ select BR2_USE_WCHAR
+ help
+ Select this option if your external toolchain supports
+ WCHAR. If you don't know, leave the default value, Buildroot
+ will tell you if it's correct or not.
+
+config BR2_TOOLCHAIN_EXTERNAL_LOCALE
+ bool "Toolchain has locale support?"
+ select BR2_TOOLCHAIN_EXTERNAL_WCHAR
+ select BR2_ENABLE_LOCALE
+ help
+ Select this option if your external toolchain has locale
+ support. If you don't know, leave the default value,
+ Buildroot will tell you if it's correct or not.
+
+config BR2_TOOLCHAIN_EXTERNAL_PROGRAM_INVOCATION
+ bool "Toolchain has program invocation support?"
+ select BR2_PROGRAM_INVOCATION
+ help
+ Select this option if your external toolchain has program
+ invocation support. If you don't know, leave the default
+ value, Buildroot will tell you if it's correct or not.
+
+endif
+
config BR2_TOOLCHAIN_EXTERNAL_STRIP
bool
default y
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 01/14] toolchain: Improve C library option selection
2010-12-13 16:27 ` [Buildroot] [PATCH 01/14] toolchain: Improve C library option selection Thomas Petazzoni
@ 2010-12-13 19:44 ` Yann E. MORIN
0 siblings, 0 replies; 29+ messages in thread
From: Yann E. MORIN @ 2010-12-13 19:44 UTC (permalink / raw)
To: buildroot
On Monday 13 December 2010 17:27:37 Thomas Petazzoni wrote:
> Turn BR2_LARGEFILE, BR2_INET_IPV6, BR2_INET_RPC, BR2_USE_WCHAR,
> BR2_ENABLE_LOCALE and BR2_PROGRAM_INVOCATION into hidden options.
[--SNIP--]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
--
.-----------------.--------------------.------------------.--------------------.
| 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] 29+ messages in thread
* [Buildroot] [PATCH 02/14] toolchain: remove ending semi-colon in helpers
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 01/14] toolchain: Improve C library option selection Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 19:46 ` Yann E. MORIN
2010-12-13 16:27 ` [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download Thomas Petazzoni
` (12 subsequent siblings)
14 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
Some helpers had their final line ending with a semi-colon, some did
not. For consistency, remove the final semi-colon from all helpers,
it's the responsability of the caller to add the final semi-colon as
needed.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/helpers.mk | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 05d43e7..43c6db3 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -201,7 +201,7 @@ check_uclibc = \
$(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) ;\
+ $(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
@@ -221,7 +221,7 @@ check_arm_abi = \
if [ x$(BR2_ARM_EABI) = x"y" -a $${EXT_TOOLCHAIN_ABI} = "oabi" ] ; then \
echo "Incorrect ABI setting" ; \
exit 1 ; \
- fi ; \
+ fi
#
# Check that the external toolchain supports C++
@@ -231,7 +231,7 @@ check_cplusplus = \
if test $$? -ne 0 ; then \
echo "BR2_INSTALL_LIBSTDCPP is selected but C++ support not available in external toolchain" ; \
exit 1 ; \
- fi ; \
+ fi
#
# Check that the cross-compiler given in the configuration exists
@@ -241,4 +241,4 @@ check_cross_compiler_exists = \
if test $$? -ne 0 ; then \
echo "Cannot execute cross-compiler '$(TARGET_CC)'" ; \
exit 1 ; \
- fi ; \
+ fi
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 02/14] toolchain: remove ending semi-colon in helpers
2010-12-13 16:27 ` [Buildroot] [PATCH 02/14] toolchain: remove ending semi-colon in helpers Thomas Petazzoni
@ 2010-12-13 19:46 ` Yann E. MORIN
0 siblings, 0 replies; 29+ messages in thread
From: Yann E. MORIN @ 2010-12-13 19:46 UTC (permalink / raw)
To: buildroot
On Monday 13 December 2010 17:27:38 Thomas Petazzoni wrote:
> Some helpers had their final line ending with a semi-colon, some did
> not. For consistency, remove the final semi-colon from all helpers,
> it's the responsability of the caller to add the final semi-colon as
> needed.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
--
.-----------------.--------------------.------------------.--------------------.
| 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] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 01/14] toolchain: Improve C library option selection Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 02/14] toolchain: remove ending semi-colon in helpers Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-14 20:48 ` Mike Frysinger
2010-12-15 11:17 ` Mike Frysinger
2010-12-13 16:27 ` [Buildroot] [PATCH 04/14] toolchain: remove toolchain-specific stripping Thomas Petazzoni
` (11 subsequent siblings)
14 siblings, 2 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
Instead of letting the user define all the details of his external
toolchain, we define a set of profiles for well-known external
toolchains (CodeSourcery ones only at the moment, can easily be
extended with other toolchains).
Once a profile has been choosen, the user is offered the choice of
either letting Buildroot download and install the external toolchain,
or (as before) to tell Buildroot where the toolchain is installed on
the system.
We of course provide a "custom profile", through which the user can
configure Buildroot to use a custom external toolchain for which no
profile is available.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Makefile | 3 +-
package/Makefile.in | 10 +-
toolchain/Config.in | 5 +-
toolchain/toolchain-external/Config.in | 168 ++++++++++++++++++++++--
toolchain/toolchain-external/Config.in.2 | 17 ---
toolchain/toolchain-external/ext-tool.mk | 210 +++++++++++++++++++++---------
6 files changed, 315 insertions(+), 98 deletions(-)
delete mode 100644 toolchain/toolchain-external/Config.in.2
diff --git a/Makefile b/Makefile
index 7d6e4af..f6ab07e 100644
--- a/Makefile
+++ b/Makefile
@@ -279,6 +279,7 @@ STAMP_DIR:=$(BASE_DIR)/stamps
BINARIES_DIR:=$(BASE_DIR)/images
TARGET_DIR:=$(BASE_DIR)/target
TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
+TOOLCHAIN_EXTERNAL_DIR=$(BASE_DIR)/external-toolchain
TARGET_SKELETON=$(TOPDIR)/fs/skeleton
BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
@@ -600,7 +601,7 @@ endif
clean:
rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
- $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR)
+ $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(TOOLCHAIN_EXTERNAL_DIR)
distclean: clean
ifeq ($(DL_DIR),$(TOPDIR)/dl)
diff --git a/package/Makefile.in b/package/Makefile.in
index d448a7e..36bd59f 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -114,13 +114,13 @@ REAL_GNU_TARGET_NAME=$(ARCH)-unknown-linux-$(LIBC)$(ABI)
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
-TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
-ifneq ($(TOOLCHAIN_EXTERNAL_PATH),)
-TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
+TOOLCHAIN_EXTERNAL_PREFIX=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
+TOOLCHAIN_EXTERNAL_LOCATION=$(TOOLCHAIN_EXTERNAL_DIR)
else
-TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PREFIX)-
+TOOLCHAIN_EXTERNAL_LOCATION=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
endif
+TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_LOCATION)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
TARGET_CROSS=$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-
endif
diff --git a/toolchain/Config.in b/toolchain/Config.in
index d476cbf..8baa0c1 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -13,6 +13,10 @@ config BR2_TOOLCHAIN_BUILDROOT
config BR2_TOOLCHAIN_EXTERNAL
bool "External toolchain"
+ help
+ Select if you want to use an existing cross-compiling
+ toolchain. Buildroot can either download automatically a
+ toolchain, or use an already installed toolchain.
config BR2_TOOLCHAIN_CTNG
bool "Crosstool-NG toolchain"
@@ -29,6 +33,5 @@ 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"
endmenu
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index f0268a7..c2602d2 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -1,15 +1,142 @@
-#
-
if BR2_TOOLCHAIN_EXTERNAL
+
choice
- prompt "External toolchain C library"
- default BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ prompt "Toolchain"
-config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
- bool "uClibc"
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
+ bool "CodeSourcery ARM 2010.09"
+ depends on BR2_arm
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the ARM architecture, from CodeSourcery. It
+ uses gcc 4.5.1, binutils 2.20, glibc 2.11 and gdb 7.2.50,
+ kernel headers 2.6.35.2. It has support for the following
+ variants:
+ - ARMv5TE, little endian, soft-float, glibc
+ - ARMv4T, little endian, soft-float, glibc
+ - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
+ bool "CodeSourcery ARM 2010q1"
+ depends on BR2_arm
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the ARM architecture, from CodeSourcery. It
+ uses gcc 4.4.1, binutils 2.19, glibc 2.11, gdb 7.0.50 and
+ kernel headers 2.6.32. It has support for the following
+ variants:
+ - ARMv5T, little endian, soft-float, glibc
+ - ARMv4T, little endian, soft-float, glibc
+ - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1
+ bool "CodeSourcery ARM 2009q1"
+ depends on BR2_arm
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the ARM architecture, from CodeSourcery. It
+ uses gcc 4.3.3, binutils 2.19, glibc 2.8 and gdb 6.8 and
+ kernel headers 2.6.30. It has support for the following
+ variants:
+ - ARMv5T, little endian, soft-float, glibc
+ - ARMv4T, little endian, soft-float, glibc
+ - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
+ bool "CodeSourcery MIPS 4.4"
+ depends on BR2_mips || BR2_mipsel
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the MIPS architecture, from CodeSourcery. It
+ uses gcc 4.4.1, binutils 2.19, glibc 2.11, uClibc 0.9.30 and
+ gdb 7.0, kernel headers 2.6.32. It has support for the
+ following variants:
+ - MIPS32 O32 big endian glibc
+ - MIPS32 O32 little endian glibc
+ - MIPS32 big endian soft float glibc
+ - MIPS32 little endian soft float glibc
+ - MIPS32 big endian microMIPS glibc
+ - MIPS32 little endian microMIPS glibc
+ - MIPS32 big endian soft float microMIPS glibc
+ - MIPS32 little endian soft float microMIPS glibc
+ - MIPS32 big endian uclibc
+ - MIPS32 little endian uclibc
+ - MIPS32 big endian soft float uclibc
+ - MIPS32 little endian soft float uclibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
+ bool "CodeSoucery PowerPC 2010.09"
+ depends on BR2_powerpc
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the PowerPC architecture, from
+ CodeSourcery. It uses gcc 4.5.1, binutils 2.20, glibc 2.11,
+ gdb 7.2.50 and kernel headers 2.6.35.2. It has support for
+ the following variants:
+ - 603 glibc, 32 bits
+ - 603 soft float glibc, 32 bits
+ - e600 altivec glibc, 32 bits
+ - e500v1 glibc, 32 bits
+ - e500v2 glibc, 32 bits
+ - e500mc glibc, 32 bits
+ - 970 glibc hard-float, 64 bits
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
+ bool "CodeSoucery PowerPC 2010.09"
+ depends on BR2_sh
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the SuperH architecture, from CodeSourcery. It
+ uses gcc 4.5.1, binutils 2.20, glibc 2.11, uClibc 0.9.30,
+ gdb 7.2.50 and kernel headers 2.6.35.2. It has support for
+ the following variants:
+ - SH4A, glibc, little endian
+ - SH4A, glibc, big endian
+ - SH4A, uClibc, little endian
+ - SH4A, uClibc, big endian
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+ bool "Custom toolchain"
+ help
+ Use this option to use a custom toolchain pre-installed on
+ your system.
+
+endchoice
+
+config BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+ bool "Download toolchain automatically"
+ default y
+ depends on !BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+ help
+ When enabled, Buildroot will automatically download and
+ install the selected external toolchain. When disabled,
+ Buildroot will use a pre-installed toolchain.
+
+config BR2_TOOLCHAIN_EXTERNAL_PATH
+ string "Toolchain path"
+ default "/path/to/toolchain/usr"
+ depends on !BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+ help
+ Path to where the external toolchain is installed.
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
+ string "Toolchain prefix"
+ depends on BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+ default "$(ARCH)-linux"
+
+config BR2_TOOLCHAIN_EXTERNAL_PREFIX
+ string
+ default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1
+ default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
+ default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
+ default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
+ default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
+ default "sh4-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
+ default $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \
+ if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
config BR2_TOOLCHAIN_EXTERNAL_GLIBC
- bool "glibc"
+ bool
select BR2_LARGEFILE
select BR2_INET_IPV6
select BR2_INET_RPC
@@ -17,9 +144,26 @@ config BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_ENABLE_LOCALE
select BR2_PROGRAM_INVOCATION
+config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ bool
+
+if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+
+choice
+ prompt "External toolchain C library"
+ default BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+ bool "uClibc"
+ select BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC
+ bool "glibc"
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+
endchoice
-if BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+if BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
config BR2_TOOLCHAIN_EXTERNAL_LARGEFILE
bool "Toolchain has large file support?"
@@ -70,7 +214,9 @@ config BR2_TOOLCHAIN_EXTERNAL_PROGRAM_INVOCATION
invocation support. If you don't know, leave the default
value, Buildroot will tell you if it's correct or not.
-endif
+endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+
+endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM
config BR2_TOOLCHAIN_EXTERNAL_STRIP
bool
@@ -78,4 +224,6 @@ config BR2_TOOLCHAIN_EXTERNAL_STRIP
prompt "Strip shared libraries"
help
Strip shared libraries copied from the external toolchain.
-endif
+
+endif # BR2_TOOLCHAIN_EXTERNAL
+
diff --git a/toolchain/toolchain-external/Config.in.2 b/toolchain/toolchain-external/Config.in.2
deleted file mode 100644
index 489558c..0000000
--- a/toolchain/toolchain-external/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/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 53ad636..7a17914 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -2,8 +2,9 @@
#
# 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:
+# Buildroot can download from the Web or 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
@@ -13,17 +14,21 @@
#
# 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.
+# 1. a. For toolchains downloaded from the Web, Buildroot already
+# knows their configuration, so it just downloads them and extract
+# them in $(TOOLCHAIN_EXTERNAL_DIR).
+#
+# 1. b. For pre-installed toolchains, 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
@@ -55,61 +60,138 @@ LIB_EXTERNAL_LIBS+=libthread_db.so
endif # gdbserver
endif # ! no threads
-# 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 any option to gcc that
-# could select a multilib variant as we want the "main" sysroot, which
-# contains all variants of the C library in the case of multilib
-# toolchains.
+# Details about sysroot directory selection.
+#
+# To find the sysroot directory:
+#
+# * 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.
+#
+# When doing those tests, we don't pass any option to gcc that could
+# select a multilib variant (such as -march) as we want the "main"
+# sysroot, which contains all variants of the C library in the case of
+# multilib toolchains. We use the TARGET_CC_NO_SYSROOT variable, which
+# is the path of the cross-compiler, without the
+# --sysroot=$(STAGING_DIR), since what we want to find is the location
+# of the original toolchain sysroot. This "main" sysroot directory is
+# stored in SYSROOT_DIR.
+#
+# Then, multilib toolchains are a little bit more complicated, since
+# they in fact have multiple sysroots, one for each variant supported
+# by the toolchain. So we need to find the particular sysroot we're
+# interested in.
+#
+# To do so, we ask the compiler where its sysroot is by passing all
+# flags (including -march and al.), except the --sysroot flag since we
+# want to the compiler to tell us where its original sysroot
+# is. 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.
+#
+# One might wonder why we don't just bother with ARCH_SYSROOT_DIR. The
+# fact is that in multilib toolchains, the header files are often only
+# present in the main sysroot, and only the libraries are available in
+# each variant-specific sysroot directory.
+
TARGET_CC_NO_SYSROOT=$(filter-out --sysroot=%,$(TARGET_CC_NOCCACHE))
-SYSROOT_DIR=$(shell $(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null)
-ifeq ($(SYSROOT_DIR),)
-SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;')
+
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
+TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(TOOLCHAIN_EXTERNAL_DIR)/.extracted
+else
+TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(STAMP_DIR)/ext-toolchain-checked
+endif
+
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/
+TOOLCHAIN_EXTERNAL_SOURCE=arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package6488/public/arm-none-linux-gnueabi/
+TOOLCHAIN_EXTERNAL_SOURCE=arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package7851/public/arm-none-linux-gnueabi/
+TOOLCHAIN_EXTERNAL_SOURCE=arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/mips/portal/package7401/public/mips-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE=mips-4.4-303-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/power/portal/package7703/public/powerpc-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE=freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/superh/portal/package7783/public/sh-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE=renesas-2010.09-45-sh-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else
+# A value must be set (even if unused), otherwise the
+# $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main
+# $(DL_DIR) rule
+TOOLCHAIN_EXTERNAL_SOURCE=none
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 all
-# flags, except the --sysroot flag since we want to the compiler to
-# tell us where its original sysroot is. 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.
-ARCH_SUBDIR=$(shell $(TARGET_CC_NO_SYSROOT) $(TARGET_CFLAGS) -print-multi-directory)
-ARCH_SYSROOT_DIR=$(SYSROOT_DIR)/$(ARCH_SUBDIR)
+# Download and extraction of a toolchain
+$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
+ $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
+
+$(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
+ mkdir -p $(@D)
+ $(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE))) $^ | $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+ touch $@
-$(STAMP_DIR)/ext-toolchain-installed:
+# Checks for an already installed toolchain: check the toolchain
+# location, check that it supports sysroot, and then verify that it
+# matches the configuration provided in Buildroot: ABI, C++ support,
+# type of C library and all C library features.
+$(STAMP_DIR)/ext-toolchain-checked:
@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_INSTALL_LIBSTDCPP),y)
- $(Q)$(call check_cplusplus)
-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 $(LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
- done
- $(Q)for libs in $(USR_LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,/usr/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
- done
- @echo "Copy external toolchain sysroot to staging..."
- $(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR),$(ARCH_SYSROOT_DIR),$(ARCH_SUBDIR))
- # Create lib64 symbolic links if needed
- $(Q)if [ -L $(ARCH_SYSROOT_DIR)/lib64 ] ; then \
- $(call create_lib64_symlinks) ; \
+ $(Q)SYSROOT_DIR=`$(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null` ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ SYSROOT_DIR=`readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;'` ; \
+ fi ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \
+ exit 1 ; \
+ fi ; \
+ if test x$(BR2_arm) == x"y" ; then \
+ $(call check_arm_abi) ; \
+ fi ; \
+ if test x$(BR2_INSTALL_LIBSTDCPP) == x"y" ; then \
+ $(call check_cplusplus) ; \
+ fi ; \
+ if test x$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC) == x"y" ; then \
+ $(call check_uclibc,$${SYSROOT_DIR}) ; \
+ else \
+ $(call check_glibc,$${SYSROOT_DIR}) ; \
fi
- @touch $@
+
+# Integration of the toolchain into Buildroot: find the main sysroot
+# and the variant-specific sysroot, then copy the needed libraries to
+# the $(TARGET_DIR) and copy the whole sysroot (libraries and headers)
+# to $(STAGING_DIR).
+$(STAMP_DIR)/ext-toolchain-installed: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
+ $(Q)SYSROOT_DIR=`$(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null` ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ SYSROOT_DIR=`readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;'` ; \
+ fi ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \
+ exit 1 ; \
+ fi ; \
+ ARCH_SUBDIR=`$(TARGET_CC_NO_SYSROOT) $(TARGET_CFLAGS) -print-multi-directory` ; \
+ ARCH_SYSROOT_DIR=$${SYSROOT_DIR}/$${ARCH_SUBDIR} ; \
+ mkdir -p $(TARGET_DIR)/lib ; \
+ echo "Copy external toolchain libraries to target..." ; \
+ for libs in $(LIB_EXTERNAL_LIBS); do \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ done ; \
+ for libs in $(USR_LIB_EXTERNAL_LIBS); do \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/usr/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ done ; \
+ echo "Copy external toolchain sysroot to staging..." ; \
+ $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR}) ; \
+ if [ -L $${ARCH_SYSROOT_DIR}/lib64 ] ; then \
+ $(call create_lib64_symlinks) ; \
+ fi ; \
+ touch $@
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-13 16:27 ` [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download Thomas Petazzoni
@ 2010-12-14 20:48 ` Mike Frysinger
2010-12-15 10:31 ` Thomas Petazzoni
2010-12-15 11:17 ` Mike Frysinger
1 sibling, 1 reply; 29+ messages in thread
From: Mike Frysinger @ 2010-12-14 20:48 UTC (permalink / raw)
To: buildroot
On Monday, December 13, 2010 11:27:39 Thomas Petazzoni wrote:
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -114,13 +114,13 @@
> ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
> TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
> else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
> -TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
> -TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
> -ifneq ($(TOOLCHAIN_EXTERNAL_PATH),)
> -TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
> +TOOLCHAIN_EXTERNAL_PREFIX=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
> +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
> +TOOLCHAIN_EXTERNAL_LOCATION=$(TOOLCHAIN_EXTERNAL_DIR)
> else
> -TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PREFIX)-
> +TOOLCHAIN_EXTERNAL_LOCATION=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
> endif
> +TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_LOCATION)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
> else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
> TARGET_CROSS=$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-
> endif
this makes it harder to use an external toolchain because you now force
TARGET_CROSS to always start with /bin/. before, people could easily set the
full path to nothing and the prefix to the toolchain they want. since the
toolchain is in $PATH, there's no reason to force a useless full path to it.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101214/b03a3fcd/attachment.pgp>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-14 20:48 ` Mike Frysinger
@ 2010-12-15 10:31 ` Thomas Petazzoni
2010-12-15 11:14 ` Mike Frysinger
0 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-15 10:31 UTC (permalink / raw)
To: buildroot
On Tue, 14 Dec 2010 15:48:38 -0500
Mike Frysinger <vapier@gentoo.org> wrote:
> this makes it harder to use an external toolchain because you now
> force TARGET_CROSS to always start with /bin/. before, people could
> easily set the full path to nothing and the prefix to the toolchain
> they want. since the toolchain is in $PATH, there's no reason to
> force a useless full path to it. -mike
Right, this is a regression from an useful feature, I'll have a look
into this and see what I can come up with.
Regarding this toolchain profile thing, I intended to extend it to
support the Blackfin toolchains, but I'd like to make sure you're not
already working on this, in order to avoid duplication.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101215/e420d905/attachment.pgp>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-15 10:31 ` Thomas Petazzoni
@ 2010-12-15 11:14 ` Mike Frysinger
2010-12-15 21:38 ` Thomas Petazzoni
0 siblings, 1 reply; 29+ messages in thread
From: Mike Frysinger @ 2010-12-15 11:14 UTC (permalink / raw)
To: buildroot
On Wednesday, December 15, 2010 05:31:52 Thomas Petazzoni wrote:
> Regarding this toolchain profile thing, I intended to extend it to
> support the Blackfin toolchains, but I'd like to make sure you're not
> already working on this, in order to avoid duplication.
it seems the profiles thing only supports downloading toolchain binaries ? in
the Blackfin setup, the toolchain is usually installed via the host package
manager (we offer rpms/debs/etc...), so that still wouldnt work for us ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101215/98cba22a/attachment-0001.pgp>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-15 11:14 ` Mike Frysinger
@ 2010-12-15 21:38 ` Thomas Petazzoni
2011-01-25 13:19 ` Thomas Petazzoni
0 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-15 21:38 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Dec 2010 06:14:43 -0500
Mike Frysinger <vapier@gentoo.org> wrote:
> it seems the profiles thing only supports downloading toolchain
> binaries ? in the Blackfin setup, the toolchain is usually installed
> via the host package manager (we offer rpms/debs/etc...), so that
> still wouldnt work for us ... -mike
Below a very experimental/hackish way of integrating the Blackfin
toolchain into the existing logic. I've tested, I can successfully
build Busybox in both FLAT mode and FDPIC mode, with Buildroot that
downloads/installs the toolchain automatically.
The patch is not meant for inclusion yet, there are things I don't like
in it. It's just to show how I think it could work.
Thomas
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-15 21:38 ` Thomas Petazzoni
@ 2011-01-25 13:19 ` Thomas Petazzoni
0 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2011-01-25 13:19 UTC (permalink / raw)
To: buildroot
Hello Mike,
What do you think of the below proposal ?
Regards,
Thomas
On Wed, 15 Dec 2010 22:38:34 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Wed, 15 Dec 2010 06:14:43 -0500
> Mike Frysinger <vapier@gentoo.org> wrote:
>
> > it seems the profiles thing only supports downloading toolchain
> > binaries ? in the Blackfin setup, the toolchain is usually installed
> > via the host package manager (we offer rpms/debs/etc...), so that
> > still wouldnt work for us ... -mike
>
> Below a very experimental/hackish way of integrating the Blackfin
> toolchain into the existing logic. I've tested, I can successfully
> build Busybox in both FLAT mode and FDPIC mode, with Buildroot that
> downloads/installs the toolchain automatically.
>
> The patch is not meant for inclusion yet, there are things I don't like
> in it. It's just to show how I think it could work.
>
> Thomas
>
> From 5a317c7fc771a8feebbdef81d83134225baf3591 Mon Sep 17 00:00:00 2001
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Date: Wed, 15 Dec 2010 22:32:13 +0100
> Subject: [PATCH] toolchain: add support for Blackfin toolchain
>
> WARNING: This is not for inclusion, only for demonstration.
>
> The Blackfin toolchain toolchain is delivered in two parts, one part
> with toolchain binaries, and another with the libraries, normally
> installed into /opt/uClinux/bfin-uclinux and
> /opt/uClinux/bfin-linux-uclibc. For those reasons, we need to extend a
> bit the external toolchain download/extraction strategy to :
>
> * Be able to download two tarballs instead of one
>
> * Be able to specify a per-toolchain number of directories to be
> skipped when uncompressing the tarball.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> toolchain/toolchain-external/Config.in | 9 +++++++++
> toolchain/toolchain-external/ext-tool.mk | 28 ++++++++++++++++++++++++++--
> 2 files changed, 35 insertions(+), 2 deletions(-)
>
> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index 8eab6de..126796d 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -101,6 +101,13 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
> - SH4A, uClibc, little endian
> - SH4A, uClibc, big endian
>
> +config BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_2010R1
> + bool "Blackfin toolchain 2010R1"
> + depends on BR2_bfin
> + select BR2_TOOLCHAIN_EXTERNAL_UCLIBC
> + help
> + Blackfin toolchain
> +
> config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
> bool "Custom toolchain"
> help
> @@ -149,6 +156,8 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX
> default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
> default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
> default "sh4-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
> + default "bfin-linux-uclibc" if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_2010R1 && BR2_ABI_ELF
> + default "bfin-uclinux" if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_2010R1 && BR2_ABI_FLAT
> default $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \
> if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
>
> diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
> index 6c83ca1..edd7bf5 100644
> --- a/toolchain/toolchain-external/ext-tool.mk
> +++ b/toolchain/toolchain-external/ext-tool.mk
> @@ -129,6 +129,12 @@ TOOLCHAIN_EXTERNAL_SOURCE=freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-g
> else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009),y)
> TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/superh/portal/package7783/public/sh-linux-gnu/
> TOOLCHAIN_EXTERNAL_SOURCE=renesas-2010.09-45-sh-linux-gnu-i686-pc-linux-gnu.tar.bz2
> +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_2010R1),y)
> +TOOLCHAIN_EXTERNAL_SITE = http://blackfin.uclinux.org/gf/download/frsrelease/501/8378/
> +TOOLCHAIN_EXTERNAL_SOURCE = blackfin-toolchain-2010R1-RC4.i386.tar.bz2
> +TOOLCHAIN_EXTERNAL_SITE_BIS = http://blackfin.uclinux.org/gf/download/frsrelease/501/8386/
> +TOOLCHAIN_EXTERNAL_SOURCE_BIS = blackfin-toolchain-uclibc-full-2010R1-RC4.i386.tar.bz2
> +TOOLCHAIN_EXTERNAL_STRIP_COMPONENTS = 4
> else
> # A value must be set (even if unused), otherwise the
> # $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main
> @@ -136,13 +142,31 @@ else
> TOOLCHAIN_EXTERNAL_SOURCE=none
> endif
>
> +ifeq ($(TOOLCHAIN_EXTERNAL_SOURCE_BIS),)
> +TOOLCHAIN_EXTERNAL_SOURCE_BIS=none
> +endif
> +
> +ifeq ($(TOOLCHAIN_EXTERNAL_STRIP_COMPONENTS),)
> +TOOLCHAIN_EXTERNAL_STRIP_COMPONENTS=1
> +endif
> +
> # Download and extraction of a toolchain
> $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
> $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
>
> -$(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
> +$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_BIS):
> + $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_BIS),$(TOOLCHAIN_EXTERNAL_SOURCE_BIS))
> +
> +$(TOOLCHAIN_EXTERNAL_DIR)/.extracted: \
> + $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) \
> + $(if $(filter none,$(TOOLCHAIN_EXTERNAL_SOURCE_BIS)),,$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_BIS))
> mkdir -p $(@D)
> - $(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE))) $^ | $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
> + $(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE))) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) | \
> + $(TAR) $(TAR_STRIP_COMPONENTS)=$(TOOLCHAIN_EXTERNAL_STRIP_COMPONENTS) -C $(@D) $(TAR_OPTIONS) -
> +ifneq ($(TOOLCHAIN_EXTERNAL_SOURCE_BIS),none)
> + $(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE_BIS))) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_BIS) | \
> + $(TAR) $(TAR_STRIP_COMPONENTS)=$(TOOLCHAIN_EXTERNAL_STRIP_COMPONENTS) -C $(@D) $(TAR_OPTIONS) -
> +endif
> touch $@
>
> # Checks for an already installed toolchain: check the toolchain
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110125/963acca7/attachment.asc>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-13 16:27 ` [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download Thomas Petazzoni
2010-12-14 20:48 ` Mike Frysinger
@ 2010-12-15 11:17 ` Mike Frysinger
1 sibling, 0 replies; 29+ messages in thread
From: Mike Frysinger @ 2010-12-15 11:17 UTC (permalink / raw)
To: buildroot
On Monday, December 13, 2010 11:27:39 Thomas Petazzoni wrote:
> +TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/
> +TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package6488/public/arm-none-linux-gnueabi/
> +TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package7851/public/arm-none-linux-gnueabi/
> +TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/mips/portal/package7401/public/mips-linux-gnu/
> +TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/power/portal/package7703/public/powerpc-linux-gnu/
> +TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/superh/portal/package7783/public/sh-linux-gnu/
also, these URLs might be more complicated than necessary ... if you fetch
these guys, they get redirected to a much more sensible location:
http://www.codesourcery.com/public/gnu_toolchain/<target>/<tarball>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101215/03dbe6be/attachment.pgp>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 04/14] toolchain: remove toolchain-specific stripping
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (2 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 19:47 ` Yann E. MORIN
2010-12-13 16:27 ` [Buildroot] [PATCH 05/14] toolchain: rework C++ options Thomas Petazzoni
` (10 subsequent siblings)
14 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
We already handle the stripping of libraries in $(TARGET_DIR) at the
global level, so there's no need to have toolchain-specific option and
code for this.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/helpers.mk | 9 ---------
toolchain/toolchain-crosstool-ng/Config.in | 6 ------
toolchain/toolchain-crosstool-ng/crosstool-ng.mk | 4 ++--
toolchain/toolchain-external/Config.in | 7 -------
toolchain/toolchain-external/ext-tool.mk | 4 ++--
5 files changed, 4 insertions(+), 26 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 43c6db3..24f379d 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -15,13 +15,11 @@
# $1: arch specific sysroot directory
# $2: library name
# $3: destination directory of the libary, relative to $(TARGET_DIR)
-# $4: strip (y|n), default is to strip
#
copy_toolchain_lib_root = \
ARCH_SYSROOT_DIR="$(strip $1)"; \
LIB="$(strip $2)"; \
DESTDIR="$(strip $3)" ; \
- STRIP="$(strip $4)"; \
\
LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
find -L . -path "./lib/$${LIB}.*" -o \
@@ -39,13 +37,6 @@ copy_toolchain_lib_root = \
cp -d $${FULLPATH} $(TARGET_DIR)/$${DESTDIR}/; \
elif test -f $${FULLPATH}; then \
$(INSTALL) -D -m0755 $${FULLPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIB}; \
- case "$${STRIP}" in \
- (0 | n | no) \
-;; \
- (*) \
- $(TARGET_CROSS)strip "$(TARGET_DIR)/$${DESTDIR}/$${LIB}"; \
-;; \
- esac; \
else \
exit -1; \
fi; \
diff --git a/toolchain/toolchain-crosstool-ng/Config.in b/toolchain/toolchain-crosstool-ng/Config.in
index 4f30588..4ee665d 100644
--- a/toolchain/toolchain-crosstool-ng/Config.in
+++ b/toolchain/toolchain-crosstool-ng/Config.in
@@ -98,10 +98,4 @@ config BR2_TOOLCHAIN_CTNG_uClibc_PROGRAM_INVOCATION
endif # BR2_TOOLCHAIN_CTNG_uClibc
-config BR2_TOOLCHAIN_CTNG_STRIP_LIBS
- bool "Strip libs copied to target"
- default !BR2_STRIP_none
- help
- Strip shared libraries copied from the toolchain.
-
endif # BR2_TOOLCHAIN_CTNG
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
index 31797c4..1c5e864 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
@@ -65,10 +65,10 @@ $(STAMP_DIR)/ct-ng-toolchain-installed: $(STAMP_DIR)/ct-ng-toolchain-built
echo "CTNG_SYSROOT='$${CTNG_SYSROOT}'"; \
echo "Copy external toolchain libraries to target..."; \
for libs in $(CTNG_LIBS_LIB); do \
- $(call copy_toolchain_lib_root,$${CTNG_SYSROOT},$$libs,/lib,$(BR2_TOOLCHAIN_CTNG_STRIP_LIBS)); \
+ $(call copy_toolchain_lib_root,$${CTNG_SYSROOT},$$libs,/lib); \
done; \
for libs in $(CTNG_LIBS_USR_LIB); do \
- $(call copy_toolchain_lib_root,$${CTNG_SYSROOT},$$libs,/usr/lib,$(BR2_TOOLCHAIN_CTNG_STRIP_LIBS)); \
+ $(call copy_toolchain_lib_root,$${CTNG_SYSROOT},$$libs,/usr/lib); \
done; \
echo "Copy external toolchain sysroot to staging..."; \
$(call copy_toolchain_sysroot,$${CTNG_SYSROOT},$${CTNG_SYSROOT},)
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index c2602d2..59fcb52 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -218,12 +218,5 @@ endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM
-config BR2_TOOLCHAIN_EXTERNAL_STRIP
- bool
- default y
- prompt "Strip shared libraries"
- help
- Strip shared libraries copied from the external toolchain.
-
endif # BR2_TOOLCHAIN_EXTERNAL
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 7a17914..71aa127 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -184,10 +184,10 @@ $(STAMP_DIR)/ext-toolchain-installed: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
mkdir -p $(TARGET_DIR)/lib ; \
echo "Copy external toolchain libraries to target..." ; \
for libs in $(LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/lib); \
done ; \
for libs in $(USR_LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/usr/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/usr/lib); \
done ; \
echo "Copy external toolchain sysroot to staging..." ; \
$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR}) ; \
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 04/14] toolchain: remove toolchain-specific stripping
2010-12-13 16:27 ` [Buildroot] [PATCH 04/14] toolchain: remove toolchain-specific stripping Thomas Petazzoni
@ 2010-12-13 19:47 ` Yann E. MORIN
0 siblings, 0 replies; 29+ messages in thread
From: Yann E. MORIN @ 2010-12-13 19:47 UTC (permalink / raw)
To: buildroot
On Monday 13 December 2010 17:27:40 Thomas Petazzoni wrote:
> We already handle the stripping of libraries in $(TARGET_DIR) at the
> global level, so there's no need to have toolchain-specific option and
> code for this.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
--
.-----------------.--------------------.------------------.--------------------.
| 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] 29+ messages in thread
* [Buildroot] [PATCH 05/14] toolchain: rework C++ options
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (3 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 04/14] toolchain: remove toolchain-specific stripping Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 19:47 ` Yann E. MORIN
2010-12-13 16:27 ` [Buildroot] [PATCH 06/14] toolchain: move Stack Protection Support option Thomas Petazzoni
` (9 subsequent siblings)
14 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
Instead of having BR2_GCC_CROSS_CXX and BR2_INSTALL_LIBSTDCPP, with
BR2_GCC_CROSS_CXX not being visible (and therefore being useless),
let's just keep BR2_INSTALL_LIBSTDCPP to enable C++ in the toolchain
and install C++ libraries on the target.
We also take that opportunity to make BR2_INSTALL_LIBSTDCPP an hidden
option, which is selected by an option in Buildroot toolchain support
or an option in External toolchain support, just as we did for other
toolchain features.
Some work definitely remains to be done :
- The name BR2_INSTALL_LIBSTDCPP is ugly, but we keep it for the
moment in order to avoid changing all packages.
- We should clarify the other language-related options (Fortran,
Java, Objective-C, etc.).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/Makefile.in | 2 +-
package/lzma/Config.in | 4 +-
package/rpm/Config.in | 4 +-
toolchain/gcc/gcc-uclibc-4.x.mk | 2 +-
toolchain/helpers.mk | 2 +-
toolchain/toolchain-buildroot/Config.in.2 | 16 ++++++++++++++
toolchain/toolchain-common.in | 25 ++-------------------
toolchain/toolchain-crosstool-ng/Config.in | 8 +++++++
toolchain/toolchain-crosstool-ng/crosstool-ng.mk | 2 +-
toolchain/toolchain-external/Config.in | 14 ++++++++++++
10 files changed, 49 insertions(+), 30 deletions(-)
diff --git a/package/Makefile.in b/package/Makefile.in
index 36bd59f..71c8dbc 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -307,7 +307,7 @@ ifneq ($(BR2_INET_IPV6),y)
DISABLE_IPV6= --disable-ipv6
endif
-ifneq ($(BR2_GCC_CROSS_CXX),y)
+ifneq ($(BR2_INSTALL_LIBSTDCPP),y)
TARGET_CONFIGURE_OPTS+=CXX=false
endif
diff --git a/package/lzma/Config.in b/package/lzma/Config.in
index 4904721..2b94dde 100644
--- a/package/lzma/Config.in
+++ b/package/lzma/Config.in
@@ -1,6 +1,6 @@
config BR2_PACKAGE_LZMA
bool "lzma"
- depends on BR2_GCC_CROSS_CXX
+ depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_DEPRECATED
help
Lempel Ziv compression method (LZMA) is a compression
@@ -9,4 +9,4 @@ config BR2_PACKAGE_LZMA
http://tukaani.org/lzma/
comment "lzma requires a toolchain with C++ support"
- depends on !BR2_GCC_CROSS_CXX && BR2_DEPRECATED
+ depends on !BR2_INSTALL_LIBSTDCPP && BR2_DEPRECATED
diff --git a/package/rpm/Config.in b/package/rpm/Config.in
index 448606c..8d4c6a3 100644
--- a/package/rpm/Config.in
+++ b/package/rpm/Config.in
@@ -25,11 +25,11 @@ config BR2_PACKAGE_RPM_BZIP2_PAYLOADS
config BR2_PACKAGE_RPM_XZ_PAYLOADS
bool "support for xz payloads"
depends on BR2_PACKAGE_RPM
- depends on BR2_GCC_CROSS_CXX
+ depends on BR2_INSTALL_LIBSTDCPP
help
Support for xz payloads in RPM.
comment "xz payload support requires a toolchain with c++ support"
- depends on !BR2_GCC_CROSS_CXX
+ depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index af085f7..eec6523 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -67,7 +67,7 @@ GCC_STAGING_PREREQ+=$(STAGING_DIR)/usr/lib/libc.a
GCC_TARGET_LANGUAGES:=c
GCC_CROSS_LANGUAGES:=c
-ifeq ($(BR2_GCC_CROSS_CXX),y)
+ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),c++
endif
ifeq ($(BR2_GCC_CROSS_FORTRAN),y)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 24f379d..33f0484 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -220,7 +220,7 @@ check_arm_abi = \
check_cplusplus = \
$(TARGET_CXX) -v > /dev/null 2>&1 ; \
if test $$? -ne 0 ; then \
- echo "BR2_INSTALL_LIBSTDCPP is selected but C++ support not available in external toolchain" ; \
+ echo "C++ support is selected but is not available in external toolchain" ; \
exit 1 ; \
fi
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
index 2a8dcf5..cf426ee 100644
--- a/toolchain/toolchain-buildroot/Config.in.2
+++ b/toolchain/toolchain-buildroot/Config.in.2
@@ -51,6 +51,22 @@ config BR2_TOOLCHAIN_BUILDROOT_PROGRAM_INVOCATION
(like tar and coreutils) utilize these for extra useful
output, but in general are not required.
+config BR2_TOOLCHAIN_BUILDROOT_CXX
+ bool "Enable C++ support"
+ select BR2_INSTALL_LIBSTDCPP
+ depends on !(! BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE && \
+ BR2_TOOLCHAIN_BUILDROOT_LOCALE && \
+ BR2_UCLIBC_VERSION_0_9_31)
+ help
+ Enable this option if you want your toolchain to support the
+ C++ language and you want C++ libraries to be installed on
+ your target system.
+
+comment "C++ support broken in uClibc 0.9.31 with locale enabled with gcc 4.2"
+ depends on !BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE && \
+ BR2_TOOLCHAIN_BUILDROOT_LOCALE && \
+ BR2_UCLIBC_VERSION_0_9_31
+
source "toolchain/elf2flt/Config.in"
source "toolchain/mklibs/Config.in"
source "toolchain/sstrip/Config.in"
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index ea47466..2c54acd 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -23,6 +23,9 @@ config BR2_ENABLE_LOCALE
config BR2_PROGRAM_INVOCATION
bool
+config BR2_INSTALL_LIBSTDCPP
+ bool
+
config BR2_ENABLE_LOCALE_PURGE
bool "Purge unwanted locales"
help
@@ -108,28 +111,6 @@ choice
depends on BR2_UCLIBC_VERSION_SNAPSHOT
endchoice
-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_GCC_CROSS_CXX
- depends on !(! BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE && BR2_ENABLE_LOCALE && BR2_UCLIBC_VERSION_0_9_31)
- 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.
-
-comment "C++ support broken in uClibc 0.9.31 with locale enabled with gcc 4.2"
- depends on !BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE && BR2_ENABLE_LOCALE && BR2_UCLIBC_VERSION_0_9_31
-
config BR2_TARGET_OPTIMIZATION
string "Target Optimizations"
default "-pipe"
diff --git a/toolchain/toolchain-crosstool-ng/Config.in b/toolchain/toolchain-crosstool-ng/Config.in
index 4ee665d..82e223d 100644
--- a/toolchain/toolchain-crosstool-ng/Config.in
+++ b/toolchain/toolchain-crosstool-ng/Config.in
@@ -98,4 +98,12 @@ config BR2_TOOLCHAIN_CTNG_uClibc_PROGRAM_INVOCATION
endif # BR2_TOOLCHAIN_CTNG_uClibc
+config BR2_TOOLCHAIN_CTNG_CXX
+ bool "Enable C++ support"
+ select BR2_INSTALL_LIBSTDCPP
+ help
+ Enable this option if you want your toolchain to support the
+ C++ language and you want C++ libraries to be installed on
+ your target system.
+
endif # BR2_TOOLCHAIN_CTNG
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
index 1c5e864..817a1f7 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
@@ -207,7 +207,7 @@ CTNG_FIX_DOT_CONFIG_SED += s:^(CT_CC_PKGVERSION)="(.*)":\1="crosstool-NG $(CTNG_
ifneq ($(call qstrip,$(BR2_PACKAGE_GDB_SERVER))$(call qstrip,$(BR2_PACKAGE_GDB_HOST)),)
CTNG_FIX_DOT_CONFIG_SED += s:^(CT_DEBUG_gdb)=.*:\# \1 is not set:;
endif
-ifneq ($(call qstrip,$(BR2_INSTALL_LIBSTDCPP)),)
+ifeq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_CXX)),y)
CTNG_FIX_DOT_CONFIG_SED += s:^\# (CT_CC_LANG_CXX) is not set:\1=y:;
else
CTNG_FIX_DOT_CONFIG_SED += s:^(CT_CC_LANG_CXX)=.*:\# \1 is not set:;
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 59fcb52..bd22e0c 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -7,6 +7,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
bool "CodeSourcery ARM 2010.09"
depends on BR2_arm
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
help
Toolchain for the ARM architecture, from CodeSourcery. It
uses gcc 4.5.1, binutils 2.20, glibc 2.11 and gdb 7.2.50,
@@ -20,6 +21,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
bool "CodeSourcery ARM 2010q1"
depends on BR2_arm
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
help
Toolchain for the ARM architecture, from CodeSourcery. It
uses gcc 4.4.1, binutils 2.19, glibc 2.11, gdb 7.0.50 and
@@ -33,6 +35,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1
bool "CodeSourcery ARM 2009q1"
depends on BR2_arm
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
help
Toolchain for the ARM architecture, from CodeSourcery. It
uses gcc 4.3.3, binutils 2.19, glibc 2.8 and gdb 6.8 and
@@ -46,6 +49,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
bool "CodeSourcery MIPS 4.4"
depends on BR2_mips || BR2_mipsel
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
help
Toolchain for the MIPS architecture, from CodeSourcery. It
uses gcc 4.4.1, binutils 2.19, glibc 2.11, uClibc 0.9.30 and
@@ -68,6 +72,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
bool "CodeSoucery PowerPC 2010.09"
depends on BR2_powerpc
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
help
Toolchain for the PowerPC architecture, from
CodeSourcery. It uses gcc 4.5.1, binutils 2.20, glibc 2.11,
@@ -85,6 +90,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
bool "CodeSoucery PowerPC 2010.09"
depends on BR2_sh
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
help
Toolchain for the SuperH architecture, from CodeSourcery. It
uses gcc 4.5.1, binutils 2.20, glibc 2.11, uClibc 0.9.30,
@@ -216,6 +222,14 @@ config BR2_TOOLCHAIN_EXTERNAL_PROGRAM_INVOCATION
endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+config BR2_TOOLCHAIN_EXTERNAL_CXX
+ bool "Toolchain has C++ support?"
+ select BR2_INSTALL_LIBSTDCPP
+ help
+ Select this option if your external toolchain has C++
+ support. If you don't know, leave the default value,
+ Buildroot will tell you if it's correct or not.
+
endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM
endif # BR2_TOOLCHAIN_EXTERNAL
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 05/14] toolchain: rework C++ options
2010-12-13 16:27 ` [Buildroot] [PATCH 05/14] toolchain: rework C++ options Thomas Petazzoni
@ 2010-12-13 19:47 ` Yann E. MORIN
0 siblings, 0 replies; 29+ messages in thread
From: Yann E. MORIN @ 2010-12-13 19:47 UTC (permalink / raw)
To: buildroot
On Monday 13 December 2010 17:27:41 Thomas Petazzoni wrote:
> Instead of having BR2_GCC_CROSS_CXX and BR2_INSTALL_LIBSTDCPP, with
> BR2_GCC_CROSS_CXX not being visible (and therefore being useless),
> let's just keep BR2_INSTALL_LIBSTDCPP to enable C++ in the toolchain
> and install C++ libraries on the target.
[--SNIP--]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
--
.-----------------.--------------------.------------------.--------------------.
| 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] 29+ messages in thread
* [Buildroot] [PATCH 06/14] toolchain: move Stack Protection Support option
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (4 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 05/14] toolchain: rework C++ options Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 07/14] ltp-testsuite: bump version and use autotargets Thomas Petazzoni
` (8 subsequent siblings)
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
The BR2_USE_SSP option is only used inside the uClibc build, so only
meaningful for Buildroot internal toolchains. Therefore, the option is
moved to the right location so that it isn't visible when working with
external toolchains.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-buildroot/Config.in.2 | 9 +++++++++
toolchain/toolchain-common.in | 9 ---------
toolchain/uClibc/uclibc.mk | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
index cf426ee..f1b0a7c 100644
--- a/toolchain/toolchain-buildroot/Config.in.2
+++ b/toolchain/toolchain-buildroot/Config.in.2
@@ -67,6 +67,15 @@ comment "C++ support broken in uClibc 0.9.31 with locale enabled with gcc 4.2"
BR2_TOOLCHAIN_BUILDROOT_LOCALE && \
BR2_UCLIBC_VERSION_0_9_31
+config BR2_TOOLCHAIN_BUILDROOT_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.
+
source "toolchain/elf2flt/Config.in"
source "toolchain/mklibs/Config.in"
source "toolchain/sstrip/Config.in"
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 2c54acd..5502ab4 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -76,15 +76,6 @@ config BR2_SOFT_FLOAT
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
diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index 1ed40cc..e05e16c 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -271,7 +271,7 @@ else
-e 's,.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=y\nHAS_FPU=y\nUCLIBC_HAS_FLOATS=y\n,g' \
$(UCLIBC_DIR)/.oldconfig
endif
-ifeq ($(BR2_USE_SSP),y)
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT_USE_SSP),y)
$(SED) 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=y,g' $(UCLIBC_DIR)/.oldconfig
else
$(SED) 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=n,g' $(UCLIBC_DIR)/.oldconfig
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 07/14] ltp-testsuite: bump version and use autotargets
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (5 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 06/14] toolchain: move Stack Protection Support option Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 08/14] toolchain: rework thread options Thomas Petazzoni
` (7 subsequent siblings)
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
Reworking ltp-testsuite is needed in order to get rid of some
thread-specific options that will be cleaned-up in the next commit.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/ltp-testsuite/Config.in | 13 ++-
...tp-testsuite-20101031-disable-controllers.patch | 25 ++++
.../ltp-testsuite-disable-ipv6-tests.patch | 123 --------------------
.../ltp-testsuite-enable-openposix-for-nptl.patch | 33 -----
.../ltp-testsuite-generate-needs-bash.patch | 8 --
.../ltp-testsuite-sched-getaffinity.patch | 11 --
.../ltp-testsuite-uclibc-syscalls.patch | 11 --
package/ltp-testsuite/ltp-testsuite.mk | 68 +----------
8 files changed, 40 insertions(+), 252 deletions(-)
create mode 100644 package/ltp-testsuite/ltp-testsuite-20101031-disable-controllers.patch
delete mode 100644 package/ltp-testsuite/ltp-testsuite-disable-ipv6-tests.patch
delete mode 100644 package/ltp-testsuite/ltp-testsuite-enable-openposix-for-nptl.patch
delete mode 100644 package/ltp-testsuite/ltp-testsuite-generate-needs-bash.patch
delete mode 100644 package/ltp-testsuite/ltp-testsuite-sched-getaffinity.patch
delete mode 100644 package/ltp-testsuite/ltp-testsuite-uclibc-syscalls.patch
diff --git a/package/ltp-testsuite/Config.in b/package/ltp-testsuite/Config.in
index efe0db7..2ab4134 100644
--- a/package/ltp-testsuite/Config.in
+++ b/package/ltp-testsuite/Config.in
@@ -1,7 +1,16 @@
-config BR2_PACKAGE_LTP-TESTSUITE
+config BR2_PACKAGE_LTP_TESTSUITE
bool "ltp-testsuite"
- depends on BROKEN
+ depends on !BR2_PTHREADS_NONE
help
The Linux Test Project provides a huge testsuite for Linux.
+ The LTP testsuite uses several functions that are considered
+ obsolete, such as sigset() and others. Therefore, the LTP
+ testsuite does not build with Buildroot's default uClibc
+ configuration, and options such as
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL are needed.
+
http://ltp.sourceforge.net/
+
+comment "ltp-testsuite requires a toolchain with thread support"
+ depends on BR2_PTHREADS_NONE
diff --git a/package/ltp-testsuite/ltp-testsuite-20101031-disable-controllers.patch b/package/ltp-testsuite/ltp-testsuite-20101031-disable-controllers.patch
new file mode 100644
index 0000000..57d6038
--- /dev/null
+++ b/package/ltp-testsuite/ltp-testsuite-20101031-disable-controllers.patch
@@ -0,0 +1,25 @@
+Disable controllers testcases
+
+The cpuset controllers testcases do not build due to bug
+https://sourceforge.net/tracker/?func=detail&aid=3126942&group_id=3382&atid=103382. Disabling
+just the cpuset controllers do not seem to be easily possible, and
+those controller features are rarely used on embedded systems anyway.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ testcases/kernel/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ltp-testsuite-20101031/testcases/kernel/Makefile
+===================================================================
+--- ltp-testsuite-20101031.orig/testcases/kernel/Makefile
++++ ltp-testsuite-20101031/testcases/kernel/Makefile
+@@ -28,7 +28,7 @@
+ #
+ # KEEP THIS LIST ALPHABETIZED PLEASE!
+ ifneq ($(UCLINUX),1)
+-SUBDIRS := containers connectors controllers fs hotplug io ipc mem \
++SUBDIRS := containers connectors fs hotplug io ipc mem \
+ numa performance_counters power_management pty sched \
+ security syscalls timers tracing
+ else
diff --git a/package/ltp-testsuite/ltp-testsuite-disable-ipv6-tests.patch b/package/ltp-testsuite/ltp-testsuite-disable-ipv6-tests.patch
deleted file mode 100644
index 6f1a927..0000000
--- a/package/ltp-testsuite/ltp-testsuite-disable-ipv6-tests.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-diff -ur ltp-full-20070228/testcases/network/sctp/func_tests/Makefile ltp-full-20070228-patched/testcases/network/sctp/func_tests/Makefile
---- ltp-full-20070228/testcases/network/sctp/func_tests/Makefile 2007-02-28 22:40:32.000000000 -0600
-+++ ltp-full-20070228-patched/testcases/network/sctp/func_tests/Makefile 2007-07-05 22:40:08.524219814 -0500
-@@ -26,8 +26,6 @@
-
- LOADLIBES += $(LIBS) -lltp -lsctputil -lsctp -lpthread
-
--V6FLAGS = -DTEST_V6=1 $(CFLAGS)
--
- SRCS = $(wildcard *.c)
-
- V4_TARGETS = test_1_to_1_accept_close test_1_to_1_addrs test_1_to_1_connect \
-@@ -42,11 +40,7 @@
- test_sctp_sendrecvmsg test_sockopt test_tcp_style \
- test_timetolive test_1_to_1_connectx test_connectx
-
--V6_TARGETS = test_basic_v6 test_fragments_v6 test_getname_v6 \
-- test_inaddr_any_v6 test_peeloff_v6 test_sctp_sendrecvmsg_v6 \
-- test_sockopt_v6 test_tcp_style_v6 test_timetolive_v6
--
--all: $(V4_TARGETS) $(V6_TARGETS)
-+all: $(V4_TARGETS)
-
- test_1_to_1_accept_close: test_1_to_1_accept_close.c
- test_1_to_1_addrs: test_1_to_1_addrs.c
-@@ -68,47 +62,19 @@
- test_assoc_shutdown: test_assoc_shutdown.c
- test_autoclose: test_autoclose.c
- test_basic: test_basic.c
--test_basic_v6: test_basic_v6.o
- test_connect: test_connect.c
- test_fragments: test_fragments.c
--test_fragments_v6: test_fragments_v6.o
- test_getname: test_getname.c
--test_getname_v6: test_getname_v6.o
- test_inaddr_any: test_inaddr_any.c
--test_inaddr_any_v6: test_inaddr_any_v6.o
- test_peeloff: test_peeloff.c
--test_peeloff_v6: test_peeloff_v6.o
- test_recvmsg: test_recvmsg.c
- test_sctp_sendrecvmsg: test_sctp_sendrecvmsg.c
--test_sctp_sendrecvmsg_v6: test_sctp_sendrecvmsg_v6.o
- test_sockopt: test_sockopt.c
--test_sockopt_v6: test_sockopt_v6.o
- test_tcp_style: test_tcp_style.c
--test_tcp_style_v6: test_tcp_style_v6.o
- test_timetolive: test_timetolive.c
--test_timetolive_v6: test_timetolive_v6.o
- test_1_to_1_connectx: test_1_to_1_connectx.c
- test_connectx: test_connectx.c
-
--test_basic_v6.o: test_basic.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_fragments_v6.o: test_fragments.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_getname_v6.o: test_getname.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_inaddr_any_v6.o: test_inaddr_any.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_peeloff_v6.o: test_peeloff.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_sctp_sendrecvmsg_v6.o: test_sctp_sendrecvmsg.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_sockopt_v6.o: test_sockopt.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_tcp_style_v6.o: test_tcp_style.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--test_timetolive_v6.o: test_timetolive.c
-- $(CC) -c $(V6FLAGS) -o $@ $^
--
- v4test: ${V4_TARGETS}
- @for a in $^; \
- do \
-@@ -123,26 +89,9 @@
- fi; \
- done
-
--v6test: ${V6_TARGETS}
-- @for a in $^; \
-- do \
-- echo "./$$a"; \
-- if ./$$a; \
-- then \
-- echo "$$a passes"; \
-- echo ""; \
-- else \
-- echo "$$a fails"; \
-- exit 1; \
-- fi; \
-- done
--
- install:
- ln -f $(V4_TARGETS) ../../../bin
-- ln -f $(V6_TARGETS) ../../../bin
-
- clean:
- rm -f $(V4_TARGETS)
-- rm -f $(V6_TARGETS)
-- rm -f ../../../bin/$(V6_TARGETS)
- rm -f *.o
-diff -ur ltp-full-20070228/testcases/network/stress/ns-tools/Makefile ltp-full-20070228-patched/testcases/network/stress/ns-tools/Makefile
---- ltp-full-20070228/testcases/network/stress/ns-tools/Makefile 2007-02-28 22:40:31.000000000 -0600
-+++ ltp-full-20070228-patched/testcases/network/stress/ns-tools/Makefile 2007-07-05 22:39:27.593059603 -0500
-@@ -10,9 +10,8 @@
- ns-echoclient
-
- BINS=ns-tcpserver ns-tcpclient ns-udpserver ns-udpclient \
-- ns-icmpv4_sender ns-icmpv6_sender \
-+ ns-icmpv4_sender \
- ns-udpsender \
-- ns-icmp_redirector \
- ns-mcast_receiver ns-igmp_querier \
- ns-mcast_join
-
-diff -ur ltp-full-20070228/tools/Makefile ltp-full-20070228-patched/tools/Makefile
---- ltp-full-20070228/tools/Makefile 2007-02-28 22:40:41.000000000 -0600
-+++ ltp-full-20070228-patched/tools/Makefile 2007-07-05 22:39:27.593059603 -0500
-@@ -1,4 +1,4 @@
--SUBDIRS = apicmds genload netpipe-2.4 netpipe-2.4-ipv6 #top-LTP
-+SUBDIRS = apicmds genload netpipe-2.4 #top-LTP
-
- CFLAGS+= -Wall -I../include
- LOADLIBES+= -L../lib -lltp
diff --git a/package/ltp-testsuite/ltp-testsuite-enable-openposix-for-nptl.patch b/package/ltp-testsuite/ltp-testsuite-enable-openposix-for-nptl.patch
deleted file mode 100644
index ebb888c..0000000
--- a/package/ltp-testsuite/ltp-testsuite-enable-openposix-for-nptl.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -ur ltp-full-20060615/testcases/Makefile ltp-full-20060615-patched/testcases/Makefile
---- ltp-full-20060615/testcases/Makefile 2006-01-31 08:48:38.000000000 -0600
-+++ ltp-full-20060615-patched/testcases/Makefile 2006-07-04 22:20:40.298850250 -0500
-@@ -1,4 +1,4 @@
--SUBDIRS = `ls */Makefile | sed "s/Makefile//g" | grep -v open | grep -v pounder | grep -v DOTS`
-+SUBDIRS = `ls */Makefile | sed "s/Makefile//g" | grep -v open_hpi | grep -v pounder | grep -v DOTS`
- UCLINUX_SUBDIRS = kernel
-
- all:
-diff -ur ltp-full-20060615/testcases/open_posix_testsuite/LDFLAGS ltp-full-20060615-patched/testcases/open_posix_testsuite/LDFLAGS
---- ltp-full-20060615/testcases/open_posix_testsuite/LDFLAGS 2005-06-03 11:29:49.000000000 -0500
-+++ ltp-full-20060615-patched/testcases/open_posix_testsuite/LDFLAGS 2006-07-04 22:21:34.322226500 -0500
-@@ -14,3 +14,5 @@
- # allow for the NPTL-specific compilation (used in some test cases)
- # Note: this sometimes require the package nptl-devel.*.rpm to be installed.
- #-I /usr/include/nptl -L /usr/lib/nptl -D_XOPEN_SOURCE=600 -lpthread -lrt -lm
-+
-+-D_XOPEN_SOURCE=600 -lpthread -lrt -lm -D_GNU_SOURCE
-diff -ur ltp-full-20060615/testcases/open_posix_testsuite/Makefile ltp-full-20060615-patched/testcases/open_posix_testsuite/Makefile
---- ltp-full-20060615/testcases/open_posix_testsuite/Makefile 2006-05-21 18:38:52.000000000 -0500
-+++ ltp-full-20060615-patched/testcases/open_posix_testsuite/Makefile 2006-07-04 22:22:16.660872500 -0500
-@@ -45,7 +45,10 @@
- TIMEOUT = $(top_builddir)/t0 $(TIMEOUT_VAL)
-
-
--all: build-tests run-tests
-+all: build-tests $(top_builddir)/t0
-+
-+install:
-+ @echo " "
-
- build-tests: $(BUILD_TESTS:.c=.test)
- run-tests: $(RUN_TESTS:.test=.run-test)
diff --git a/package/ltp-testsuite/ltp-testsuite-generate-needs-bash.patch b/package/ltp-testsuite/ltp-testsuite-generate-needs-bash.patch
deleted file mode 100644
index 1f28956..0000000
--- a/package/ltp-testsuite/ltp-testsuite-generate-needs-bash.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- ltp-full-20061121/testcases/network/generate.sh.orig 2006-12-07 22:21:56.000000000 -0700
-+++ ltp-full-20061121/testcases/network/generate.sh 2006-12-07 22:22:05.000000000 -0700
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) International Business Machines Corp., 2001
- #
diff --git a/package/ltp-testsuite/ltp-testsuite-sched-getaffinity.patch b/package/ltp-testsuite/ltp-testsuite-sched-getaffinity.patch
deleted file mode 100644
index 9e4a9d8..0000000
--- a/package/ltp-testsuite/ltp-testsuite-sched-getaffinity.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ltp-full-20090630/testcases/kernel/syscalls/sched_getaffinity/Makefile 2009-06-15 19:38:04.000000000 +0100
-+++ ltp-full-20090630.mod/testcases/kernel/syscalls/sched_getaffinity/Makefile 2009-07-02 15:02:33.000000000 +0100
-@@ -16,7 +16,7 @@
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- #
-
--CFLAGS += -I../../../../include -Wall
-+CFLAGS += -I../../../../include -Wall -D_GNU_SOURCE
- LDLIBS += -L../../../../lib -lltp
-
- SRCS = $(wildcard *.c)
diff --git a/package/ltp-testsuite/ltp-testsuite-uclibc-syscalls.patch b/package/ltp-testsuite/ltp-testsuite-uclibc-syscalls.patch
deleted file mode 100644
index 866a56c..0000000
--- a/package/ltp-testsuite/ltp-testsuite-uclibc-syscalls.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ltp-full-20090630/testcases/kernel/syscalls/Makefile 2009-02-26 11:37:28.000000000 +0000
-+++ ltp-full-20090630.mod/testcases/kernel/syscalls/Makefile 2009-07-02 14:57:30.000000000 +0100
-@@ -25,7 +25,7 @@
- #
- # Commented this out since there are directories here we don't want built by default
- #
--SUBDIR = `ls */Makefile | sed "s/Makefile//g"`
-+SUBDIR = `ls */Makefile | sed "s/Makefile//g" | grep -vE "^clock_nanosleep|quotactl|sched_getaffinity|sigreturn|unshare"`
- UCLINUX_SUBDIR = `ls */Makefile | sed "s/Makefile//g" | grep -vE "^fork|epoll|capget|capset|chmod|chown|llseek|nftw|clone|profil|getcontext|remap_file_pages"`
-
- all:
diff --git a/package/ltp-testsuite/ltp-testsuite.mk b/package/ltp-testsuite/ltp-testsuite.mk
index 7be12fd..8f2a986 100644
--- a/package/ltp-testsuite/ltp-testsuite.mk
+++ b/package/ltp-testsuite/ltp-testsuite.mk
@@ -3,68 +3,8 @@
# ltp-testsuite
#
#############################################################
-LTP_TESTSUITE_VERSION:=20090630
-LTP_TESTSUITE_SOURCE:=ltp-full-$(LTP_TESTSUITE_VERSION).tgz
-LTP_TESTSUITE_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ltp
-LTP_TESTSUITE_CAT:=$(ZCAT)
-LTP_TESTSUITE_ROOT:=$(TARGET_DIR)/root
-LTP_TESTSUITE_DIR:=$(LTP_TESTSUITE_ROOT)/ltp-full-$(LTP_TESTSUITE_VERSION)
+LTP_TESTSUITE_VERSION = 20101031
+LTP_TESTSUITE_SOURCE = ltp-full-$(LTP_TESTSUITE_VERSION).bz2
+LTP_TESTSUITE_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ltp
-#
-# Enable patches based upon different toolchain configuration options.
-#
-LTP_PATCHES:=ltp-testsuite-generate-needs-bash.patch \
- ltp-testsuite-sh-is-not-C-code.patch \
- ltp-testsuite-sched-getaffinity.patch \
- ltp-testsuite-uclibc-syscalls.patch
-
-ifeq ($(BR2_PTHREADS_NATIVE),y)
-LTP_PATCHES+=ltp-testsuite-enable-openposix-for-nptl.patch
-endif
-ifeq ($(BR2_EXT_PTHREADS_NATIVE),y)
-LTP_PATCHES+=ltp-testsuite-enable-openposix-for-nptl.patch
-endif
-ifneq ($(BR2_INET_IPV6),y)
-LTP_PATCHES+=ltp-testsuite-disable-ipv6-tests.patch
-endif
-
-$(DL_DIR)/$(LTP_TESTSUITE_SOURCE):
- $(call DOWNLOAD,$(LTP_TESTSUITE_SITE),$(LTP_TESTSUITE_SOURCE))
-
-ltp-testsuite-source: $(DL_DIR)/$(LTP_TESTSUITE_SOURCE)
-
-$(LTP_TESTSUITE_DIR)/Makefile: $(DL_DIR)/$(LTP_TESTSUITE_SOURCE)
- mkdir -p $(LTP_TESTSUITE_ROOT)
- $(LTP_TESTSUITE_CAT) $(DL_DIR)/$(LTP_TESTSUITE_SOURCE) | tar -C $(LTP_TESTSUITE_ROOT) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(LTP_TESTSUITE_DIR) package/ltp-testsuite/ $(LTP_PATCHES)
- touch -c $@
-
-$(LTP_TESTSUITE_DIR)/.compiled: $(LTP_TESTSUITE_DIR)/Makefile
- $(MAKE1) $(TARGET_CONFIGURE_OPTS) CROSS_COMPILER=$(TARGET_CROSS) \
- -C $(LTP_TESTSUITE_DIR) all
- touch $@
-
-$(LTP_TESTSUITE_DIR)/.installed: $(LTP_TESTSUITE_DIR)/.compiled
- # Use fakeroot to pretend to do 'make install' as root
- echo '$(MAKE1) $(TARGET_CONFIGURE_OPTS) CROSS_COMPILER=$(TARGET_CROSS) ' \
- '-C $(LTP_TESTSUITE_DIR) install' \
- > $(BUILD_DIR)/.fakeroot.ltp
- touch $@
-
-ltp-testsuite: host-fakeroot $(LTP_TESTSUITE_DIR)/.installed
-
-ltp-testsuite-clean:
- -$(MAKE) -C $(LTP_TESTSUITE_DIR) clean
-
-ltp-testsuite-dirclean:
- rm -rf $(LTP_TESTSUITE_DIR)
-
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_LTP-TESTSUITE),y)
-TARGETS+=ltp-testsuite
-endif
+$(eval $(call AUTOTARGETS,package,ltp-testsuite))
\ No newline at end of file
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 08/14] toolchain: rework thread options
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (6 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 07/14] ltp-testsuite: bump version and use autotargets Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 09/14] toolchain: check that the thread option selection is correct Thomas Petazzoni
` (6 subsequent siblings)
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
The selection of linuxthreads, linuxthreads old or NPTL doesn't make a
lot of sense for external toolchains. So, instead, we :
* Introduce an hidden BR2_TOOLCHAIN_HAS_THREADS option, which must be
selected by toolchain specific options when thread support is
available. Package needing to test thread support should use this
option.
* Move the none/linuxthreads/linuxthreads old/NPTL selection to
Buildroot internal toolchain configuration.
* Add an option in external toolchain to tell if thread support is
available or not in the external toolchain. We assume that glibc
without threads is not possible, as Ulrich Drepper said in
http://sourceware.org/ml/libc-alpha/2005-08/msg00091.html
ffmpeg, dmalloc and openvpn are fixed to use the new
BR2_TOOLCHAIN_HAS_THREADS option. For openvpn, --enable-threads=posix
is no longer used, as the configure script doesn't even understand
this option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/dmalloc/dmalloc.mk | 6 +++---
package/ltp-testsuite/Config.in | 4 ++--
package/multimedia/ffmpeg/ffmpeg.mk | 6 +++---
package/openvpn/openvpn.mk | 6 +++---
toolchain/Makefile.in | 6 ------
toolchain/gcc/gcc-uclibc-4.x.mk | 6 ++++++
toolchain/toolchain-buildroot/Config.in.2 | 27 +++++++++++++++++++++++++++
toolchain/toolchain-common.in | 29 +++--------------------------
toolchain/toolchain-external/Config.in | 9 +++++++++
toolchain/toolchain-external/ext-tool.mk | 2 +-
10 files changed, 57 insertions(+), 44 deletions(-)
diff --git a/package/dmalloc/dmalloc.mk b/package/dmalloc/dmalloc.mk
index 60ad763..dca0488 100644
--- a/package/dmalloc/dmalloc.mk
+++ b/package/dmalloc/dmalloc.mk
@@ -16,10 +16,10 @@ else
DMALLOC_CONF_OPT+=--disable-cxx
endif
-ifeq ($(BR2_PTHREADS_NONE),y)
-DMALLOC_CONF_OPT+=--disable-threads
-else
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
DMALLOC_CONF_OPT+=--enable-threads
+else
+DMALLOC_CONF_OPT+=--disable-threads
endif
define DMALLOC_POST_PATCH
diff --git a/package/ltp-testsuite/Config.in b/package/ltp-testsuite/Config.in
index 2ab4134..86aa4fb 100644
--- a/package/ltp-testsuite/Config.in
+++ b/package/ltp-testsuite/Config.in
@@ -1,6 +1,6 @@
config BR2_PACKAGE_LTP_TESTSUITE
bool "ltp-testsuite"
- depends on !BR2_PTHREADS_NONE
+ depends on BR2_TOOLCHAIN_HAS_THREADS
help
The Linux Test Project provides a huge testsuite for Linux.
@@ -13,4 +13,4 @@ config BR2_PACKAGE_LTP_TESTSUITE
http://ltp.sourceforge.net/
comment "ltp-testsuite requires a toolchain with thread support"
- depends on BR2_PTHREADS_NONE
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/multimedia/ffmpeg/ffmpeg.mk b/package/multimedia/ffmpeg/ffmpeg.mk
index 959efa3..f0ec930 100644
--- a/package/multimedia/ffmpeg/ffmpeg.mk
+++ b/package/multimedia/ffmpeg/ffmpeg.mk
@@ -111,10 +111,10 @@ else
FFMPEG_CONF_OPT += --disable-outdevs
endif
-ifeq ($(BR2_PTHREADS_NONE),y)
-FFMPEG_CONF_OPT += --disable-pthreads
-else
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
FFMPEG_CONF_OPT += --enable-pthreads
+else
+FFMPEG_CONF_OPT += --disable-pthreads
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
diff --git a/package/openvpn/openvpn.mk b/package/openvpn/openvpn.mk
index 7d8fb0c..ba91690 100644
--- a/package/openvpn/openvpn.mk
+++ b/package/openvpn/openvpn.mk
@@ -8,10 +8,10 @@ OPENVPN_VERSION = 2.1.3
OPENVPN_SITE = http://openvpn.net/release
OPENVPN_CONF_OPT = --enable-small
-ifeq ($(BR2_PTHREADS_NATIVE),y)
- OPENVPN_CONF_OPT += --enable-threads=posix
-else
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
OPENVPN_CONF_OPT += --enable-pthread
+else
+ OPENVPN_CONF_OPT += --disable-pthread
endif
ifeq ($(BR2_PACKAGE_OPENVPN_LZO),y)
diff --git a/toolchain/Makefile.in b/toolchain/Makefile.in
index 371509f..2cb6e95 100644
--- a/toolchain/Makefile.in
+++ b/toolchain/Makefile.in
@@ -1,9 +1,3 @@
-ifeq ($(BR2_PTHREADS_NONE),y)
-THREADS:=--disable-threads
-else
-THREADS:=--enable-threads
-endif
-
BR2_CONFIGURE_DEVEL_SYSROOT=--with-sysroot=$(TOOLCHAIN_DIR)/uClibc_dev/
BR2_CONFIGURE_STAGING_SYSROOT=--with-sysroot=$(STAGING_DIR)
BR2_CONFIGURE_BUILD_TOOLS=--with-build-time-tools=$(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index eec6523..5f69906 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -138,6 +138,12 @@ else
GCC_TLS:=--disable-tls
endif
+ifeq ($(BR2_PTHREADS_NONE),y)
+THREADS:=--disable-threads
+else
+THREADS:=--enable-threads
+endif
+
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
GCC_DECIMAL_FLOAT:=--disable-decimal-float
endif
diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2
index f1b0a7c..fe93e70 100644
--- a/toolchain/toolchain-buildroot/Config.in.2
+++ b/toolchain/toolchain-buildroot/Config.in.2
@@ -76,6 +76,33 @@ config BR2_TOOLCHAIN_BUILDROOT_USE_SSP
See http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
for details.
+choice
+ prompt "Thread library implementation"
+ default BR2_PTHREADS_OLD
+ help
+ Use this option to select the thread library implementation
+ that should be used in your toolchain. 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.
+
+ config BR2_PTHREADS_NONE
+ bool "none"
+
+ config BR2_PTHREADS
+ bool "linuxthreads"
+ select BR2_TOOLCHAIN_HAS_THREADS
+
+ config BR2_PTHREADS_OLD
+ bool "linuxthreads (stable/old)"
+ select BR2_TOOLCHAIN_HAS_THREADS
+
+ config BR2_PTHREADS_NATIVE
+ bool "Native POSIX Threading (NPTL)"
+ select BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_UCLIBC_VERSION_SNAPSHOT
+endchoice
+
source "toolchain/elf2flt/Config.in"
source "toolchain/mklibs/Config.in"
source "toolchain/sstrip/Config.in"
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 5502ab4..34d70a0 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -26,6 +26,9 @@ config BR2_PROGRAM_INVOCATION
config BR2_INSTALL_LIBSTDCPP
bool
+config BR2_TOOLCHAIN_HAS_THREADS
+ bool
+
config BR2_ENABLE_LOCALE_PURGE
bool "Purge unwanted locales"
help
@@ -76,32 +79,6 @@ config BR2_SOFT_FLOAT
functions, then everything will need to be compiled with soft
floating point support (-msoft-float).
-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_TARGET_OPTIMIZATION
string "Target Optimizations"
default "-pipe"
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index bd22e0c..2ed65bf 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -149,6 +149,7 @@ config BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_USE_WCHAR
select BR2_ENABLE_LOCALE
select BR2_PROGRAM_INVOCATION
+ select BR2_TOOLCHAIN_HAS_THREADS
config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
bool
@@ -220,6 +221,14 @@ config BR2_TOOLCHAIN_EXTERNAL_PROGRAM_INVOCATION
invocation support. If you don't know, leave the default
value, Buildroot will tell you if it's correct or not.
+config BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS
+ bool "Toolchain has threads support?"
+ select BR2_TOOLCHAIN_HAS_THREADS
+ help
+ Select this option if your external toolchain has thread
+ support. If you don't know, leave the default value,
+ Buildroot will tell you if it's correct or not.
+
endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
config BR2_TOOLCHAIN_EXTERNAL_CXX
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 71aa127..d4f5bc5 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -53,7 +53,7 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
USR_LIB_EXTERNAL_LIBS+=libstdc++.so
endif
-ifneq ($(BR2_PTHREADS_NONE),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
LIB_EXTERNAL_LIBS+=libpthread.so
ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
LIB_EXTERNAL_LIBS+=libthread_db.so
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 09/14] toolchain: check that the thread option selection is correct
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (7 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 08/14] toolchain: rework thread options Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 10/14] gcc: disable libgomp when thread support is disabled Thomas Petazzoni
` (5 subsequent siblings)
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
When an external toolchain is used, the user is responsible for
telling Buildroot what the configuration of the toolchain is. In order
to make sure that the selection is correct, we already perform checks
against the configuration of the uClibc in the selected external
toolchain. This commit adds the check for thread support.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/helpers.mk | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 33f0484..9b37f3f 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -192,7 +192,8 @@ check_uclibc = \
$(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)
+ $(call check_uclibc_feature,__UCLIBC_HAS_PROGRAM_INVOCATION_NAME__,BR2_PROGRAM_INVOCATION,$${UCLIBC_CONFIG_FILE},Program invocation support) ;\
+ $(call check_uclibc_feature,__UCLIBC_HAS_THREADS__,BR2_TOOLCHAIN_HAS_THREADS,$${UCLIBC_CONFIG_FILE},Thread support)
#
# Check that the Buildroot configuration of the ABI matches the
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 10/14] gcc: disable libgomp when thread support is disabled
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (8 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 09/14] toolchain: check that the thread option selection is correct Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 11/14] toolchain: BR2_NEEDS_GETTEXT must be y when uClibc is used Thomas Petazzoni
` (4 subsequent siblings)
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
libgomp needs thread support on the target to build properly.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/gcc/gcc-uclibc-4.x.mk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index 5f69906..cd63992 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -139,7 +139,7 @@ GCC_TLS:=--disable-tls
endif
ifeq ($(BR2_PTHREADS_NONE),y)
-THREADS:=--disable-threads
+THREADS:=--disable-threads --disable-libgomp
else
THREADS:=--enable-threads
endif
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 11/14] toolchain: BR2_NEEDS_GETTEXT must be y when uClibc is used
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (9 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 10/14] gcc: disable libgomp when thread support is disabled Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 16:27 ` [Buildroot] [PATCH 12/14] toolchain: expose thread options in the Crosstool-NG backend Thomas Petazzoni
` (3 subsequent siblings)
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
BR2_NEEDS_GETTEXT was already set to y for Buildroot internal
toolchain and external toolchains based on uClibc, but wasn't set for
toolchains based on uClibC built by the Crosstool-NG backend.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-common.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 34d70a0..bdc6e76 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -60,6 +60,7 @@ config BR2_NEEDS_GETTEXT
bool
default y if BR2_TOOLCHAIN_BUILDROOT
default y if BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ default y if BR2_TOOLCHAIN_CTNG_uClibc
config BR2_NEEDS_GETTEXT_IF_LOCALE
bool
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 12/14] toolchain: expose thread options in the Crosstool-NG backend
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (10 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 11/14] toolchain: BR2_NEEDS_GETTEXT must be y when uClibc is used Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 19:50 ` Yann E. MORIN
2010-12-13 16:27 ` [Buildroot] [PATCH 13/14] toolchain: more verbose in crosstool-ng backend Thomas Petazzoni
` (2 subsequent siblings)
14 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-crosstool-ng/Config.in | 36 ++++++++++++++++++++++
toolchain/toolchain-crosstool-ng/crosstool-ng.mk | 21 +++++++++++++
2 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/toolchain/toolchain-crosstool-ng/Config.in b/toolchain/toolchain-crosstool-ng/Config.in
index 82e223d..1a10416 100644
--- a/toolchain/toolchain-crosstool-ng/Config.in
+++ b/toolchain/toolchain-crosstool-ng/Config.in
@@ -106,4 +106,40 @@ config BR2_TOOLCHAIN_CTNG_CXX
C++ language and you want C++ libraries to be installed on
your target system.
+choice
+ prompt "Thread library implementation"
+ default BR2_TOOLCHAIN_CTNG_THREADS_PTHREADS_OLD \
+ if BR2_TOOLCHAIN_CTNG_uClibc
+ default BR2_TOOLCHAIN_CTNG_THREADS_NPTL \
+ if BR2_TOOLCHAIN_CTNG_eglibc || \
+ BR2_TOOLCHAIN_CTNG_glibc
+ help
+ Enable thread support and select thread implementation. With
+ glibc, thread support is mandatory but several
+ implementations are available. With uClibc, thread support
+ is optional, and when enabled, several implementations are
+ available. However, not all thread variants work with all
+ versions of uClibc for all architectures, the "linuxthreads
+ (stable/old)" may be a working fallback.
+
+ config BR2_TOOLCHAIN_CTNG_THREADS_NONE
+ bool "none"
+ depends on BR2_TOOLCHAIN_CTNG_uClibc
+
+ config BR2_TOOLCHAIN_CTNG_THREADS_PTHREADS
+ bool "linuxthreads"
+ select BR2_TOOLCHAIN_HAS_THREADS
+
+ config BR2_TOOLCHAIN_CTNG_THREADS_PTHREADS_OLD
+ bool "linuxthreads (stable/old)"
+ select BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_TOOLCHAIN_CTNG_uClibc
+
+ config BR2_TOOLCHAIN_CTNG_THREADS_NPTL
+ bool "Native POSIX Threading (NPTL)"
+ select BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_TOOLCHAIN_CTNG_eglibc || \
+ BR2_TOOLCHAIN_CTNG_glibc
+endchoice
+
endif # BR2_TOOLCHAIN_CTNG
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
index 817a1f7..a38dd12 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
@@ -213,6 +213,27 @@ else
CTNG_FIX_DOT_CONFIG_SED += s:^(CT_CC_LANG_CXX)=.*:\# \1 is not set:;
endif
+# Thread implementation selection
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_THREADS_NONE).*:\# \2 is not set:;
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_THREADS_LINUXTHREADS).*:\# \2 is not set:;
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_THREADS_NPTL).*:\# \2 is not set:;
+ifneq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_THREADS_PTHREADS))$(call qstrip,$(BR2_TOOLCHAIN_CTNG_THREADS_PTHREADS_OLD)),)
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_THREADS_LINUXTHREADS).*:\2=y:;
+ ifneq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_uClibc)),)
+ ifneq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_THREADS_PTHREADS_OLD)),)
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_LIBC_UCLIBC_LNXTHRD_NEW).*:\# \2 is not set:;
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_LIBC_UCLIBC_LNXTHRD_OLD).*:\2=y:;
+ else
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_LIBC_UCLIBC_LNXTHRD_OLD).*:\# \2 is not set:;
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_LIBC_UCLIBC_LNXTHRD_NEW).*:\2=y:;
+ endif
+ endif
+else ifneq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_THREADS_NPTL)),)
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_THREADS_NPTL).*:\2=y:;
+else ifneq ($(call qstrip,$(BR2_TOOLCHAIN_CTNG_THREADS_NONE)),)
+CTNG_FIX_DOT_CONFIG_SED += s:^(|\# )(CT_THREADS_NONE).*:\2=y:;
+endif
+
#--------------
# And the specials for paths
CTNG_FIX_DOT_CONFIG_PATHS_SED += s:^(CT_PREFIX_DIR)=.*:\1="$(TOOLCHAIN_DIR)":;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 13/14] toolchain: more verbose in crosstool-ng backend
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (11 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 12/14] toolchain: expose thread options in the Crosstool-NG backend Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 19:51 ` Yann E. MORIN
2010-12-13 16:27 ` [Buildroot] [PATCH 14/14] package: pass TARGET_MAKE_ENV at install/clean/uninstall steps Thomas Petazzoni
2010-12-13 21:48 ` [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Peter Korsgaard
14 siblings, 1 reply; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
By default, Crosstool-NG hides all the details of the toolchain build
process. However, this is inconsistent with the typical Buildroot
build, and the rotating progress thing makes log file resulting from
redirecting the Buildroot output a bit unusable. Therefore, switch the
Crosstool-NG configuration to a more verbose default.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
.../toolchain-crosstool-ng/crosstool-ng.config | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.config b/toolchain/toolchain-crosstool-ng/crosstool-ng.config
index d5ee244..506f78a 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.config
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.config
@@ -72,12 +72,12 @@ CT_CONFIG_SHELL_CUSTOM_PATH="/bin/sh"
# 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_EXTRA is not set
+CT_LOG_ALL=y
# CT_LOG_DEBUG is not set
-CT_LOG_LEVEL_MAX="EXTRA"
+CT_LOG_LEVEL_MAX="ALL"
# CT_LOG_SEE_TOOLS_WARN is not set
-CT_LOG_PROGRESS_BAR=y
+# CT_LOG_PROGRESS_BAR is not set
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [PATCH 13/14] toolchain: more verbose in crosstool-ng backend
2010-12-13 16:27 ` [Buildroot] [PATCH 13/14] toolchain: more verbose in crosstool-ng backend Thomas Petazzoni
@ 2010-12-13 19:51 ` Yann E. MORIN
0 siblings, 0 replies; 29+ messages in thread
From: Yann E. MORIN @ 2010-12-13 19:51 UTC (permalink / raw)
To: buildroot
On Monday 13 December 2010 17:27:49 Thomas Petazzoni wrote:
> By default, Crosstool-NG hides all the details of the toolchain build
> process. However, this is inconsistent with the typical Buildroot
> build, and the rotating progress thing makes log file resulting from
> redirecting the Buildroot output a bit unusable. Therefore, switch the
> Crosstool-NG configuration to a more verbose default.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
--
.-----------------.--------------------.------------------.--------------------.
| 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] 29+ messages in thread
* [Buildroot] [PATCH 14/14] package: pass TARGET_MAKE_ENV at install/clean/uninstall steps
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (12 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 13/14] toolchain: more verbose in crosstool-ng backend Thomas Petazzoni
@ 2010-12-13 16:27 ` Thomas Petazzoni
2010-12-13 21:48 ` [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Peter Korsgaard
14 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-13 16:27 UTC (permalink / raw)
To: buildroot
TARGET_MAKE_ENV contains the PATH to the host tools built in
$(HOST_DIR), and not having this directory in the PATH while
installing packages may cause troubles.
The specific example that trigerred the problem is the following
one. libglib2 ./configure tries to find a awk version, either gawk or
mawk. On my limited testing system, only mawk is available, so
normally, libglib2 detects mawk and uses it, and it works perfectly.
However, when host-gawk has been compiled before libglib2 (which
happens for example if you have used the Crosstool-NG backend), gawk
is well detected in $(HOST_DIR)/usr/bin at ./configure time
($(HOST_DIR)/usr/bin is in the PATH at ./configure time, thanks to
TARGET_MAKE_ENV). But at install time, when libglib2 uses gawk, it
doesn't find it anymore because it is not in the PATH.
This also makes things coherent with host installation, in which
$(HOST_MAKE_ENV) was already used.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/Makefile.autotools.in | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package/Makefile.autotools.in b/package/Makefile.autotools.in
index 7d04e44..de0a355 100644
--- a/package/Makefile.autotools.in
+++ b/package/Makefile.autotools.in
@@ -210,7 +210,7 @@ endif
#
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
- $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
+ $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
for i in $$$$(find $(STAGING_DIR)/usr/lib* -name "*.la"); do \
cp -f $$$$i $$$$i~; \
$$(SED) "s:\(['= ]\)/usr:\\1$(STAGING_DIR)/usr:g" $$$$i; \
@@ -224,7 +224,7 @@ endif
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
+ $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
endef
endif
@@ -234,7 +234,7 @@ endif
#
ifndef $(2)_CLEAN_CMDS
define $(2)_CLEAN_CMDS
- -$$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_CLEAN_OPT) -C $$($$(PKG)_SRCDIR)
+ -$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_CLEAN_OPT) -C $$($$(PKG)_SRCDIR)
endef
endif
@@ -244,7 +244,7 @@ endif
#
ifndef $(2)_UNINSTALL_STAGING_CMDS
define $(2)_UNINSTALL_STAGING_CMDS
- $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
+ $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
endef
endif
@@ -254,7 +254,7 @@ endif
#
ifndef $(2)_UNINSTALL_TARGET_CMDS
define $(2)_UNINSTALL_TARGET_CMDS
- $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
+ $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
endef
endif
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread* [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements
2010-12-13 16:27 [Buildroot] [pull request v3] Pull request for branch for-2011.02/toolchain-improvements Thomas Petazzoni
` (13 preceding siblings ...)
2010-12-13 16:27 ` [Buildroot] [PATCH 14/14] package: pass TARGET_MAKE_ENV at install/clean/uninstall steps Thomas Petazzoni
@ 2010-12-13 21:48 ` Peter Korsgaard
14 siblings, 0 replies; 29+ messages in thread
From: Peter Korsgaard @ 2010-12-13 21:48 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Thomas> Hello,
Thomas> A new posting of the toolchain-improvements branch.
Committed, thanks!
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 29+ messages in thread
* [Buildroot] [PATCH 03/14] toolchain: add support for external toolchain profiles and download
2010-12-12 14:16 [Buildroot] [pull request v2] " Thomas Petazzoni
@ 2010-12-12 14:16 ` Thomas Petazzoni
0 siblings, 0 replies; 29+ messages in thread
From: Thomas Petazzoni @ 2010-12-12 14:16 UTC (permalink / raw)
To: buildroot
Instead of letting the user define all the details of his external
toolchain, we define a set of profiles for well-known external
toolchains (CodeSourcery ones only at the moment, can easily be
extended with other toolchains).
Once a profile has been choosen, the user is offered the choice of
either letting Buildroot download and install the external toolchain,
or (as before) to tell Buildroot where the toolchain is installed on
the system.
We of course provide a "custom profile", through which the user can
configure Buildroot to use a custom external toolchain for which no
profile is available.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Makefile | 3 +-
package/Makefile.in | 10 +-
toolchain/Config.in | 5 +-
toolchain/toolchain-external/Config.in | 168 ++++++++++++++++++++++--
toolchain/toolchain-external/Config.in.2 | 17 ---
toolchain/toolchain-external/ext-tool.mk | 210 +++++++++++++++++++++---------
6 files changed, 315 insertions(+), 98 deletions(-)
delete mode 100644 toolchain/toolchain-external/Config.in.2
diff --git a/Makefile b/Makefile
index 7d6e4af..f6ab07e 100644
--- a/Makefile
+++ b/Makefile
@@ -279,6 +279,7 @@ STAMP_DIR:=$(BASE_DIR)/stamps
BINARIES_DIR:=$(BASE_DIR)/images
TARGET_DIR:=$(BASE_DIR)/target
TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
+TOOLCHAIN_EXTERNAL_DIR=$(BASE_DIR)/external-toolchain
TARGET_SKELETON=$(TOPDIR)/fs/skeleton
BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
@@ -600,7 +601,7 @@ endif
clean:
rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
- $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR)
+ $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(TOOLCHAIN_EXTERNAL_DIR)
distclean: clean
ifeq ($(DL_DIR),$(TOPDIR)/dl)
diff --git a/package/Makefile.in b/package/Makefile.in
index d448a7e..36bd59f 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -114,13 +114,13 @@ REAL_GNU_TARGET_NAME=$(ARCH)-unknown-linux-$(LIBC)$(ABI)
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
-TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
-ifneq ($(TOOLCHAIN_EXTERNAL_PATH),)
-TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
+TOOLCHAIN_EXTERNAL_PREFIX=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
+TOOLCHAIN_EXTERNAL_LOCATION=$(TOOLCHAIN_EXTERNAL_DIR)
else
-TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PREFIX)-
+TOOLCHAIN_EXTERNAL_LOCATION=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
endif
+TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_LOCATION)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
TARGET_CROSS=$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-
endif
diff --git a/toolchain/Config.in b/toolchain/Config.in
index d476cbf..8baa0c1 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -13,6 +13,10 @@ config BR2_TOOLCHAIN_BUILDROOT
config BR2_TOOLCHAIN_EXTERNAL
bool "External toolchain"
+ help
+ Select if you want to use an existing cross-compiling
+ toolchain. Buildroot can either download automatically a
+ toolchain, or use an already installed toolchain.
config BR2_TOOLCHAIN_CTNG
bool "Crosstool-NG toolchain"
@@ -29,6 +33,5 @@ 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"
endmenu
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index f0268a7..c2602d2 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -1,15 +1,142 @@
-#
-
if BR2_TOOLCHAIN_EXTERNAL
+
choice
- prompt "External toolchain C library"
- default BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ prompt "Toolchain"
-config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
- bool "uClibc"
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
+ bool "CodeSourcery ARM 2010.09"
+ depends on BR2_arm
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the ARM architecture, from CodeSourcery. It
+ uses gcc 4.5.1, binutils 2.20, glibc 2.11 and gdb 7.2.50,
+ kernel headers 2.6.35.2. It has support for the following
+ variants:
+ - ARMv5TE, little endian, soft-float, glibc
+ - ARMv4T, little endian, soft-float, glibc
+ - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
+ bool "CodeSourcery ARM 2010q1"
+ depends on BR2_arm
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the ARM architecture, from CodeSourcery. It
+ uses gcc 4.4.1, binutils 2.19, glibc 2.11, gdb 7.0.50 and
+ kernel headers 2.6.32. It has support for the following
+ variants:
+ - ARMv5T, little endian, soft-float, glibc
+ - ARMv4T, little endian, soft-float, glibc
+ - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1
+ bool "CodeSourcery ARM 2009q1"
+ depends on BR2_arm
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the ARM architecture, from CodeSourcery. It
+ uses gcc 4.3.3, binutils 2.19, glibc 2.8 and gdb 6.8 and
+ kernel headers 2.6.30. It has support for the following
+ variants:
+ - ARMv5T, little endian, soft-float, glibc
+ - ARMv4T, little endian, soft-float, glibc
+ - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
+ bool "CodeSourcery MIPS 4.4"
+ depends on BR2_mips || BR2_mipsel
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the MIPS architecture, from CodeSourcery. It
+ uses gcc 4.4.1, binutils 2.19, glibc 2.11, uClibc 0.9.30 and
+ gdb 7.0, kernel headers 2.6.32. It has support for the
+ following variants:
+ - MIPS32 O32 big endian glibc
+ - MIPS32 O32 little endian glibc
+ - MIPS32 big endian soft float glibc
+ - MIPS32 little endian soft float glibc
+ - MIPS32 big endian microMIPS glibc
+ - MIPS32 little endian microMIPS glibc
+ - MIPS32 big endian soft float microMIPS glibc
+ - MIPS32 little endian soft float microMIPS glibc
+ - MIPS32 big endian uclibc
+ - MIPS32 little endian uclibc
+ - MIPS32 big endian soft float uclibc
+ - MIPS32 little endian soft float uclibc
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
+ bool "CodeSoucery PowerPC 2010.09"
+ depends on BR2_powerpc
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the PowerPC architecture, from
+ CodeSourcery. It uses gcc 4.5.1, binutils 2.20, glibc 2.11,
+ gdb 7.2.50 and kernel headers 2.6.35.2. It has support for
+ the following variants:
+ - 603 glibc, 32 bits
+ - 603 soft float glibc, 32 bits
+ - e600 altivec glibc, 32 bits
+ - e500v1 glibc, 32 bits
+ - e500v2 glibc, 32 bits
+ - e500mc glibc, 32 bits
+ - 970 glibc hard-float, 64 bits
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
+ bool "CodeSoucery PowerPC 2010.09"
+ depends on BR2_sh
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ help
+ Toolchain for the SuperH architecture, from CodeSourcery. It
+ uses gcc 4.5.1, binutils 2.20, glibc 2.11, uClibc 0.9.30,
+ gdb 7.2.50 and kernel headers 2.6.35.2. It has support for
+ the following variants:
+ - SH4A, glibc, little endian
+ - SH4A, glibc, big endian
+ - SH4A, uClibc, little endian
+ - SH4A, uClibc, big endian
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+ bool "Custom toolchain"
+ help
+ Use this option to use a custom toolchain pre-installed on
+ your system.
+
+endchoice
+
+config BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+ bool "Download toolchain automatically"
+ default y
+ depends on !BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+ help
+ When enabled, Buildroot will automatically download and
+ install the selected external toolchain. When disabled,
+ Buildroot will use a pre-installed toolchain.
+
+config BR2_TOOLCHAIN_EXTERNAL_PATH
+ string "Toolchain path"
+ default "/path/to/toolchain/usr"
+ depends on !BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+ help
+ Path to where the external toolchain is installed.
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
+ string "Toolchain prefix"
+ depends on BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+ default "$(ARCH)-linux"
+
+config BR2_TOOLCHAIN_EXTERNAL_PREFIX
+ string
+ default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1
+ default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
+ default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
+ default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
+ default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
+ default "sh4-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
+ default $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \
+ if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
config BR2_TOOLCHAIN_EXTERNAL_GLIBC
- bool "glibc"
+ bool
select BR2_LARGEFILE
select BR2_INET_IPV6
select BR2_INET_RPC
@@ -17,9 +144,26 @@ config BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_ENABLE_LOCALE
select BR2_PROGRAM_INVOCATION
+config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ bool
+
+if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+
+choice
+ prompt "External toolchain C library"
+ default BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+ bool "uClibc"
+ select BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+
+config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC
+ bool "glibc"
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+
endchoice
-if BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+if BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
config BR2_TOOLCHAIN_EXTERNAL_LARGEFILE
bool "Toolchain has large file support?"
@@ -70,7 +214,9 @@ config BR2_TOOLCHAIN_EXTERNAL_PROGRAM_INVOCATION
invocation support. If you don't know, leave the default
value, Buildroot will tell you if it's correct or not.
-endif
+endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
+
+endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM
config BR2_TOOLCHAIN_EXTERNAL_STRIP
bool
@@ -78,4 +224,6 @@ config BR2_TOOLCHAIN_EXTERNAL_STRIP
prompt "Strip shared libraries"
help
Strip shared libraries copied from the external toolchain.
-endif
+
+endif # BR2_TOOLCHAIN_EXTERNAL
+
diff --git a/toolchain/toolchain-external/Config.in.2 b/toolchain/toolchain-external/Config.in.2
deleted file mode 100644
index 489558c..0000000
--- a/toolchain/toolchain-external/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/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 53ad636..7a17914 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -2,8 +2,9 @@
#
# 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:
+# Buildroot can download from the Web or 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
@@ -13,17 +14,21 @@
#
# 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.
+# 1. a. For toolchains downloaded from the Web, Buildroot already
+# knows their configuration, so it just downloads them and extract
+# them in $(TOOLCHAIN_EXTERNAL_DIR).
+#
+# 1. b. For pre-installed toolchains, 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
@@ -55,61 +60,138 @@ LIB_EXTERNAL_LIBS+=libthread_db.so
endif # gdbserver
endif # ! no threads
-# 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 any option to gcc that
-# could select a multilib variant as we want the "main" sysroot, which
-# contains all variants of the C library in the case of multilib
-# toolchains.
+# Details about sysroot directory selection.
+#
+# To find the sysroot directory:
+#
+# * 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.
+#
+# When doing those tests, we don't pass any option to gcc that could
+# select a multilib variant (such as -march) as we want the "main"
+# sysroot, which contains all variants of the C library in the case of
+# multilib toolchains. We use the TARGET_CC_NO_SYSROOT variable, which
+# is the path of the cross-compiler, without the
+# --sysroot=$(STAGING_DIR), since what we want to find is the location
+# of the original toolchain sysroot. This "main" sysroot directory is
+# stored in SYSROOT_DIR.
+#
+# Then, multilib toolchains are a little bit more complicated, since
+# they in fact have multiple sysroots, one for each variant supported
+# by the toolchain. So we need to find the particular sysroot we're
+# interested in.
+#
+# To do so, we ask the compiler where its sysroot is by passing all
+# flags (including -march and al.), except the --sysroot flag since we
+# want to the compiler to tell us where its original sysroot
+# is. 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.
+#
+# One might wonder why we don't just bother with ARCH_SYSROOT_DIR. The
+# fact is that in multilib toolchains, the header files are often only
+# present in the main sysroot, and only the libraries are available in
+# each variant-specific sysroot directory.
+
TARGET_CC_NO_SYSROOT=$(filter-out --sysroot=%,$(TARGET_CC_NOCCACHE))
-SYSROOT_DIR=$(shell $(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null)
-ifeq ($(SYSROOT_DIR),)
-SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;')
+
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
+TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(TOOLCHAIN_EXTERNAL_DIR)/.extracted
+else
+TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(STAMP_DIR)/ext-toolchain-checked
+endif
+
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q1),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/
+TOOLCHAIN_EXTERNAL_SOURCE=arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package6488/public/arm-none-linux-gnueabi/
+TOOLCHAIN_EXTERNAL_SOURCE=arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/arm/portal/package7851/public/arm-none-linux-gnueabi/
+TOOLCHAIN_EXTERNAL_SOURCE=arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/mips/portal/package7401/public/mips-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE=mips-4.4-303-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/power/portal/package7703/public/powerpc-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE=freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/superh/portal/package7783/public/sh-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE=renesas-2010.09-45-sh-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else
+# A value must be set (even if unused), otherwise the
+# $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main
+# $(DL_DIR) rule
+TOOLCHAIN_EXTERNAL_SOURCE=none
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 all
-# flags, except the --sysroot flag since we want to the compiler to
-# tell us where its original sysroot is. 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.
-ARCH_SUBDIR=$(shell $(TARGET_CC_NO_SYSROOT) $(TARGET_CFLAGS) -print-multi-directory)
-ARCH_SYSROOT_DIR=$(SYSROOT_DIR)/$(ARCH_SUBDIR)
+# Download and extraction of a toolchain
+$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
+ $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
+
+$(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
+ mkdir -p $(@D)
+ $(INFLATE$(suffix $(TOOLCHAIN_EXTERNAL_SOURCE))) $^ | $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+ touch $@
-$(STAMP_DIR)/ext-toolchain-installed:
+# Checks for an already installed toolchain: check the toolchain
+# location, check that it supports sysroot, and then verify that it
+# matches the configuration provided in Buildroot: ABI, C++ support,
+# type of C library and all C library features.
+$(STAMP_DIR)/ext-toolchain-checked:
@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_INSTALL_LIBSTDCPP),y)
- $(Q)$(call check_cplusplus)
-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 $(LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
- done
- $(Q)for libs in $(USR_LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,/usr/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
- done
- @echo "Copy external toolchain sysroot to staging..."
- $(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR),$(ARCH_SYSROOT_DIR),$(ARCH_SUBDIR))
- # Create lib64 symbolic links if needed
- $(Q)if [ -L $(ARCH_SYSROOT_DIR)/lib64 ] ; then \
- $(call create_lib64_symlinks) ; \
+ $(Q)SYSROOT_DIR=`$(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null` ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ SYSROOT_DIR=`readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;'` ; \
+ fi ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \
+ exit 1 ; \
+ fi ; \
+ if test x$(BR2_arm) == x"y" ; then \
+ $(call check_arm_abi) ; \
+ fi ; \
+ if test x$(BR2_INSTALL_LIBSTDCPP) == x"y" ; then \
+ $(call check_cplusplus) ; \
+ fi ; \
+ if test x$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC) == x"y" ; then \
+ $(call check_uclibc,$${SYSROOT_DIR}) ; \
+ else \
+ $(call check_glibc,$${SYSROOT_DIR}) ; \
fi
- @touch $@
+
+# Integration of the toolchain into Buildroot: find the main sysroot
+# and the variant-specific sysroot, then copy the needed libraries to
+# the $(TARGET_DIR) and copy the whole sysroot (libraries and headers)
+# to $(STAGING_DIR).
+$(STAMP_DIR)/ext-toolchain-installed: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
+ $(Q)SYSROOT_DIR=`$(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null` ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ SYSROOT_DIR=`readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;'` ; \
+ fi ; \
+ if test -z "$${SYSROOT_DIR}" ; then \
+ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \
+ exit 1 ; \
+ fi ; \
+ ARCH_SUBDIR=`$(TARGET_CC_NO_SYSROOT) $(TARGET_CFLAGS) -print-multi-directory` ; \
+ ARCH_SYSROOT_DIR=$${SYSROOT_DIR}/$${ARCH_SUBDIR} ; \
+ mkdir -p $(TARGET_DIR)/lib ; \
+ echo "Copy external toolchain libraries to target..." ; \
+ for libs in $(LIB_EXTERNAL_LIBS); do \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ done ; \
+ for libs in $(USR_LIB_EXTERNAL_LIBS); do \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$$libs,/usr/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+ done ; \
+ echo "Copy external toolchain sysroot to staging..." ; \
+ $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR}) ; \
+ if [ -L $${ARCH_SYSROOT_DIR}/lib64 ] ; then \
+ $(call create_lib64_symlinks) ; \
+ fi ; \
+ touch $@
--
1.7.0.4
^ permalink raw reply related [flat|nested] 29+ messages in thread