Skip to contentSkip to conversation

Pull request for branch for-2011.02/toolchain-improvements

GIT PULL New Thomas Petazzoni 4 participants 28 messages Dec 13, 2010 – Jan 25, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello,

A new posting of the toolchain-improvements branch.

Changelog from v2 to v3
=======================

* In the end, it appears that building glibc toolchains without thread support is not possible, and not supported. So we make the thread support selection option only visible in the uClibc case for external toolchains, and assume that if glibc is selected, then it means that we have threads. In the Crosstool-NG backend, we also disallow the selection of "none" as the thread implementation when glibc/eglibc are selected.

* Don't hide ltp-testsuite behing glibc/eglibc, but warn in the Config.in help text that some uClibc options not enabled in our default configuration are needed to get ltp-testsuite to build properly.

Changelog from v1 to v2
=======================

* In external toolchain support, make the C++ support and thread support options visible even in the case of custom external toolchains using glibc. It is indeed possible to build glibc toolchains without either C++ or thread support. Therefore, the BR2_TOOLCHAIN_EXTERNAL_GLIBC symbol no longer selects C++ and thread support. The existing external toolchain profiles have been updated, since they all support C++ and threads.

* Improvements in the option labels and descriptions, following Peter's comments.

* The build fix for uClibc snapshot has been removed, since it has been merged upstream.

* Renamed the *_C_PLUS_PLUS options to *_CXX, after Yann's comment, and used this new option in crosstool-ng.mk instead of BR2_INSTALL_LIBSTDCPP.

* Fixed the "is not settted" string in crosstool-ng.mk, which was a leftover from a debugging session.

* Rebased on top of the master branch, which involved resolving a conflict against the ccache change.

Initial announcement with v1
============================

Here is a set of patches that mainly improves the toolchain configuration and support, with two majors directions :

* Turn BR2_LARGEFILE, BR2_INET_RPC, BR2_INET_RPC and similar options into hidden options, and let the toolchain backends present them as they wish. For example for RPC, xthe Buildroot backend says "Do you want RPC ?" while the external toolchain backend doesn't show the option when glibc is used, or present an option "Does your toolchain has RPC ?" when uclibc is used.

So really those options should now be called BR2_TOOLCHAIN_HAS_LARGEFILE, BR2_TOOLCHAIN_HAS_INET_RPC, etc, but we kept the old names in this patch series because changing them impacts all packages. This will be done later.

A first commit handles largefile, rpc, ipv6, locale and program invocation options, and some later commits handle the C++ option and thread options.

* Extend external toolchain with "profiles", i.e well-known external toolchains. For those toolchains, Buildroot can automatically download and install them and will automatically select the appropriate configuration options (C library used, RPC, IPv6, locale, etc.). So an user can know tell Buildroot to use a CodeSourcery toolchain, and Buildroot will do all the job. Such toolchains are extracted in $(O)/external-toolchain, but my intent is to move it to $(O)/toolchain once Gustavoz's toolchain cleanup work is done.

This work keeps the ability of doing some more manual things with external toolchains:

- For an external toolchain profile, you can tell Buildroot *not* to download it, and in that case, you must provide Buildroot with the location of the external toolchain.

- You keep the ability to specify a custom profile, where you will have to tell Buildroot everything: location of the toolchain, toolchain prefix, C library used, etc.

In my opinion, those two directions really make the external toolchains easier and simpler to use. One topic left is the gdb options, but I decided not to change it, in order to not conflict too much with Gustavoz's work.

The rest of the changes are more minor modifications, related to these toolchain improvements.

Regards,

Thomas

The following changes since commit cc37a07f289f56a81195933810af705d77e95ee4:
Peter Korsgaard (1):
zlib: really fix install for static only builds

are available in the git repository at:

git://git.busybox.net/~tpetazzoni/git/buildroot for-2011.02/toolchain-improvements

Thomas Petazzoni (14):
toolchain: Improve C library option selection
toolchain: remove ending semi-colon in helpers
toolchain: add support for external toolchain profiles and download
toolchain: remove toolchain-specific stripping
toolchain: rework C++ options
toolchain: move Stack Protection Support option
ltp-testsuite: bump version and use autotargets
toolchain: rework thread options
toolchain: check that the thread option selection is correct
gcc: disable libgomp when thread support is disabled
toolchain: BR2_NEEDS_GETTEXT must be y when uClibc is used
toolchain: expose thread options in the Crosstool-NG backend
toolchain: more verbose in crosstool-ng backend
package: pass TARGET_MAKE_ENV at install/clean/uninstall steps

 Makefile                                           |    3 +-
 package/Makefile.autotools.in                      |   10 +-
 package/Makefile.in                                |   12 +-
 package/dmalloc/dmalloc.mk                         |    6 +-
 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 +-----
 package/lzma/Config.in                             |    4 +-
 package/multimedia/ffmpeg/ffmpeg.mk                |    6 +-
 package/openvpn/openvpn.mk                         |    6 +-
 package/rpm/Config.in                              |    4 +-
 toolchain/Config.in                                |    5 +-
 toolchain/Makefile.in                              |    6 -
 toolchain/gcc/gcc-uclibc-4.x.mk                    |    8 +-
 toolchain/helpers.mk                               |   18 +-
 toolchain/toolchain-buildroot/Config.in.2          |  102 ++++++++
 toolchain/toolchain-common.in                      |  121 ++---------
 toolchain/toolchain-crosstool-ng/Config.in         |   99 ++++++++-
 .../toolchain-crosstool-ng/crosstool-ng.config     |    8 +-
 toolchain/toolchain-crosstool-ng/crosstool-ng.mk   |   27 ++-
 toolchain/toolchain-external/Config.in             |  245 +++++++++++++++++++-
 toolchain/toolchain-external/Config.in.2           |   17 --
 toolchain/toolchain-external/ext-tool.mk           |  212 ++++++++++++-----
 toolchain/uClibc/uclibc.mk                         |    2 +-
 29 files changed, 706 insertions(+), 507 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
 delete mode 100644 toolchain/toolchain-external/Config.in.2

Thanks,

Signature · 1 line
Thomas Petazzoni
#1 lore raw

PATCH 1/14 toolchain: Improve C library option selection

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.

---
 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(-)
toolchain/toolchain-buildroot/Config.in.2 +50 -0
index 2a17796..2a8dcf5 100644
@@ -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"
toolchain/toolchain-common.in +10 -47

82 lines not on this page · raw message

toolchain/toolchain-crosstool-ng/Config.in +53 -0

59 lines not on this page · raw message

toolchain/toolchain-external/Config.in +59 -0

68 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 1/14 toolchain: Improve C library option selection

Quoted 2 lines · 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--]

Quoted 1 line
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 2/14 toolchain: remove ending semi-colon in helpers

In reply to Thomas Petazzoni

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.

---
 toolchain/helpers.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
toolchain/helpers.mk +4 -4
index 05d43e7..43c6db3 100644
@@ -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
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 2/14 toolchain: remove ending semi-colon in helpers

Quoted 5 lines · 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.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

In reply to Thomas Petazzoni

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.

---
 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
Makefile +2 -1
index 7d6e4af..f6ab07e 100644
@@ -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)
package/Makefile.in +5 -5
index d448a7e..36bd59f 100644
@@ -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
toolchain/Config.in +4 -1
index d476cbf..8baa0c1 100644
@@ -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
toolchain/toolchain-external/Config.in +158 -10

193 lines not on this page · raw message

toolchain/toolchain-external/Config.in.2 deleted +0 -17
deleted file mode 100644
index 489558c..0000000
@@ -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
toolchain/toolchain-external/ext-tool.mk +146 -64

232 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#6 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

Quoted 11 lines · On Monday, December 13, 2010 11:27:39 Thomas Petazzoni wrote:
package/Makefile.in +1 -4
@@ -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))

package/Makefile.in line 126

Quoted 10 lines
package/Makefile.in +4 -1
+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>

#7 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

Quoted 5 lines · On Tue, 14 Dec 2010 15:48:38 -0500 Mike Frysinger <[email protected]> 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

Signature · 11 lines
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>
#8 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

Quoted 3 lines · 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>

#9 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

Hello,

Quoted 4 lines · On Wed, 15 Dec 2010 06:14:43 -0500 Mike Frysinger <[email protected]> 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

#10 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

Hello Mike,

What do you think of the below proposal ?

Regards,

Thomas

Quoted 122 lines · On Wed, 15 Dec 2010 22:38:34 +0100 Thomas Petazzoni…

Hello,

Quoted 4 lines · On Wed, 15 Dec 2010 06:14:43 -0500 Mike Frysinger <[email protected]> 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 <[email protected]>
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.

---
 toolchain/toolchain-external/Config.in   |    9 +++++++++
 toolchain/toolchain-external/ext-tool.mk |   28 ++++++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 2 deletions(-)
toolchain/toolchain-external/Config.in +9 -0
index 8eab6de..126796d 100644
@@ -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
 
toolchain/toolchain-external/ext-tool.mk +26 -2
index 6c83ca1..edd7bf5 100644
@@ -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
Signature · 11 lines
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>
#11 lore raw

PATCH 3/14 toolchain: add support for external toolchain profiles and download

In reply to Thomas Petazzoni

toolchain/toolchain-external/ext-tool.mk LIB_EXTERNAL_LIBS+=libthread_db.so · line 124

Quoted 6 lines · On Monday, December 13, 2010 11:27:39 Thomas Petazzoni wrote:
toolchain/toolchain-external/ext-tool.mk +6 -0
+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>

#12 lore raw

PATCH 4/14 toolchain: remove toolchain-specific stripping

In reply to Thomas Petazzoni

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.

---
 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(-)
toolchain/helpers.mk +0 -9
index 43c6db3..24f379d 100644
@@ -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; \
toolchain/toolchain-crosstool-ng/Config.in +0 -6
index 4f30588..4ee665d 100644
@@ -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
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +2 -2
index 31797c4..1c5e864 100644
@@ -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},)
toolchain/toolchain-external/Config.in +0 -7
index c2602d2..59fcb52 100644
@@ -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
 
toolchain/toolchain-external/ext-tool.mk +2 -2
index 7a17914..71aa127 100644
@@ -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}) ; \
Signature · 1 line
1.7.0.4
#13 lore raw

PATCH 4/14 toolchain: remove toolchain-specific stripping

Quoted 5 lines · 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.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#14 lore raw

PATCH 5/14 toolchain: rework C++ options

In reply to Thomas Petazzoni

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.).

---
 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(-)
package/Makefile.in +1 -1
index 36bd59f..71c8dbc 100644
@@ -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
 
package/lzma/Config.in +2 -2
index 4904721..2b94dde 100644
@@ -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
package/rpm/Config.in +2 -2
index 448606c..8d4c6a3 100644
@@ -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
 
 
toolchain/gcc/gcc-uclibc-4.x.mk +1 -1
index af085f7..eec6523 100644
@@ -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)
toolchain/helpers.mk +1 -1
index 24f379d..33f0484 100644
@@ -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
 
toolchain/toolchain-buildroot/Config.in.2 +16 -0
index 2a8dcf5..cf426ee 100644
@@ -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"
toolchain/toolchain-common.in +3 -22
index ea47466..2c54acd 100644
@@ -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"
toolchain/toolchain-crosstool-ng/Config.in +8 -0
index 4ee665d..82e223d 100644
@@ -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
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +1 -1
index 1c5e864..817a1f7 100644
@@ -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:;
toolchain/toolchain-external/Config.in +14 -0
index 59fcb52..bd22e0c 100644
@@ -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
Signature · 1 line
1.7.0.4
#15 lore raw

PATCH 5/14 toolchain: rework C++ options

Quoted 4 lines · 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--]

Quoted 1 line
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#16 lore raw

PATCH 6/14 toolchain: move Stack Protection Support option

In reply to Thomas Petazzoni

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.

---
 toolchain/toolchain-buildroot/Config.in.2 |    9 +++++++++
 toolchain/toolchain-common.in             |    9 ---------
 toolchain/uClibc/uclibc.mk                |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)
toolchain/toolchain-buildroot/Config.in.2 +9 -0
index cf426ee..f1b0a7c 100644
@@ -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"
toolchain/toolchain-common.in +0 -9
index 2c54acd..5502ab4 100644
@@ -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
toolchain/uClibc/uclibc.mk +1 -1
index 1ed40cc..e05e16c 100644
@@ -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
Signature · 1 line
1.7.0.4
#17 lore raw

PATCH 7/14 ltp-testsuite: bump version and use autotargets

In reply to Thomas Petazzoni

Reworking ltp-testsuite is needed in order to get rid of some thread-specific options that will be cleaned-up in the next commit.

---
 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
package/ltp-testsuite/Config.in +11 -2
index efe0db7..2ab4134 100644
@@ -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
package/ltp-testsuite/ltp-testsuite-20101031-disable-controllers.patch new file +25 -0
new file mode 100644
index 0000000..57d6038
@@ -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 <[email protected]>
+---
+ 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
package/ltp-testsuite/ltp-testsuite-disable-ipv6-tests.patch deleted +0 -123

123 lines not on this page · raw message

package/ltp-testsuite/ltp-testsuite-enable-openposix-for-nptl.patch deleted +0 -33
deleted file mode 100644
index ebb888c..0000000
@@ -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)
package/ltp-testsuite/ltp-testsuite-generate-needs-bash.patch deleted +0 -8
deleted file mode 100644
index 1f28956..0000000
@@ -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
- #
package/ltp-testsuite/ltp-testsuite-sched-getaffinity.patch deleted +0 -11
deleted file mode 100644
index 9e4a9d8..0000000
@@ -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)
package/ltp-testsuite/ltp-testsuite-uclibc-syscalls.patch deleted +0 -11
deleted file mode 100644
index 866a56c..0000000
@@ -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:
package/ltp-testsuite/ltp-testsuite.mk +4 -64

73 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#18 lore raw

PATCH 8/14 toolchain: rework thread options

In reply to Thomas Petazzoni

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.

---
 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(-)
package/dmalloc/dmalloc.mk +3 -3
index 60ad763..dca0488 100644
@@ -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
package/ltp-testsuite/Config.in +2 -2
index 2ab4134..86aa4fb 100644
@@ -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
package/multimedia/ffmpeg/ffmpeg.mk +3 -3
index 959efa3..f0ec930 100644
@@ -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)
package/openvpn/openvpn.mk +3 -3
index 7d8fb0c..ba91690 100644
@@ -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)
toolchain/Makefile.in +0 -6
index 371509f..2cb6e95 100644
@@ -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
toolchain/gcc/gcc-uclibc-4.x.mk +6 -0
index eec6523..5f69906 100644
@@ -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
toolchain/toolchain-buildroot/Config.in.2 +27 -0
index f1b0a7c..fe93e70 100644
@@ -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"
toolchain/toolchain-common.in +3 -26
index 5502ab4..34d70a0 100644
@@ -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"
toolchain/toolchain-external/Config.in +9 -0
index bd22e0c..2ed65bf 100644
@@ -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
toolchain/toolchain-external/ext-tool.mk +1 -1
index 71aa127..d4f5bc5 100644
@@ -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
Signature · 1 line
1.7.0.4
#19 lore raw

PATCH 9/14 toolchain: check that the thread option selection is correct

In reply to Thomas Petazzoni

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.

---
 toolchain/helpers.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
toolchain/helpers.mk +2 -1
index 33f0484..9b37f3f 100644
@@ -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
Signature · 1 line
1.7.0.4
#20 lore raw

PATCH 10/14 gcc: disable libgomp when thread support is disabled

In reply to Thomas Petazzoni

libgomp needs thread support on the target to build properly.

---
 toolchain/gcc/gcc-uclibc-4.x.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
toolchain/gcc/gcc-uclibc-4.x.mk +1 -1
index 5f69906..cd63992 100644
@@ -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
Signature · 1 line
1.7.0.4
#21 lore raw

PATCH 11/14 toolchain: BR2_NEEDS_GETTEXT must be y when uClibc is used

In reply to Thomas Petazzoni

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.

---
 toolchain/toolchain-common.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
toolchain/toolchain-common.in +1 -0
index 34d70a0..bdc6e76 100644
@@ -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
Signature · 1 line
1.7.0.4
#22 lore raw

PATCH 12/14 toolchain: expose thread options in the Crosstool-NG backend

In reply to Thomas Petazzoni
---
 toolchain/toolchain-crosstool-ng/Config.in       |   36 ++++++++++++++++++++++
 toolchain/toolchain-crosstool-ng/crosstool-ng.mk |   21 +++++++++++++
 2 files changed, 57 insertions(+), 0 deletions(-)
toolchain/toolchain-crosstool-ng/Config.in +36 -0
index 82e223d..1a10416 100644
@@ -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
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +21 -0
index 817a1f7..a38dd12 100644
@@ -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)":;
Signature · 1 line
1.7.0.4
#23 lore raw

PATCH 12/14 toolchain: expose thread options in the Crosstool-NG backend

Quoted 1 line · On Monday 13 December 2010 17:27:48 Thomas Petazzoni wrote:

Once this is in, I might propose another (better?) one.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#24 lore raw

PATCH 13/14 toolchain: more verbose in crosstool-ng backend

In reply to Thomas Petazzoni

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.

---
 .../toolchain-crosstool-ng/crosstool-ng.config     |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
toolchain/toolchain-crosstool-ng/crosstool-ng.config +4 -4
index d5ee244..506f78a 100644
@@ -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
 
Signature · 1 line
1.7.0.4
#25 lore raw

PATCH 13/14 toolchain: more verbose in crosstool-ng backend

Quoted 7 lines · 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.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#26 lore raw

PATCH 14/14 package: pass TARGET_MAKE_ENV at install/clean/uninstall steps

In reply to Thomas Petazzoni

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.

---
 package/Makefile.autotools.in |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
package/Makefile.autotools.in +5 -5
index 7d04e44..de0a355 100644
@@ -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
 
Signature · 1 line
1.7.0.4