Toolchain updates: package infra, musl support, Linaro updates
v2 cover Toolchain updates: package infra, musl support, Linaro updates
Hello,
This patch set has now turned into a collection of toolchain-related updates:
* Switching the toolchain infrastructure to packages, so that 'make source', 'make external-deps' and 'make legal-info' work properly with the various toolchain backends.
* Support for the musl C library in external toolchains.
* Updates and fixes for the Linaro ARM and Aarch64 toolchains.
Thanks,
Thomas
Changes since RFCv1:
* Remove remaining references to the Crosstool-NG backend in the source code, noticed by Thomas De Schampheleire.
* Update the manual after Crosstool-NG backend removal
* Added Acked-by on the relevant patches.
* Ensure 'helpers.mk' is properly include from the right place after being moved into toolchain-external. Noticed by Luca Ceresoli.
* Fixed a few typos in comments, noticed by Thomas De Schampheleire.
* Renamed <pkg>_SOURCE_ADDONS to <pkg>_EXTRA_DOWNLOADS as suggested by Luca Ceresoli, and added documentation for this new variable in the Buildroot manual.
* The support for musl-based external toolchains has been integrated in this patch set, together with the fix for the hardcoded ld-linux-arm.so problem that was noticed in the v1 of the musl patch set.
* Updates for the Linaro ARM and AArch64 toolchains have been added.
* A fix for the Linaro ARM related bug #6452 has been added.
Thomas Petazzoni (21):
toolchain-crosstool-ng: remove support
docs: update manual after Crosstool-NG backend removal
toolchain-external: make ext-tool.mk includable in all cases
toolchain: move helpers.mk into toolchain-external/
toolchain: introduce a virtual package
toolchain-buildroot: convert to the package infrastructure
toolchain: intermediate .mk files no longer needed
package: package-based implementation of source, external-deps and
legal-info
package: remove useless SHOW_EXTERNAL_DEPS support
package: add a <pkg>_EXTRA_DOWNLOADS variable
toolchain-external: convert to the package infrastructure
dependencies: remove useless targets
toolchain-external: conditionalize the installation of libraries
toolchain-external: modify the wildcard logic for shared libraries
copying
toolchain-external: add support for musl C library
toolchain-external: improve help text of some options
busybox: add patches to fix build with the musl C library
toolchain-external: update Linaro ARM toolchain
toolchain-external: update Linaro AArch64 toolchain
toolchain-external: improve target library copy logic
toolchain-external: fix Linaro ARM toolchain support
Makefile | 76 +---
docs/manual/adding-packages-generic.txt | 6 +
docs/manual/configure.txt | 60 +--
docs/manual/customize-store.txt | 20 +-
docs/manual/customize-toolchain.txt | 12 -
docs/manual/make-tips.txt | 2 -
docs/manual/rebuilding-packages.txt | 2 -
package/Makefile.in | 2 +-
...01-libbb-use-poll.h-instead-of-sys-poll.h.patch | 32 ++
...onfig-include-linux-if_slip.h-instead-of-.patch | 33 ++
...libiproute-use-linux-if_packet.h-instead-.patch | 36 ++
package/libglib2/libglib2.mk | 2 +-
package/pkg-download.mk | 44 +-
package/pkg-generic.mk | 22 +-
support/dependencies/dependencies.mk | 8 -
toolchain/Config.in | 22 +-
toolchain/toolchain-buildroot.mk | 9 -
.../toolchain-buildroot/toolchain-buildroot.mk | 17 +
toolchain/toolchain-common.in | 4 -
toolchain/toolchain-crosstool-ng.mk | 5 -
toolchain/toolchain-crosstool-ng/Config.in | 133 ------
.../crosstool-ng.config-eglibc | 502 ---------------------
.../crosstool-ng.config-glibc | 491 --------------------
.../crosstool-ng.config-uClibc | 473 -------------------
toolchain/toolchain-crosstool-ng/crosstool-ng.mk | 396 ----------------
toolchain/toolchain-external.mk | 4 -
toolchain/toolchain-external/Config.in | 61 ++-
toolchain/{ => toolchain-external}/helpers.mk | 34 +-
.../{ext-tool.mk => toolchain-external.mk} | 221 ++++-----
toolchain/toolchain/toolchain.mk | 18 +
30 files changed, 384 insertions(+), 2363 deletions(-)
create mode 100644 package/busybox/1.21.1/0001-libbb-use-poll.h-instead-of-sys-poll.h.patch
create mode 100644 package/busybox/1.21.1/0002-network-ifconfig-include-linux-if_slip.h-instead-of-.patch
create mode 100644 package/busybox/1.21.1/0003-networking-libiproute-use-linux-if_packet.h-instead-.patch
delete mode 100644 toolchain/toolchain-buildroot.mk
create mode 100644 toolchain/toolchain-buildroot/toolchain-buildroot.mk
delete mode 100644 toolchain/toolchain-crosstool-ng.mk
delete mode 100644 toolchain/toolchain-crosstool-ng/Config.in
delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc
delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc
delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc
delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.mk
delete mode 100644 toolchain/toolchain-external.mk
rename toolchain/{ => toolchain-external}/helpers.mk (94%)
rename toolchain/toolchain-external/{ext-tool.mk => toolchain-external.mk} (82%)
create mode 100644 toolchain/toolchain/toolchain.mkSignature · 1 line
1.8.1.2
PATCH v2 1/21 toolchain-crosstool-ng: remove support
In order to avoid the work of converting the toolchain-crosstool-ng logic to the package infrastructure, we remove it from Buildroot, since it has been deprecated since quite some time.
--- Makefile | 7 - package/Makefile.in | 2 +- package/libglib2/libglib2.mk | 2 +- toolchain/Config.in | 13 - toolchain/helpers.mk | 4 +- toolchain/toolchain-common.in | 4 - toolchain/toolchain-crosstool-ng.mk | 5 - toolchain/toolchain-crosstool-ng/Config.in | 133 ------ .../crosstool-ng.config-eglibc | 502 --------------------- .../crosstool-ng.config-glibc | 491 -------------------- .../crosstool-ng.config-uClibc | 473 ------------------- toolchain/toolchain-crosstool-ng/crosstool-ng.mk | 396 ---------------- 12 files changed, 3 insertions(+), 2029 deletions(-) delete mode 100644 toolchain/toolchain-crosstool-ng.mk delete mode 100644 toolchain/toolchain-crosstool-ng/Config.in delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc delete mode 100644 toolchain/toolchain-crosstool-ng/crosstool-ng.mk
Makefile +0 -7
@@ -240,8 +240,6 @@ ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) BASE_TARGETS += toolchain-buildroot else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) BASE_TARGETS += toolchain-external -else ifeq ($(BR2_TOOLCHAIN_CTNG),y) -BASE_TARGETS += toolchain-crosstool-ng endif TARGETS:=
@@ -323,8 +321,6 @@ ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) include toolchain/toolchain-buildroot.mk else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) include toolchain/toolchain-external.mk -else ifeq ($(BR2_TOOLCHAIN_CTNG),y) -include toolchain/toolchain-crosstool-ng.mk endif # Include the package override file if one has been provided in the
@@ -802,9 +798,6 @@ endif ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) @echo ' uclibc-menuconfig - Run uClibc menuconfig' endif -ifeq ($(BR2_TOOLCHAIN_CTNG),y) - @echo ' ctng-menuconfig - Run crosstool-NG menuconfig' -endif ifeq ($(BR2_TARGET_BAREBOX),y) @echo ' barebox-menuconfig - Run barebox menuconfig' @echo ' barebox-savedefconfig - Run barebox savedefconfig'
package/Makefile.in +1 -1
@@ -138,7 +138,7 @@ TARGET_CFLAGS += -fstack-protector-all TARGET_CXXFLAGS += -fstack-protector-all endif -ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y) +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)- else TARGET_CROSS=$(HOST_DIR)/usr/bin/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
package/libglib2/libglib2.mk +1 -1
@@ -51,7 +51,7 @@ LIBGLIB2_CONF_ENV = \ gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no) # old uClibc versions don't provide qsort_r -ifeq ($(BR2_UCLIBC_VERSION_0_9_32)$(BR2_TOOLCHAIN_CTNG_uClibc)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC)$(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_V2)$(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2),y) +ifeq ($(BR2_UCLIBC_VERSION_0_9_32)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC)$(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_V2)$(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2),y) LIBGLIB2_CONF_ENV += glib_cv_have_qsort_r=no else LIBGLIB2_CONF_ENV += glib_cv_have_qsort_r=yes
toolchain/Config.in +0 -13
@@ -36,23 +36,10 @@ config BR2_TOOLCHAIN_EXTERNAL toolchain. Buildroot can either download automatically a toolchain, or use an already installed toolchain. -config BR2_TOOLCHAIN_CTNG - bool "Crosstool-NG toolchain" - depends on BR2_DEPRECATED - depends on !BR2_microblaze && !BR2_aarch64 && !BR2_xtensa && \ - !BR2_arc && !BR2_nios2 - select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS - help - Say 'y' if you want to generate the toolchain with crosstool-NG - (http://crosstool-ng.org). - - This is considered experimental, and you can expect some breakage. - endchoice source "toolchain/toolchain-buildroot/Config.in" source "toolchain/toolchain-external/Config.in" -source "toolchain/toolchain-crosstool-ng/Config.in" source "toolchain/toolchain-common.in" endmenu
toolchain/helpers.mk +1 -3
@@ -1,7 +1,5 @@ # This Makefile fragment declares helper functions, usefull to handle -# non- buildroot-built toolchains, eg. purely external toolchains or -# toolchains (internally) built using crosstool-NG. - +# non- buildroot-built toolchains, eg. purely external toolchains. # # Copy a toolchain library and its symbolic links from the sysroot # directory to the target directory. Also optionaly strips the
toolchain/toolchain-common.in +0 -4
@@ -59,10 +59,6 @@ config BR2_ENABLE_LOCALE_WHITELIST config BR2_GENERATE_LOCALE string "Generate locale data" default "" - # Pre-built uClibc external toolchains and uClibc toolchains - # built by the Crosstool-NG backend cannot be supported, - # because the list of locales to support must be defined at - # build time. depends on \ BR2_TOOLCHAIN_BUILDROOT || \ BR2_TOOLCHAIN_USES_GLIBC
toolchain/toolchain-crosstool-ng.mk deleted +0 -5
@@ -1,5 +0,0 @@ -# Required includes for the external toolchain backend - -# Explicit ordering: -include toolchain/helpers.mk -include toolchain/toolchain-crosstool-ng/crosstool-ng.mk
toolchain/toolchain-crosstool-ng/Config.in deleted +0 -133
133 lines not on this page · raw message
toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc deleted +0 -502
502 lines not on this page · raw message
toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc deleted +0 -491
491 lines not on this page · raw message
toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc deleted +0 -473
473 lines not on this page · raw message
toolchain/toolchain-crosstool-ng/crosstool-ng.mk deleted +0 -396
396 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v2 1/21 toolchain-crosstool-ng: remove support
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> In order to avoid the work of converting the toolchain-crosstool-ng Thomas> logic to the package infrastructure, we remove it from Buildroot, Thomas> since it has been deprecated since quite some time.
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> Acked-by: "Yann E. MORIN" <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 2/21 docs: update manual after Crosstool-NG backend removal
In reply to Thomas Petazzoni--- docs/manual/configure.txt | 60 +++---------------------------------- docs/manual/customize-store.txt | 20 ++++++------- docs/manual/customize-toolchain.txt | 12 -------- docs/manual/make-tips.txt | 2 -- docs/manual/rebuilding-packages.txt | 2 -- 5 files changed, 14 insertions(+), 82 deletions(-)
docs/manual/configure.txt +4 -56
@@ -47,8 +47,7 @@ target system uses ARM, the regular compilation toolchain on your host runs on x86 and generates code for x86, while the cross-compilation toolchain runs on x86 and generates code for ARM. -Buildroot provides different solutions to build, or use existing -cross-compilation toolchains: +Buildroot provides two solutions for the cross-compilation toolchain: * The *internal toolchain backend*, called +Buildroot toolchain+ in the configuration interface.
@@ -56,10 +55,7 @@ cross-compilation toolchains: * The *external toolchain backend*, called +External toolchain+ in the configuration interface. - * The *Crosstool-NG toolchain backend*, called +Crosstool-NG - toolchain+ in the configuration interface. - -The choice between these three solutions is done using the +Toolchain +The choice between these two solutions is done using the +Toolchain Type+ option in the +Toolchain+ menu. Once one solution has been chosen, a number of configuration options appear, they are detailed in the following sections.
@@ -76,8 +72,8 @@ This backend is the historical backend of Buildroot, and has been limited for a long time to the usage of the http://www.uclibc.org[uClibc C library]. Support for the _eglibc_ C library has been added in 2013 and is at this point considered -experimental. See the _External toolchain backend_ and _Crosstool-NG -toolchain backend_ for other solutions to use _glibc_ or _eglibc_. +experimental. See the _External toolchain backend_ for another +solution to use _glibc_ or _eglibc_. Once you have selected this backend, a number of options appear. The most important ones allow to:
@@ -242,54 +238,6 @@ Drawbacks of this backend: fix from the toolchain vendor, unless you build your external toolchain by yourself using Crosstool-NG. -[[crosstool-ng-toolchain-backend]] -Crosstool-NG toolchain backend -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The _Crosstool-NG toolchain backend_ integrates the -http://crosstool-ng.org[Crosstool-NG] project with -Buildroot. Crosstool-NG is a highly-configurable, versatile and -well-maintained tool to build cross-compilation toolchains. - -If you select the +Crosstool-NG toolchain+ option in +Toolchain Type+, -then you will be offered to: - - * Choose which C library you want to use. Crosstool-NG supports the - three most important C libraries used in Linux systems: glibc, - eglibc and uClibc - - * Choose a custom Crosstool-NG configuration file. Buildroot has its - own default configuration file (one per C library choice), but you - can provide your own. Another option is to run +make - ctng-menuconfig+ to get access to the Crosstool-NG configuration - interface. However, note that all Buildroot packages have only been - tested with the default Crosstool-NG configurations. - - * Choose a number of toolchain options (rather limited if glibc or - eglibc are used, or numerous if uClibc is used) - -When you will start the Buildroot build process, Buildroot will -download and install the Crosstool-NG tool, build and install its -required dependencies, and then run Crosstool-NG with the provided -configuration. - -Advantages of this backend: - -* Not limited to uClibc: glibc and eglibc are supported. - -* Vast possibilities of toolchain configuration. - -Drawbacks of this backend: - -* Crosstool-NG is not perfectly integrated with Buildroot. For - example, Crosstool-NG has its own download infrastructure, not - integrated with the one in Buildroot (for example a Buildroot +make - source+ will not download all the source code tarballs needed by - Crosstool-NG). - -* The toolchain is completely rebuilt from scratch if you do a +make - clean+. - /dev management ~~~~~~~~~~~~~~~
docs/manual/customize-store.txt +10 -10
@@ -42,13 +42,14 @@ Alternatively, you can copy the file to any other place and rebuild with Other package configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The configuration files for busybox, the linux kernel, barebox, uClibc and -crosstool-NG should be stored as well if changed. For each of these, a -buildroot configuration option exists to point to an input configuration -file, e.g. +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+. To save their -configuration, set those configuration options to a path outside -your output directory, e.g. +board/<manufacturer>/<boardname>/linux.config+. -Then, copy the configuration files to that path. +The configuration files for busybox, the linux kernel, barebox and +uClibc should be stored as well if changed. For each of these, a +buildroot configuration option exists to point to an input +configuration file, e.g. +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+. To +save their configuration, set those configuration options to a path +outside your output directory, +e.g. +board/<manufacturer>/<boardname>/linux.config+. Then, copy the +configuration files to that path. Make sure that you create a configuration file 'before' changing the +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+ etc. options. Otherwise,
@@ -70,9 +71,8 @@ configuration files easier. path specified by +BR2_UCLIBC_CONFIG+. * +make barebox-update-defconfig+ saves the barebox configuration to the path specified by +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+. -* For crosstool-NG and at91bootstrap3, no helper exists so you - have to copy the config file manually to +BR2_TOOLCHAIN_CTNG_CONFIG+, - resp. +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+. +* For at91bootstrap3, no helper exists so you have to copy the config + file manually to +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+. [[customize-store-board-support]]
docs/manual/customize-toolchain.txt +0 -12
@@ -44,15 +44,3 @@ However, it allows to tune major settings, such as: These settings are available after selecting the +Buildroot toolchain+ type in the menu +Toolchain+. - -Using the Crosstool-NG backend -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The http://crosstool-ng.org[crosstool-NG] toolchain backend enables a rather -limited set of settings under the Buildroot +Toolchain+ menu: - -* The http://crosstool-ng.org[crosstool-NG] configuration file - -* Gdb and some toolchain options - -Then, the toolchain can be fine-tuned by invoking +make ctng-menuconfig+.
docs/manual/make-tips.txt +0 -2
@@ -36,8 +36,6 @@ some settings in the +.config+ file may hide some targets: +linux+ is enabled; * +uclibc-menuconfig+ is only available when the Buildroot internal toolchain backend is used; -* +ctng-menuconfig+ is only available when the - crosstool-NG backend is used; * +barebox-menuconfig+ and +barebox-savedefconfig+ only work when the +barebox+ bootloader is enabled.
docs/manual/rebuilding-packages.txt +0 -2
@@ -17,8 +17,6 @@ In some cases, a full rebuild is mandatory: ** after changing any toolchain option under the _Toolchain_ menu (if the internal Buildroot backend is used); -** after running +make ctng-menuconfig+ (if the crosstool-NG backend - is used); ** after running +make uclibc-menuconfig+. * after removing some libraries from the package selection.
Signature · 1 line
1.8.1.2
PATCH v2 2/21 docs: update manual after Crosstool-NG backend removal
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---
Thomas> docs/manual/configure.txt | 60 +++---------------------------------- Thomas> docs/manual/customize-store.txt | 20 ++++++-------
You missed a few ctng references in customize-store.txt. Committed with that fixed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 3/21 toolchain-external: make ext-tool.mk includable in all cases
In reply to Thomas PetazzoniThe ext-tool.mk logic uses the TOOLCHAIN_EXTERNAL_PREFIX variable unconditionally, even if the external toolchain is not used. Until now this wasn't a problem since ext-tool.mk was only included when the external toolchain backend was selected, but the next patches are going to include this file unconditionally.
--- toolchain/toolchain-external/ext-tool.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
toolchain/toolchain-external/ext-tool.mk +2 -1
@@ -1,4 +1,3 @@ - # # This file implements the support for external toolchains, i.e # toolchains that have not been produced by Buildroot itself and that
@@ -112,8 +111,10 @@ TOOLCHAIN_EXTERNAL_DIR=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH)) endif ifeq ($(TOOLCHAIN_EXTERNAL_DIR),) +ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),) # if no path set, figure it out from path TOOLCHAIN_EXTERNAL_BIN := $(shell dirname $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)) +endif else ifeq ($(BR2_bfin),y) TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_DIR)/$(TOOLCHAIN_EXTERNAL_PREFIX)/bin
Signature · 1 line
1.8.1.2
PATCH v2 3/21 toolchain-external: make ext-tool.mk includable in all cases
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> The ext-tool.mk logic uses the TOOLCHAIN_EXTERNAL_PREFIX variable Thomas> unconditionally, even if the external toolchain is not used. Until now Thomas> this wasn't a problem since ext-tool.mk was only included when the Thomas> external toolchain backend was selected, but the next patches are Thomas> going to include this file unconditionally.
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> Acked-by: Thomas De Schampheleire <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 4/21 toolchain: move helpers.mk into toolchain-external/
In reply to Thomas PetazzoniThe helpers.mk file is no longer used by the Crosstool-NG backend, so it is moved into the toolchain/toolchain-external/ directory.
---
toolchain/toolchain-buildroot.mk | 2 --
toolchain/toolchain-external.mk | 2 +-
toolchain/{ => toolchain-external}/helpers.mk | 0
3 files changed, 1 insertion(+), 3 deletions(-)
rename toolchain/{ => toolchain-external}/helpers.mk (100%)toolchain/toolchain-buildroot.mk +0 -2
@@ -2,8 +2,6 @@ # build of binutils, uClibc, kernel headers and all the intermediate # gcc steps. -include toolchain/helpers.mk - BUILDROOT_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC)) toolchain-buildroot: host-gcc-final
toolchain/toolchain-external.mk +1 -1
@@ -1,4 +1,4 @@ # Required includes for the external toolchain backend -include toolchain/helpers.mk +include toolchain/toolchain-external/helpers.mk include toolchain/toolchain-external/ext-tool.mk
toolchain/toolchain-external/helpers.mk renamed from toolchain/helpers.mk +0 -0
Signature · 1 line
1.8.1.2
PATCH v2 4/21 toolchain: move helpers.mk into toolchain-external/
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Thomas> The helpers.mk file is no longer used by the Crosstool-NG backend, so Thomas> it is moved into the toolchain/toolchain-external/ directory.
Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---
Thomas> toolchain/toolchain-buildroot.mk | 2 --
Thomas> toolchain/toolchain-external.mk | 2 +-
Thomas> toolchain/{ => toolchain-external}/helpers.mk | 0 Thomas> 3 files changed, 1 insertion(+), 3 deletions(-) Thomas> rename toolchain/{ => toolchain-external}/helpers.mk (100%)
Thomas> diff --git a/toolchain/toolchain-buildroot.mk b/toolchain/toolchain-buildroot.mk Thomas> index 3a05800..ff89125 100644
Thomas> --- a/toolchain/toolchain-buildroot.mk
Thomas> +++ b/toolchain/toolchain-buildroot.mk
Thomas> @@ -2,8 +2,6 @@
Thomas> # build of binutils, uClibc, kernel headers and all the intermediate Thomas> # gcc steps.
Thomas> -include toolchain/helpers.mk
Thomas> -
That doesn't seem right as we have:
git grep copy_toolchain package/package/glibc/glibc.mk: $(call copy_toolchain_lib_root,$(STAGING_DIR)/,,
And indeed:
Quoted 1 line
Quoted 1 line
Quoted 1 line
glibc 2.17-svnr22064 Installing to target
for libs in ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so libnss_files.so libnss_dns.so; do ; done /bin/sh: -c: line 0: syntax error near unexpected token `;'/bin/sh: -c: line 0: `for libs in ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so libnss_files.so libnss_dns.so; do ; done'
make: *** [/home/peko/source/buildroot/output/build/glibc-2.17-svnr22064/.stamp_target_installed] Error 1
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 4/21 toolchain: move helpers.mk into toolchain-external/
Dear Peter Korsgaard,
Quoted 7 lines · Peter Korsgaard
Thomas> -include
toolchain/helpers.mk
Thomas> -That doesn't seem right as we have:
git grep
copy_toolchainpackage/package/glibc/glibc.mk: $(call copy_toolchain_lib_root,$(STAGING_DIR)/,,
Oh, I'm impressed how well you know the code, even code that I have written. We really need some kind of "test suite" to check patches or something like that: a patch set such as this toolchain-related patch set is really a pain to test in all the various possible conditions. I did test the internal backend, but only with uClibc toolchain.
I'll rework my patch series.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 4/21 toolchain: move helpers.mk into toolchain-external/
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hi,
Quoted 2 lines
Quoted 2 lines
git grep
copy_toolchainpackage/package/glibc/glibc.mk: $(call copy_toolchain_lib_root,$(STAGING_DIR)/,,
Thomas> Oh, I'm impressed how well you know the code, even code that I have Thomas> written.
git grep is your friend ;)
Thomas> We really need some kind of "test suite" to check patches or Thomas> something like that: a patch set such as this toolchain-related patch Thomas> set is really a pain to test in all the various possible conditions. I Thomas> did test the internal backend, but only with uClibc toolchain.
Yeah, but I'm afraid the only real way of testing things is to build the various affected variants (internal uclibc/glibc + external).
Thomas> I'll rework my patch series.
Great, thanks!
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 5/21 toolchain: introduce a virtual package
In reply to Thomas PetazzoniThis commit introduces a virtual package called 'toolchain', located in 'toolchain/toolchain', which simply depends on 'toolchain-buildroot' or 'toolchain-external' depending on the selected toolchain backend.
For now, toolchain-buildroot and toolchain-external are still manual make targets, but the following patches convert those backends to use the package infrastructure as well.
In addition to this:
* The main Makefile is modified to always make BASE_TARGETS point to this new toolchain virtual package.
* The main Makefile is changed to include all the toolchain/*/*.mk
files: the toolchain virtual package, and the toolchain-buildroot and toolchain-external directories.
* The dependency of the toolchain on prepare dirs and dependencies is moved to the toolchain virtual package. It is moved as a prerequisite of the "toolchain-source" rule to ensure that all directories are prepared before we even start extracting the toolchain.
--- Makefile | 18 +++--------------- toolchain/toolchain/toolchain.mk | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 toolchain/toolchain/toolchain.mk
Makefile +3 -15
@@ -236,11 +236,7 @@ GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess) # ################################################################################ -ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) -BASE_TARGETS += toolchain-buildroot -else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) -BASE_TARGETS += toolchain-external -endif +BASE_TARGETS = toolchain TARGETS:=
@@ -317,11 +313,7 @@ include support/dependencies/dependencies.mk # We also need the various per-package makefiles, which also add # each selected package to TARGETS if that package was selected # in the .config file. -ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) -include toolchain/toolchain-buildroot.mk -else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) -include toolchain/toolchain-external.mk -endif +include toolchain/*/*.mk # Include the package override file if one has been provided in the # configuration.
@@ -388,16 +380,12 @@ $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) -$(BASE_TARGETS): dirs $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake - $(BUILD_DIR)/buildroot-config/auto.conf: $(BUILDROOT_CONFIG) $(MAKE) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig prepare: $(BUILD_DIR)/buildroot-config/auto.conf -toolchain: prepare dirs dependencies $(BASE_TARGETS) - -world: toolchain $(TARGETS_ALL) +world: $(BASE_TARGETS) $(TARGETS_ALL) .PHONY: all world toolchain dirs clean distclean source outputmakefile \ legal-info legal-info-prepare legal-info-clean printvars \
toolchain/toolchain/toolchain.mk new file +18 -0
@@ -0,0 +1,18 @@ +################################################################################ +# +# toolchain +# +################################################################################ + +TOOLCHAIN_SOURCE = + +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) +TOOLCHAIN_DEPENDENCIES += toolchain-buildroot +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) +TOOLCHAIN_DEPENDENCIES += toolchain-external +endif + +$(eval $(generic-package)) + +toolchain-source: prepare dirs dependencies $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake +
Signature · 1 line
1.8.1.2
PATCH v2 6/21 toolchain-buildroot: convert to the package infrastructure
In reply to Thomas PetazzoniThis commit converts the toolchain-buildroot logic to the package infrastructure. The package is fairly simple as it only defines BUILDROOT_LIBC, and depends on host-gcc-final to get the overall internal toolchain build logic started.
--- toolchain/toolchain-buildroot.mk | 7 ------- toolchain/toolchain-buildroot/toolchain-buildroot.mk | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 toolchain/toolchain-buildroot.mk create mode 100644 toolchain/toolchain-buildroot/toolchain-buildroot.mk
toolchain/toolchain-buildroot.mk deleted +0 -7
@@ -1,7 +0,0 @@ -# Triggerring the build of the host-gcc-final will automaticaly do the -# build of binutils, uClibc, kernel headers and all the intermediate -# gcc steps. - -BUILDROOT_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC)) - -toolchain-buildroot: host-gcc-final
toolchain/toolchain-buildroot/toolchain-buildroot.mk new file +17 -0
@@ -0,0 +1,17 @@ +################################################################################ +# +# toolchain-buildroot +# +################################################################################ + +TOOLCHAIN_BUILDROOT_SOURCE = + +BUILDROOT_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC)) + +# Trigerring the build of the host-gcc-final will automatically do the +# build of binutils, uClibc, kernel headers and all the intermediate +# gcc steps. + +TOOLCHAIN_BUILDROOT_DEPENDENCIES = host-gcc-final + +$(eval $(generic-package))
Signature · 1 line
1.8.1.2
PATCH v2 7/21 toolchain: intermediate .mk files no longer needed
In reply to Thomas Petazzoni--- toolchain/toolchain-external.mk | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 toolchain/toolchain-external.mk
toolchain/toolchain-external.mk deleted +0 -4
@@ -1,4 +0,0 @@ -# Required includes for the external toolchain backend - -include toolchain/toolchain-external/helpers.mk -include toolchain/toolchain-external/ext-tool.mk
Signature · 1 line
1.8.1.2
PATCH v2 8/21 package: package-based implementation of source, external-deps and legal-info
In reply to Thomas PetazzoniUntil now, the make source, make external-deps and make legal-info where relying on enumerating the packages by looking at $(TARGETS) which contains only the target packages and not the host packages. Thanks to the TARGET_HOST_DEPS and HOST_DEPS variables, it was doing a two-level resolution of host package dependencies, but it was not entirely correct since the dependency chain might be deeper than that: some packages could be missed.
From an idea of Arnout, this patch introduces in each package additional targets <pkg>-all-source, <pkg>-all-legal-info and <pkg>-all-external-deps that executes the 'source', 'legal-info' and 'external-deps' targets for this package and all its dependencies, be they target or host dependencies.
This provides a much cleaner implementation of this mechanism, which is also more robust.
In order to achieve this, this patch also separates the "package" targets from other targets: instead of mixing them both in the global TARGETS variable, the new PACKAGES variable contains the name of all packages that are enabled in the configuration, while TARGETS is only used for additional things to be done (target-finalize, etc.). This separation is needed so that we don't try to use targets (such as <foo>-all-external-deps) on things that are not packages. Some further cleanups in this direction are possible, this commit takes a relatively minimal approach for now.
--- Makefile | 53 +++++++++++++------------------------------------- package/pkg-generic.mk | 13 ++++++++++++- 2 files changed, 25 insertions(+), 41 deletions(-)
Makefile +13 -40
@@ -238,8 +238,6 @@ GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess) BASE_TARGETS = toolchain -TARGETS:= - # silent mode requested? QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
@@ -310,9 +308,6 @@ endif include package/Makefile.in include support/dependencies/dependencies.mk -# We also need the various per-package makefiles, which also add -# each selected package to TARGETS if that package was selected -# in the .config file. include toolchain/*/*.mk # Include the package override file if one has been provided in the
@@ -348,34 +343,11 @@ include fs/common.mk TARGETS+=target-post-image -TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) -TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) -TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) -TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS)) - -# host-* dependencies have to be handled specially, as those aren't -# visible in Kconfig and hence not added to a variable like TARGETS. -# instead, find all the host-* targets listed in each <PKG>_DEPENDENCIES -# variable for each enabled target. -# Notice: this only works for newstyle gentargets/autotargets packages -TARGETS_HOST_DEPS = $(sort $(filter host-%,$(foreach dep,\ - $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS))),\ - $($(dep))))) -# Host packages can in turn have their own dependencies. Likewise find -# all the package names listed in the HOST_<PKG>_DEPENDENCIES for each -# host package found above. Ideally this should be done recursively until -# no more packages are found, but that's hard to do in make, so limit to -# 1 level for now. -HOST_DEPS = $(sort $(foreach dep,\ - $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS_HOST_DEPS))),\ - $($(dep)))) -HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS))) - -TARGETS_LEGAL_INFO:=$(patsubst %,%-legal-info,\ - $(TARGETS) $(BASE_TARGETS) $(TARGETS_HOST_DEPS) $(HOST_DEPS)))) - -# all targets depend on the crosscompiler and it's prerequisites -$(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % +PACKAGES_CLEAN:=$(patsubst %,%-clean,$(PACKAGES)) +PACKAGES_SOURCE:=$(patsubst %,%-all-source,$(PACKAGES) $(BASE_TARGETS)) +PACKAGES_EXTERNAL_DEPS:=$(patsubst %,%-all-external-deps,$(PACKAGES) $(BASE_TARGETS)) +PACKAGES_DIRCLEAN:=$(patsubst %,%-dirclean,$(PACKAGES)) +PACKAGES_LEGAL_INFO:=$(patsubst %,%-all-legal-info,$(PACKAGES) $(BASE_TARGETS)) dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
@@ -385,12 +357,13 @@ $(BUILD_DIR)/buildroot-config/auto.conf: $(BUILDROOT_CONFIG) prepare: $(BUILD_DIR)/buildroot-config/auto.conf -world: $(BASE_TARGETS) $(TARGETS_ALL) +world: $(BASE_TARGETS) $(PACKAGES) $(TARGETS) .PHONY: all world toolchain dirs clean distclean source outputmakefile \ legal-info legal-info-prepare legal-info-clean printvars \ - $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \ - $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \ + $(BASE_TARGETS) $(PACKAGES) $(TARGETS) \ + $(PACKAGES_CLEAN) $(PACKAGES_DIRCLEAN) $(PACKAGES_SOURCE) $(PACKAGES_LEGAL_INFO) \ + $(PACKAGES_EXTERNAL_DEPS) \ $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
@@ -561,10 +534,10 @@ target-post-image: toolchain-eclipse-register: ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH) -source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE) +source: dirs $(PACKAGES_SOURCE) external-deps: - @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u + @$(MAKE) -s $(EXTRAMAKEARGS) $(PACKAGES_EXTERNAL_DEPS) | sort -u legal-info-clean: @rm -fr $(LEGAL_INFO_DIR)
@@ -579,7 +552,7 @@ legal-info-prepare: $(LEGAL_INFO_DIR) @cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \ - $(TARGETS_LEGAL_INFO) + $(PACKAGES_LEGAL_INFO) @cat support/legal-info/README.header >>$(LEGAL_REPORT) @if [ -r $(LEGAL_WARNINGS) ]; then \ cat support/legal-info/README.warnings-header \
@@ -589,7 +562,7 @@ legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \ @rm -f $(LEGAL_WARNINGS) show-targets: - @echo $(TARGETS) + @echo $(BASE_TARGETS) $(PACKAGES) $(TARGETS) else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
package/pkg-generic.mk +12 -1
@@ -423,6 +423,17 @@ endif $(1)-show-depends: @echo $$($(2)_DEPENDENCIES) +$(1)-all-source: $(foreach p,$($(2)_DEPENDENCIES),$(p)-all-source) $(1)-source + +$(1)-external-deps: +ifneq ($$($(2)_SOURCE),) + @echo $$($(2)_SOURCE) +endif + +$(1)-all-external-deps: $(foreach p,$($(2)_DEPENDENCIES),$(p)-all-external-deps) $(1)-external-deps + +$(1)-all-legal-info: $(foreach p,$($(2)_DEPENDENCIES),$(p)-all-legal-info) $(1)-legal-info + $(1)-uninstall: $(1)-configure $$($(2)_TARGET_UNINSTALL) $(1)-clean: $(1)-uninstall \
@@ -527,7 +538,7 @@ endif # ifneq ($(call qstrip,$$($(2)_SOURCE)),) # configuration ifeq ($$($$($(2)_KCONFIG_VAR)),y) -TARGETS += $(1) +PACKAGES += $(1) PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep) PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep) PACKAGES_USERS += $$($(2)_USERS)$$(sep)
Signature · 1 line
1.8.1.2
PATCH v2 9/21 package: remove useless SHOW_EXTERNAL_DEPS support
In reply to Thomas PetazzoniNow that a package-based 'make external-deps' support has been added, the DL_MODE=SHOW_EXTERNAL_DEPS mechanism is no longer needed, so some clean up is done in this commit.
--- package/pkg-download.mk | 44 ++------------------------------------------ package/pkg-generic.mk | 5 +---- 2 files changed, 3 insertions(+), 46 deletions(-)
package/pkg-download.mk +2 -42
@@ -18,9 +18,8 @@ SCP := $(call qstrip,$(BR2_SCP)) $(QUIET) SSH := $(call qstrip,$(BR2_SSH)) $(QUIET) LOCALFILES := $(call qstrip,$(BR2_LOCALFILES)) -# Default spider mode is 'DOWNLOAD'. Other possible values are 'SOURCE_CHECK' -# used by the _source-check target and 'SHOW_EXTERNAL_DEPS', used by the -# external-deps target. +# Default spider mode is 'DOWNLOAD'. The possible value is +# 'SOURCE_CHECK' used by the _source-check target. DL_MODE=DOWNLOAD # Override BR2_DL_DIR if shell variable defined
@@ -66,11 +65,6 @@ domainseparator=$(if $(1),$(1),/) # The SOURCE_CHECK_* helpers are in charge of simply checking that the source # is available for download. This can be used to make sure one will be able # to get all the sources needed for one's build configuration. -# -# The SHOW_EXTERNAL_DEPS_* helpers simply output to the console the names -# of the files that will be downloaded, or path and revision of the -# source repositories, producing a list of all the "external dependencies" -# of a given build configuration. ################################################################################ # Try a shallow clone - but that only works if the version is a ref (tag or
@@ -101,11 +95,6 @@ define SOURCE_CHECK_GIT $(GIT) ls-remote --heads $($(PKG)_SITE) > /dev/null endef -define SHOW_EXTERNAL_DEPS_GIT - echo $($(PKG)_SOURCE) -endef - - define DOWNLOAD_BZR test -e $(DL_DIR)/$($(PKG)_SOURCE) || \ $(BZR) export $(DL_DIR)/$($(PKG)_SOURCE) $($(PKG)_SITE) -r $($(PKG)_DL_VERSION)
@@ -115,10 +104,6 @@ define SOURCE_CHECK_BZR $(BZR) ls --quiet $($(PKG)_SITE) > /dev/null endef -define SHOW_EXTERNAL_DEPS_BZR - echo $($(PKG)_SOURCE) -endef - define DOWNLOAD_CVS test -e $(DL_DIR)/$($(PKG)_SOURCE) || \ (pushd $(DL_DIR) > /dev/null && \
@@ -134,10 +119,6 @@ define SOURCE_CHECK_CVS $(CVS) -d:pserver:anonymous:@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) login endef -define SHOW_EXTERNAL_DEPS_CVS - echo $($(PKG)_SOURCE) -endef - define DOWNLOAD_SVN test -e $(DL_DIR)/$($(PKG)_SOURCE) || \ (pushd $(DL_DIR) > /dev/null && \
@@ -151,10 +132,6 @@ define SOURCE_CHECK_SVN $(SVN) ls $($(PKG)_SITE) > /dev/null endef -define SHOW_EXTERNAL_DEPS_SVN - echo $($(PKG)_SOURCE) -endef - # SCP URIs should be of the form scp://[user@]host:filepath # Note that filepath is relative to the user's home directory, so you may want # to prepend the path with a slash: scp://[user@]host:/absolutepath
@@ -167,11 +144,6 @@ define SOURCE_CHECK_SCP $(SSH) $(call domain,$(1),:) ls '$(call notdomain,$(1),:)' > /dev/null endef -define SHOW_EXTERNAL_DEPS_SCP - echo $(2) -endef - - define DOWNLOAD_HG test -e $(DL_DIR)/$($(PKG)_SOURCE) || \ (pushd $(DL_DIR) > /dev/null && \
@@ -188,10 +160,6 @@ define SOURCE_CHECK_HG $(HG) incoming --force -l1 $($(PKG)_SITE) > /dev/null endef -define SHOW_EXTERNAL_DEPS_HG - echo $($(PKG)_SOURCE) -endef - # Download a file using wget. Only download the file if it doesn't # already exist in the download directory. If the download fails, # remove the file (because wget -O creates a 0-byte file even if the
@@ -209,10 +177,6 @@ define SOURCE_CHECK_WGET $(WGET) --spider '$(call qstrip,$(1))' endef -define SHOW_EXTERNAL_DEPS_WGET - echo $(2) -endef - define DOWNLOAD_LOCALFILES test -e $(DL_DIR)/$(2) || \ $(LOCALFILES) $(call stripurischeme,$(call qstrip,$(1))) $(DL_DIR)
@@ -222,10 +186,6 @@ define SOURCE_CHECK_LOCALFILES test -e $(call stripurischeme,$(call qstrip,$(1))) endef -define SHOW_EXTERNAL_DEPS_LOCALFILES - echo $(2) -endef - ################################################################################ # DOWNLOAD -- Download helper. Will try to download source from: # 1) BR2_PRIMARY_SITE if enabled
package/pkg-generic.mk +1 -4
@@ -70,13 +70,10 @@ $(BUILD_DIR)/%/.stamp_rsynced: rsync -au --cvs-exclude --include core $(SRCDIR)/ $(@D) $(Q)touch $@ -# Handle the SOURCE_CHECK and SHOW_EXTERNAL_DEPS cases for rsynced -# packages +# Handle the SOURCE_CHECK case for rsynced packages $(BUILD_DIR)/%/.stamp_rsync_sourced: ifeq ($(DL_MODE),SOURCE_CHECK) test -d $(SRCDIR) -else ifeq ($(DL_MODE),SHOW_EXTERNAL_DEPS) - echo "file://$(SRCDIR)" else @true # Nothing to do to source a local package endif
Signature · 1 line
1.8.1.2
PATCH v2 10/21 package: add a <pkg>_EXTRA_DOWNLOADS variable
In reply to Thomas PetazzoniConverting the external toolchain logic into a package raises a very special use case that wasn't handled by the package infrastructure:
the Blackfin toolchain is delivered as two tarballs instead of one. Unfortunately <pkg>_SOURCE only allows to pass one tarball name.
However, we really want both tarballs to be known by the package infrastructure, so that the normal 'source' and 'external-deps' mechanism work fine.
In order to achieve this, we add a <pkg>_EXTRA_DOWNLOADS variable, which allows a package to list other stuff it would like to see downloaded, but that are otherwise not used by the package infrastructure itself: it is up to the package to do it by itself.
--- docs/manual/adding-packages-generic.txt | 6 ++++++ package/pkg-generic.mk | 4 ++++ 2 files changed, 10 insertions(+)
docs/manual/adding-packages-generic.txt +6 -0
@@ -248,6 +248,12 @@ information is (assuming the package name is +libfoo+) : +LIBFOO_SITE=/opt/software/libfoo.tar.gz+ + +LIBFOO_SITE=$(TOPDIR)/../src/libfoo/+ +* +LIBFOO_EXTRA_DOWNLOADS+ lists a number of additional files that + Buildroot should download from +LIBFOO_SITE+ in addition to the main + +LIBFOO_SOURCE+ (which usually is a tarball). Buildroot will not do + anything with those additional files, except download files: it will + be up to the package recipe to use them from +$(DL_DIR)+. + * +LIBFOO_SITE_METHOD+ determines the method used to fetch or copy the package source code. In many cases, Buildroot guesses the method from the contents of +LIBFOO_SITE+ and setting +LIBFOO_SITE_METHOD+
package/pkg-generic.mk +4 -0
@@ -40,6 +40,7 @@ ifeq ($(DL_MODE),DOWNLOAD) fi endif $(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$($(PKG)_SOURCE))) + $(foreach p,$($(PKG)_EXTRA_DOWNLOADS),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$(p))$(sep)) $(foreach p,$($(PKG)_PATCH),\ $(if $(findstring ://,$(p)),\ $(call DOWNLOAD,$(p)),\
@@ -426,6 +427,9 @@ $(1)-external-deps: ifneq ($$($(2)_SOURCE),) @echo $$($(2)_SOURCE) endif +ifneq ($$($(2)_EXTRA_DOWNLOADS),) + @echo $$($(2)_EXTRA_DOWNLOADS) +endif $(1)-all-external-deps: $(foreach p,$($(2)_DEPENDENCIES),$(p)-all-external-deps) $(1)-external-deps
Signature · 1 line
1.8.1.2
PATCH v2 11/21 toolchain-external: convert to the package infrastructure
In reply to Thomas PetazzoniThis commit converts the 'toolchain-external' logic to the package infrastructure.
The TOOLCHAIN_EXTERNAL_DIR variable (which points to where the toolchain is located) is renamed to TOOLCHAIN_EXTERNAL_INSTALL_DIR, because the former conflicts with the package infrastructure (which defines the <pkg>_DIR variable for each package as pointing to its build directory).
The new _EXTRA_DOWNLOADS mechanism is used for Blackfin toolchains.
The extract, configuration and installation steps are converted inside the <pkg>_EXTRACT_CMDS, <pkg>_CONFIGURE_CMDS and <pkg>_INSTALL_STAGING_CMDS.
---
.../{ext-tool.mk => toolchain-external.mk} | 154 +++++++++------------
1 file changed, 69 insertions(+), 85 deletions(-)
rename toolchain/toolchain-external/{ext-tool.mk => toolchain-external.mk} (86%)toolchain/toolchain-external/toolchain-external.mk renamed from toolchain/toolchain-external/ext-tool.mk +69 -85
@@ -1,5 +1,11 @@ +################################################################################ # -# This file implements the support for external toolchains, i.e +# toolchain-external +# +################################################################################ + +# +# This package implements the support for external toolchains, i.e # toolchains that have not been produced by Buildroot itself and that # Buildroot can download from the Web or that are already available on # the system on which Buildroot runs. So far, we have tested this
@@ -14,7 +20,7 @@ # The basic principle is the following # # 1. If the toolchain is not pre-installed, download and extract it -# in $(TOOLCHAIN_EXTERNAL_DIR). +# in $(TOOLCHAIN_EXTERNAL_INSTALL_DIR). # # 2. For all external toolchains, perform some checks on the # conformity between the toolchain configuration described in the
@@ -105,21 +111,21 @@ endif # ! no threads TOOLCHAIN_EXTERNAL_PREFIX=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX)) ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y) -TOOLCHAIN_EXTERNAL_DIR=$(HOST_DIR)/opt/ext-toolchain +TOOLCHAIN_EXTERNAL_INSTALL_DIR=$(HOST_DIR)/opt/ext-toolchain else -TOOLCHAIN_EXTERNAL_DIR=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH)) +TOOLCHAIN_EXTERNAL_INSTALL_DIR=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH)) endif -ifeq ($(TOOLCHAIN_EXTERNAL_DIR),) +ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),) ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),) # if no path set, figure it out from path TOOLCHAIN_EXTERNAL_BIN := $(shell dirname $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)) endif else ifeq ($(BR2_bfin),y) -TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_DIR)/$(TOOLCHAIN_EXTERNAL_PREFIX)/bin +TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/$(TOOLCHAIN_EXTERNAL_PREFIX)/bin else -TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_DIR)/bin +TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin endif endif
@@ -203,10 +209,6 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1 endif -ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y) -TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(TOOLCHAIN_EXTERNAL_DIR)/.extracted -endif - ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/ TOOLCHAIN_EXTERNAL_SOURCE = arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
@@ -220,15 +222,15 @@ else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109),y) TOOLCHAIN_EXTERNAL_SITE = http://software-dl.ti.com/sdoemb/sdoemb_public_sw/arago_toolchain/2011_09/exports/ TOOLCHAIN_EXTERNAL_SOURCE = arago-2011.09-armv7a-linux-gnueabi-sdk.tar.bz2 define TOOLCHAIN_EXTERNAL_FIXUP_CMDS - mv $(@D)/arago-2011.09/armv7a/* $(@D)/ - rm -rf $(@D)/arago-2011.09/ + mv $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/arago-2011.09/armv7a/* $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/ + rm -rf $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/arago-2011.09/ endef else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109),y) TOOLCHAIN_EXTERNAL_SITE = http://software-dl.ti.com/sdoemb/sdoemb_public_sw/arago_toolchain/2011_09/exports/ TOOLCHAIN_EXTERNAL_SOURCE = arago-2011.09-armv5te-linux-gnueabi-sdk.tar.bz2 define TOOLCHAIN_EXTERNAL_FIXUP_CMDS - mv $(@D)/arago-2011.09/armv5te/* $(@D)/ - rm -rf $(@D)/arago-2011.09/ + mv $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/arago-2011.09/armv5te/* $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/ + rm -rf $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/arago-2011.09/ endef else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06),y) TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/13.06/components/toolchain/binaries/
@@ -282,17 +284,13 @@ else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209),y) TOOLCHAIN_EXTERNAL_SITE = https://sourcery.mentor.com/public/gnu_toolchain/i686-pc-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = ia32-2012.09-62-i686-pc-linux-gnu-i386-linux.tar.bz2 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1),y) -TOOLCHAIN_EXTERNAL_SITE_1 = http://blackfin.uclinux.org/gf/download/frsrelease/559/9858/ -TOOLCHAIN_EXTERNAL_SOURCE_1 = blackfin-toolchain-2012R1-RC2.i386.tar.bz2 -TOOLCHAIN_EXTERNAL_SITE_2 = http://blackfin.uclinux.org/gf/download/frsrelease/559/9866/ -TOOLCHAIN_EXTERNAL_SOURCE_2 = blackfin-toolchain-uclibc-full-2012R1-RC2.i386.tar.bz2 -TOOLCHAIN_EXTERNAL_SOURCE = $(TOOLCHAIN_EXTERNAL_SOURCE_1) $(TOOLCHAIN_EXTERNAL_SOURCE_2) +TOOLCHAIN_EXTERNAL_SITE = http://downloads.sourceforge.net/projects/adi-toolchain/files/2012R1-BF60X/2012R1-RC2-BF60X/i386/ +TOOLCHAIN_EXTERNAL_SOURCE = blackfin-toolchain-2012R1-RC2.i386.tar.bz2 +TOOLCHAIN_EXTERNAL_EXTRA_DOWNLOADS = blackfin-toolchain-uclibc-full-2012R1-RC2.i386.tar.bz2 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2),y) -TOOLCHAIN_EXTERNAL_SITE_1 = http://blackfin.uclinux.org/gf/download/frsrelease/588/10139/ -TOOLCHAIN_EXTERNAL_SOURCE_1 = blackfin-toolchain-2012R2-RC2.i386.tar.bz2 -TOOLCHAIN_EXTERNAL_SITE_2 = http://blackfin.uclinux.org/gf/download/frsrelease/588/10147/ -TOOLCHAIN_EXTERNAL_SOURCE_2 = blackfin-toolchain-uclibc-full-2012R2-RC2.i386.tar.bz2 -TOOLCHAIN_EXTERNAL_SOURCE = $(TOOLCHAIN_EXTERNAL_SOURCE_1) $(TOOLCHAIN_EXTERNAL_SOURCE_2) +TOOLCHAIN_EXTERNAL_SITE = http://downloads.sourceforge.net/project/adi-toolchain/2012R2/2012R2-RC2/i386/ +TOOLCHAIN_EXTERNAL_SOURCE = blackfin-toolchain-2012R2-RC2.i386.tar.bz2 +TOOLCHAIN_EXTERNAL_EXTRA_DOWNLOADS = blackfin-toolchain-uclibc-full-2012R2-RC2.i386.tar.bz2 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_14_3),y) TOOLCHAIN_EXTERNAL_SITE = http://sources.buildroot.net/ TOOLCHAIN_EXTERNAL_SOURCE = lin32-microblazeel-unknown-linux-gnu_14.3_early.tar.xz
@@ -318,53 +316,38 @@ else # Custom toolchain TOOLCHAIN_EXTERNAL_SITE = $(dir $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_URL))) TOOLCHAIN_EXTERNAL_SOURCE = $(notdir $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_URL))) - -# A value must be set (even if unused), otherwise the -# $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main -# $(DL_DIR) rule -ifeq (,$(TOOLCHAIN_EXTERNAL_SOURCE)) -TOOLCHAIN_EXTERNAL_SOURCE = none -endif endif +TOOLCHAIN_EXTERNAL_INSTALL_STAGING = YES + +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1)$(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2),y) # Special handling for Blackfin toolchain, because of the split in two # tarballs, and the organization of tarball contents. The tarballs # contain ./opt/uClinux/{bfin-uclinux,bfin-linux-uclibc} directories, # which themselves contain the toolchain. This is why we strip more # components than usual. -ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1)$(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2),y) -$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1): - $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1:/=)/$(TOOLCHAIN_EXTERNAL_SOURCE_1)) - -$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2): - $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2:/=)/$(TOOLCHAIN_EXTERNAL_SOURCE_2)) - -$(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2) - mkdir -p $(@D) - $(call suitable-extractor,$(TOOLCHAIN_EXTERNAL_SOURCE_1)) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) | \ - $(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) - - $(call suitable-extractor,$(TOOLCHAIN_EXTERNAL_SOURCE_2)) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2) | \ - $(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) - - $(Q)touch $@ -else -# Download and extraction of a toolchain -$(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE): - $(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE)$(TOOLCHAIN_EXTERNAL_SOURCE),$(TOOLCHAIN_EXTERNAL_SOURCE)) - -$(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) - mkdir -p $(@D) - $(call suitable-extractor,$(TOOLCHAIN_EXTERNAL_SOURCE)) $^ | \ - $(TAR) $(TAR_STRIP_COMPONENTS)=1 --exclude='usr/lib/locale/*' -C $(@D) $(TAR_OPTIONS) - +define TOOLCHAIN_EXTERNAL_EXTRACT_CMDS + mkdir -p $(TOOLCHAIN_EXTERNAL_INSTALL_DIR) + $(call suitable-extractor,$(TOOLCHAIN_EXTERNAL_SOURCE)) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) | \ + $(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(TOOLCHAIN_EXTERNAL_INSTALL_DIR) $(TAR_OPTIONS) - + $(call suitable-extractor,$(TOOLCHAIN_EXTERNAL_EXTRA_DOWNLOADS)) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_EXTRA_DOWNLOADS) | \ + $(TAR) $(TAR_STRIP_COMPONENTS)=3 --hard-dereference -C $(TOOLCHAIN_EXTERNAL_INSTALL_DIR) $(TAR_OPTIONS) - +endef +else ifneq ($(TOOLCHAIN_EXTERNAL_SOURCE),) +# Normal handling of toolchain tarball extraction. +define TOOLCHAIN_EXTERNAL_EXTRACT_CMDS + mkdir -p $(TOOLCHAIN_EXTERNAL_INSTALL_DIR) + $(call suitable-extractor,$(TOOLCHAIN_EXTERNAL_SOURCE)) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) | \ + $(TAR) $(TAR_STRIP_COMPONENTS)=1 --exclude='usr/lib/locale/*' -C $(TOOLCHAIN_EXTERNAL_INSTALL_DIR) $(TAR_OPTIONS) - $(TOOLCHAIN_EXTERNAL_FIXUP_CMDS) - $(Q)touch $@ +endef endif # 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: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES) - @$(call MESSAGE,"Checking external toolchain settings") +define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC)) $(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \ SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
@@ -385,7 +368,7 @@ $(STAMP_DIR)/ext-toolchain-checked: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES) else \ $(call check_glibc,$${SYSROOT_DIR}) ; \ fi - $(Q)touch $@ +endef # Integration of the toolchain into Buildroot: find the main sysroot # and the variant-specific sysroot, then copy the needed libraries to
@@ -435,7 +418,7 @@ $(STAMP_DIR)/ext-toolchain-checked: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES) # considered when searching libraries for copy # to the target filesystem. -$(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked +define TOOLCHAIN_EXTERNAL_INSTALL_CORE $(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \ SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \ if test -z "$${SYSROOT_DIR}" ; then \
@@ -478,14 +461,15 @@ $(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked echo "Could not find gdbserver in external toolchain" ; \ exit 1 ; \ fi ; \ - fi ; \ - touch $@ + fi +endef # Special installation target used on the Blackfin architecture when # FDPIC is not the primary binary format being used, but the user has # nonetheless requested the installation of the FDPIC libraries to the # target filesystem. -$(STAMP_DIR)/ext-toolchain-bfin-fdpic-shared-installed: $(STAMP_DIR)/ext-toolchain-checked +ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) +define TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC $(Q)$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \ FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \ FDPIC_LIBC_A_LOCATION=`readlink -f $$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
@@ -503,8 +487,9 @@ $(STAMP_DIR)/ext-toolchain-bfin-fdpic-shared-installed: $(STAMP_DIR)/ext-toolcha done ; \ for libs in $(USR_LIB_EXTERNAL_LIBS); do \ $(call copy_toolchain_lib_root,$${FDPIC_SYSROOT_DIR},$${FDPIC_SUPPORT_LIB_DIR},$${FDPIC_LIB_DIR},$$libs,/usr/lib); \ - done ; \ - touch $@ + done +endef +endif # Special installation target used on the Blackfin architecture when # shared FLAT is not the primary format being used, but the user has
@@ -512,36 +497,28 @@ $(STAMP_DIR)/ext-toolchain-bfin-fdpic-shared-installed: $(STAMP_DIR)/ext-toolcha # to the target filesystem. The flat libraries are found and linked # according to the index in name "libN.so". Index 1 is reserved for # the standard C library. Customer libraries can use 4 and above. -$(STAMP_DIR)/ext-toolchain-bfin-shared-flat-installed: $(STAMP_DIR)/ext-toolchain-checked +ifeq ($(BR2_BFIN_INSTALL_FLAT_SHARED),y) +define TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FLAT $(Q)$(call MESSAGE,"Install external toolchain FLAT libraries to target...") ; \ FLAT_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))../../bfin-uclinux/bin/bfin-uclinux-gcc ; \ FLAT_LIBC_A_LOCATION=`$${FLAT_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -mid-shared-library -print-file-name=libc`; \ if [ -f $${FLAT_LIBC_A_LOCATION} -a ! -h $${FLAT_LIBC_A_LOCATION} ] ; then \ $(INSTALL) -D $${FLAT_LIBC_A_LOCATION} $(TARGET_DIR)/lib/lib1.so; \ - fi ; \ - touch $@ - -TOOLCHAIN_EXTERNAL_INSTALL = $(STAMP_DIR)/ext-toolchain-installed - -ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) -TOOLCHAIN_EXTERNAL_INSTALL += $(STAMP_DIR)/ext-toolchain-bfin-fdpic-shared-installed -endif - -ifeq ($(BR2_BFIN_INSTALL_FLAT_SHARED),y) -TOOLCHAIN_EXTERNAL_INSTALL += $(STAMP_DIR)/ext-toolchain-bfin-shared-flat-installed + fi +endef endif # Build toolchain wrapper for preprocessor, C and C++ compiler and setup # symlinks for everything else. Skip gdb symlink when we are building our # own gdb to prevent two gdb's in output/host/usr/bin. -$(HOST_DIR)/usr/bin/ext-toolchain-wrapper: $(TOOLCHAIN_EXTERNAL_INSTALL) +define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER $(Q)$(call MESSAGE,"Building ext-toolchain wrapper") mkdir -p $(HOST_DIR)/usr/bin; cd $(HOST_DIR)/usr/bin; \ for i in $(TOOLCHAIN_EXTERNAL_CROSS)*; do \ base=$${i##*/}; \ case "$$base" in \ *cc|*cc-*|*++|*++-*|*cpp) \ - ln -sf $(@F) $$base; \ + ln -sf ext-toolchain-wrapper $$base; \ ;; \ *gdb|*gdbtui) \ if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
@@ -556,11 +533,18 @@ $(HOST_DIR)/usr/bin/ext-toolchain-wrapper: $(TOOLCHAIN_EXTERNAL_INSTALL) # We use --hash-style=both to increase the compatibility of # the generated binary with older platforms $(HOSTCC) $(HOST_CFLAGS) $(TOOLCHAIN_EXTERNAL_WRAPPER_ARGS) -s -Wl,--hash-style=both \ - toolchain/toolchain-external/ext-toolchain-wrapper.c -o $@ + toolchain/toolchain-external/ext-toolchain-wrapper.c \ + -o $(HOST_DIR)/usr/bin/ext-toolchain-wrapper +endef -toolchain-external: dependencies $(HOST_DIR)/usr/bin/ext-toolchain-wrapper +# Even though we're installing things in both the staging, the host +# and the target directory, we do everything within the +# install-staging step, arbitrarily. +define TOOLCHAIN_EXTERNAL_INSTALL_STAGING_CMDS + $(TOOLCHAIN_EXTERNAL_INSTALL_CORE) + $(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC) + $(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FLAT) + $(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER) +endef -ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y) -# download ext toolchain if so configured -toolchain-external-source: $(addprefix $(DL_DIR)/,$(TOOLCHAIN_EXTERNAL_SOURCE)) -endif +$(eval $(generic-package))
Signature · 1 line
1.8.1.2
PATCH v2 12/21 dependencies: remove useless targets
In reply to Thomas PetazzoniThe dependencies-source, dependencies-clean and dependencies-dirclean targets are not needed, as long as 'dependencies' is not used in the <pkg>_DEPENDENCIES of a package.
--- support/dependencies/dependencies.mk | 8 -------- 1 file changed, 8 deletions(-)
support/dependencies/dependencies.mk +0 -8
@@ -33,14 +33,6 @@ dependencies: HOSTCC=$(HOSTCC_NOCCACHE) dependencies: HOSTCXX=$(HOSTCXX_NOCCACHE) dependencies: core-dependencies $(DEPENDENCIES_HOST_PREREQ) -dependencies-source: - -dependencies-clean: - rm -f $(SSTRIP_TARGET) - -dependencies-dirclean: - true - ################################################################################ # # Toplevel Makefile options
Signature · 1 line
1.8.1.2
PATCH v2 13/21 toolchain-external: conditionalize the installation of libraries
In reply to Thomas PetazzoniThe external toolchain code makes the assumption that all C libraries have a ld*.so, libc.so, libcrypt.so, libdl.so, libgcc_s.so, libm.so, libnsl.so, libresolv.so, libutil.so, and when thread support is enabled, libpthread.so, etc.
However, this is not the case with the musl C library, which integrates all the functionalities in a single libc.so file. In preparation of the support of the musl library, we make the current value of LIB_EXTERNAL_LIBS conditional to glibc or uClibc.
The addition of additional libraries through BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS is kept outside the condition, at the end.
--- toolchain/toolchain-external/toolchain-external.mk | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
toolchain/toolchain-external/toolchain-external.mk +11 -8
@@ -54,8 +54,16 @@ # $(HOST_DIR)/usr/bin like for the internal toolchains, and the rest # of Buildroot is handled identical for the 2 toolchain types. -LIB_EXTERNAL_LIBS=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so -LIB_EXTERNAL_LIBS+=$(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS)) +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) +LIB_EXTERNAL_LIBS+=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) +LIB_EXTERNAL_LIBS+=libpthread.so +ifneq ($(BR2_PACKAGE_GDB_SERVER)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),) +LIB_EXTERNAL_LIBS+=libthread_db.so +endif # gdbserver +endif # ! no threads +endif + ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC),y) LIB_EXTERNAL_LIBS+=libnss_files.so libnss_dns.so endif
@@ -64,12 +72,7 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y) USR_LIB_EXTERNAL_LIBS+=libstdc++.so endif -ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) -LIB_EXTERNAL_LIBS+=libpthread.so -ifneq ($(BR2_PACKAGE_GDB_SERVER)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),) -LIB_EXTERNAL_LIBS+=libthread_db.so -endif # gdbserver -endif # ! no threads +LIB_EXTERNAL_LIBS+=$(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS)) # Details about sysroot directory selection. #
Signature · 1 line
1.8.1.2
PATCH v2 14/21 toolchain-external: modify the wildcard logic for shared libraries copying
In reply to Thomas PetazzoniUntil now, the copy_toolchain_lib_root function took as argument the base name of a library (e.g: libm.so), and was assuming that the usual scheme libm.so.<x> being a symbolic link to the real library was used.
However, with musl based toolchains, the C library is named libc.so directly, with no symbolic link at all. Therefore, this commit changes the copy_toolchain_lib_root to move the responsibility of using a wildcard or not after the library name the caller's responsibility.
So, all the existing LIB_EXTERNAL_LIBS values are modified to have a .* at the end, so that the behavior is effectively unchanged.
--- toolchain/toolchain-external/helpers.mk | 2 +- toolchain/toolchain-external/toolchain-external.mk | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
toolchain/toolchain-external/helpers.mk +1 -1
@@ -54,7 +54,7 @@ copy_toolchain_lib_root = \ $${ARCH_SYSROOT_DIR}/$${ARCH_LIB_DIR} \ $${ARCH_SYSROOT_DIR}/usr/$${ARCH_LIB_DIR} \ $${SUPPORT_LIB_DIR} ; do \ - LIBSPATH=`find $${dir} -maxdepth 1 -name "$${LIB}.*" 2>/dev/null` ; \ + LIBSPATH=`find $${dir} -maxdepth 1 -name "$${LIB}" 2>/dev/null` ; \ if test -n "$${LIBSPATH}" ; then \ break ; \ fi \
toolchain/toolchain-external/toolchain-external.mk +5 -5
@@ -55,21 +55,21 @@ # of Buildroot is handled identical for the 2 toolchain types. ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) -LIB_EXTERNAL_LIBS+=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so +LIB_EXTERNAL_LIBS+=ld*.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.* ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) -LIB_EXTERNAL_LIBS+=libpthread.so +LIB_EXTERNAL_LIBS+=libpthread.so.* ifneq ($(BR2_PACKAGE_GDB_SERVER)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),) -LIB_EXTERNAL_LIBS+=libthread_db.so +LIB_EXTERNAL_LIBS+=libthread_db.so.* endif # gdbserver endif # ! no threads endif ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC),y) -LIB_EXTERNAL_LIBS+=libnss_files.so libnss_dns.so +LIB_EXTERNAL_LIBS+=libnss_files.so.* libnss_dns.so.* endif ifeq ($(BR2_INSTALL_LIBSTDCPP),y) -USR_LIB_EXTERNAL_LIBS+=libstdc++.so +USR_LIB_EXTERNAL_LIBS+=libstdc++.so.* endif LIB_EXTERNAL_LIBS+=$(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS))
Signature · 1 line
1.8.1.2
PATCH v2 15/21 toolchain-external: add support for musl C library
In reply to Thomas PetazzoniThis commit adds support for external toolchains based on the musl C library, as available from http://www.musl-libc.org.
Note that the pre-built musl toolchains available from
http://musl.codu.org/ are not working for the moment, since they lack sysroot support. However, this problem has been reported to the maintainer, who has already added sysroot support in his scripts at
https://bitbucket.org/GregorR/musl-cross, and therefore the next version of the pre-built toolchains should work with Buildroot out-of-the-box. In the mean time, the musl-cross script must be used to build the toolchain.
--- toolchain/Config.in | 9 +++++++++ toolchain/toolchain-external/Config.in | 12 ++++++++++++ toolchain/toolchain-external/helpers.mk | 11 +++++++++++ toolchain/toolchain-external/toolchain-external.mk | 18 +++++++++++++++++- 4 files changed, 49 insertions(+), 1 deletion(-)
toolchain/Config.in +9 -0
@@ -15,6 +15,15 @@ config BR2_TOOLCHAIN_USES_GLIBC config BR2_TOOLCHAIN_USES_UCLIBC bool +config BR2_TOOLCHAIN_USES_MUSL + bool + select BR2_LARGEFILE + select BR2_INET_IPV6 + select BR2_USE_WCHAR + select BR2_ENABLE_LOCALE + select BR2_TOOLCHAIN_HAS_THREADS + select BR2_TOOLCHAIN_HAS_THREADS_DEBUG + choice prompt "Toolchain type" help
toolchain/toolchain-external/Config.in +12 -0
@@ -860,6 +860,10 @@ config BR2_TOOLCHAIN_EXTERNAL_UCLIBC bool select BR2_TOOLCHAIN_USES_UCLIBC +config BR2_TOOLCHAIN_EXTERNAL_MUSL + bool + select BR2_TOOLCHAIN_USES_MUSL + if BR2_TOOLCHAIN_EXTERNAL_CUSTOM choice
@@ -882,6 +886,13 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC eglibc configured to exclude key features may cause build failures to some packages. +config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL + bool "musl" + select BR2_TOOLCHAIN_EXTERNAL_MUSL + help + Select this option if your external toolchain uses the + 'musl' C library, available from http://www.musl-libc.org/. + endchoice if BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
@@ -952,6 +963,7 @@ endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC config BR2_TOOLCHAIN_EXTERNAL_INET_RPC bool "Toolchain has RPC support?" select BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_EXTERNAL_MUSL default y if BR2_TOOLCHAIN_EXTERNAL_GLIBC help Select this option if your external toolchain supports
toolchain/toolchain-external/helpers.mk +11 -0
@@ -212,6 +212,17 @@ check_glibc = \ $(call check_glibc_rpc_feature,$${SYSROOT_DIR}) # +# Check that the selected C library is really musl +# +# $1: sysroot directory +check_musl = \ + SYSROOT_DIR="$(strip $1)"; \ + if test ! -f $${SYSROOT_DIR}/lib/libc.so -o -e $${SYSROOT_DIR}/lib/libm.so ; then \ + echo "Incorrect selection of the C library" ; \ + exit -1; \ + fi + +# # Check the conformity of Buildroot configuration with regard to the # uClibc configuration of the external toolchain, for a particular # feature.
toolchain/toolchain-external/toolchain-external.mk +17 -1
@@ -68,6 +68,10 @@ ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC),y) LIB_EXTERNAL_LIBS+=libnss_files.so.* libnss_dns.so.* endif +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y) +LIB_EXTERNAL_LIBS += libc.so libgcc_s.so.* +endif + ifeq ($(BR2_INSTALL_LIBSTDCPP),y) USR_LIB_EXTERNAL_LIBS+=libstdc++.so.* endif
@@ -353,7 +357,7 @@ endif define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC)) $(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \ - SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \ + SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:(usr/)?lib(32|64)?/(.*/)?libc\.a::'` ; \ if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \
@@ -368,11 +372,23 @@ define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS fi ; \ if test "$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC)" = "y" ; then \ $(call check_uclibc,$${SYSROOT_DIR}) ; \ + elif test "$(BR2_TOOLCHAIN_EXTERNAL_MUSL)" = "y" ; then \ + $(call check_musl,$${SYSROOT_DIR}) ; \ else \ $(call check_glibc,$${SYSROOT_DIR}) ; \ fi endef +# With the musl C library, the libc.so library directly plays the role +# of the dynamic library loader. We just need to create a symbolic +# link to libc.so with the appropriate name. +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y) +define TOOLCHAIN_EXTERNAL_MUSL_LD_LINK + ln -sf libc.so $(TARGET_DIR)/lib/ld-musl-$(ARCH).so.1 +endef +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_MUSL_LD_LINK +endif + # 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)
Signature · 1 line
1.8.1.2
PATCH v2 16/21 toolchain-external: improve help text of some options
In reply to Thomas Petazzoni--- toolchain/toolchain-external/Config.in | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
toolchain/toolchain-external/Config.in +11 -4
@@ -876,15 +876,22 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC # For the time being, we assume that all custom external # toolchains have shadow password support. select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS + help + Select this option if your external toolchain uses the + uClibc C library (available from http://www.uclibc.org/). config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC bool "glibc/eglibc" select BR2_TOOLCHAIN_EXTERNAL_GLIBC help - Note: eglibc is a variant of glibc that (among other things) can be - configured to exclude some of its features. Using a toolchain with - eglibc configured to exclude key features may cause build failures to - some packages. + Select this option if your external toolchain uses the GNU C + library (available from https://www.gnu.org/software/libc/) + or its variant the eglibc library (http://www.eglibc.org/). + + Note: eglibc is a variant of glibc that (among other things) + can be configured to exclude some of its features. Using a + toolchain with eglibc configured to exclude key features may + cause build failures to some packages. config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL bool "musl"
Signature · 1 line
1.8.1.2
PATCH v2 17/21 busybox: add patches to fix build with the musl C library
In reply to Thomas PetazzoniThose patches have been submitted upstream.
--- ...01-libbb-use-poll.h-instead-of-sys-poll.h.patch | 32 +++++++++++++++++++ ...onfig-include-linux-if_slip.h-instead-of-.patch | 33 ++++++++++++++++++++ ...libiproute-use-linux-if_packet.h-instead-.patch | 36 ++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 package/busybox/1.21.1/0001-libbb-use-poll.h-instead-of-sys-poll.h.patch create mode 100644 package/busybox/1.21.1/0002-network-ifconfig-include-linux-if_slip.h-instead-of-.patch create mode 100644 package/busybox/1.21.1/0003-networking-libiproute-use-linux-if_packet.h-instead-.patch
package/busybox/1.21.1/0001-libbb-use-poll.h-instead-of-sys-poll.h.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 676452a92d1fc4f85e8d89930d7729197c031026 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni <[email protected]> +Date: Sat, 5 Oct 2013 15:51:56 +0200 +Subject: [PATCH 1/3] libbb: use <poll.h> instead of <sys/poll.h> + +As the pol() manpage recommends, include the <poll.h> header instead +of <sys/poll.h>. This allows to get rid of gazillions of warnings when +building Busybox against the musl C library, which prints a warning +when the internal header <sys/poll.h> is included directly instead of +the <poll.h> header. + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + include/libbb.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/libbb.h b/include/libbb.h +index e520060..f03f454 100644 +--- a/include/libbb.h ++++ b/include/libbb.h +@@ -37,7 +37,7 @@ + #include <libgen.h> /* dirname,basename */ + #undef basename + #define basename dont_use_basename +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/ioctl.h> + #include <sys/mman.h> + #include <sys/socket.h> +-- +1.8.1.2 +
package/busybox/1.21.1/0002-network-ifconfig-include-linux-if_slip.h-instead-of-.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 5eae213031a3ef88fe8d9d0a387f44264ea635cc Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni <[email protected]> +Date: Sat, 5 Oct 2013 15:53:16 +0200 +Subject: [PATCH 2/3] network/ifconfig: include <linux/if_slip.h> instead of + <net/if_slip.h> + +The musl C library doesn't provide the <net/if_slip.h> since userspace +applications can just as well use the <linux/if_slip.h> kernel header. + +This commit fixes the build of the ifconfig applet with the musl C +library. + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + networking/ifconfig.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/networking/ifconfig.c b/networking/ifconfig.c +index 782374b..c90ed6b 100644 +--- a/networking/ifconfig.c ++++ b/networking/ifconfig.c +@@ -56,7 +56,7 @@ + #endif + + #if ENABLE_FEATURE_IFCONFIG_SLIP +-# include <net/if_slip.h> ++# include <linux/if_slip.h> + #endif + + /* I don't know if this is needed for busybox or not. Anyone? */ +-- +1.8.1.2 +
package/busybox/1.21.1/0003-networking-libiproute-use-linux-if_packet.h-instead-.patch new file +36 -0
@@ -0,0 +1,36 @@ +From d4fec31889ad660a58dab633c511221feb66e817 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni <[email protected]> +Date: Sat, 5 Oct 2013 15:55:06 +0200 +Subject: [PATCH 3/3] networking/libiproute: use <linux/if_packet.h> instead of + <net/if_packet.h> + +The musl C library doesn't provide the <net/if_packet.h> since the +corresponding kernel headers <linux/if_packet.h> already provides the +necessary definitions. Replacing <net/if_packet.h> by +<linux/if_packet.h> also removes the need to include +<netpacket/packet.h> + +This commit fixes the build of iplink with the musl C library. + +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + networking/libiproute/iplink.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c +index bad2017..32ccb1c 100644 +--- a/networking/libiproute/iplink.c ++++ b/networking/libiproute/iplink.c +@@ -5,8 +5,7 @@ + * Licensed under GPLv2 or later, see file LICENSE in this source tree. + */ + #include <net/if.h> +-#include <net/if_packet.h> +-#include <netpacket/packet.h> ++#include <linux/if_packet.h> + #include <netinet/if_ether.h> + + #include "ip_common.h" /* #include "libbb.h" is inside */ +-- +1.8.1.2 +
Signature · 1 line
1.8.1.2
PATCH v2 18/21 toolchain-external: update Linaro ARM toolchain
In reply to Thomas Petazzoni--- toolchain/toolchain-external/Config.in | 20 ++++++++++---------- toolchain/toolchain-external/toolchain-external.mk | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-)
toolchain/toolchain-external/Config.in +10 -10
@@ -3,8 +3,8 @@ if BR2_TOOLCHAIN_EXTERNAL choice prompt "Toolchain" -config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 - bool "Linaro 2013.08" +config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09 + bool "Linaro 2013.09" depends on BR2_arm depends on BR2_GCC_TARGET_ARCH = "armv7-a" depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
@@ -15,7 +15,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 select BR2_HOSTARCH_NEEDS_IA32_LIBS help Linaro toolchain for the ARM architecture. It uses Linaro - GCC 2013.08 (based on gcc 4.8), Linaro GDB 2013.05 (based on + GCC 2013.09 (based on gcc 4.8), Linaro GDB 2013.05 (based on GDB 7.6), eglibc 2.17, Binutils 2013.06 (based on 2.23). It generates code that runs on all Cortex-A profile devices, but tuned for the Cortex-A9. The code generated is Thumb 2,
@@ -24,8 +24,8 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 To use this toolchain, you must disable soft float usage. -config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 - bool "Linaro 2013.07" +config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 + bool "Linaro 2013.08" depends on BR2_arm depends on BR2_GCC_TARGET_ARCH = "armv7-a" depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
@@ -36,7 +36,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 select BR2_HOSTARCH_NEEDS_IA32_LIBS help Linaro toolchain for the ARM architecture. It uses Linaro - GCC 2013.07 (based on gcc 4.8), Linaro GDB 2013.05 (based on + GCC 2013.08 (based on gcc 4.8), Linaro GDB 2013.05 (based on GDB 7.6), eglibc 2.17, Binutils 2013.06 (based on 2.23). It generates code that runs on all Cortex-A profile devices, but tuned for the Cortex-A9. The code generated is Thumb 2,
@@ -45,8 +45,8 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 To use this toolchain, you must disable soft float usage. -config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06 - bool "Linaro 2013.06" +config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 + bool "Linaro 2013.07" depends on BR2_arm depends on BR2_GCC_TARGET_ARCH = "armv7-a" depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
@@ -57,7 +57,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06 select BR2_HOSTARCH_NEEDS_IA32_LIBS help Linaro toolchain for the ARM architecture. It uses Linaro - GCC 2013.06 (based on gcc 4.8), Linaro GDB 2013.05 (based on + GCC 2013.07 (based on gcc 4.8), Linaro GDB 2013.05 (based on GDB 7.6), eglibc 2.17, Binutils 2013.06 (based on 2.23). It generates code that runs on all Cortex-A profile devices, but tuned for the Cortex-A9. The code generated is Thumb 2,
@@ -816,9 +816,9 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX config BR2_TOOLCHAIN_EXTERNAL_PREFIX string + default "arm-linux-gnueabihf" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09 default "arm-linux-gnueabihf" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 default "arm-linux-gnueabihf" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 - default "arm-linux-gnueabihf" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06 default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109 default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203 default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305
toolchain/toolchain-external/toolchain-external.mk +3 -3
@@ -239,15 +239,15 @@ define TOOLCHAIN_EXTERNAL_FIXUP_CMDS mv $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/arago-2011.09/armv5te/* $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/ rm -rf $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/arago-2011.09/ endef -else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06),y) -TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/13.06/components/toolchain/binaries/ -TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux.tar.xz else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.07/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.07-1_linux.tar.xz else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.08/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux.tar.xz +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09),y) +TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.09/components/toolchain/binaries/ +TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux.tar.xz else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.03-63-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
Signature · 1 line
1.8.1.2
PATCH v2 19/21 toolchain-external: update Linaro AArch64 toolchain
In reply to Thomas Petazzoni--- toolchain/toolchain-external/Config.in | 14 +++++++------- toolchain/toolchain-external/toolchain-external.mk | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-)
toolchain/toolchain-external/Config.in +7 -7
@@ -730,8 +730,8 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2 Toolchain for the Microblaze architecture, from http://wiki.xilinx.com/mb-gnu-tools -config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_08 - bool "Linaro AArch64 13.08" +config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_09 + bool "Linaro AArch64 13.09" depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" select BR2_TOOLCHAIN_EXTERNAL_GLIBC
@@ -742,8 +742,8 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_08 Toolchain for the AArch64 architecture, from http://www.linaro.org/engineering/armv8/ -config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_07 - bool "Linaro AArch64 13.07" +config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_08 + bool "Linaro AArch64 13.08" depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" select BR2_TOOLCHAIN_EXTERNAL_GLIBC
@@ -754,8 +754,8 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_07 Toolchain for the AArch64 architecture, from http://www.linaro.org/engineering/armv8/ -config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_06 - bool "Linaro AArch64 13.04" +config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_07 + bool "Linaro AArch64 13.07" depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" select BR2_TOOLCHAIN_EXTERNAL_GLIBC
@@ -824,9 +824,9 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305 default "arm-arago-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109 default "arm-arago-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109 + default "aarch64-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_09 default "aarch64-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_08 default "aarch64-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_07 - default "aarch64-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_06 default "microblazeel-unknown-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_14_3 default "microblazeel-unknown-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_V2 default "microblaze-unknown-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_14_3
toolchain/toolchain-external/toolchain-external.mk +3 -3
@@ -310,15 +310,15 @@ TOOLCHAIN_EXTERNAL_SOURCE = lin32-microblaze-unknown-linux-gnu_14.3_early.tar.xz else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2),y) TOOLCHAIN_EXTERNAL_SITE = http://sources.buildroot.net/ TOOLCHAIN_EXTERNAL_SOURCE = microblaze-unknown-linux-gnu.tgz -else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_06),y) -TOOLCHAIN_EXTERNAL_SITE = https://releases.linaro.org/13.06/components/toolchain/binaries/ -TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.06_linux.tar.xz else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_07),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.07/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.07-1_linux.tar.xz else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_08),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.08/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.08_linux.tar.xz +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_09),y) +TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.09/components/toolchain/binaries/ +TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux.tar.xz else # Custom toolchain TOOLCHAIN_EXTERNAL_SITE = $(dir $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_URL)))
Signature · 1 line
1.8.1.2
PATCH v2 20/21 toolchain-external: improve target library copy logic
In reply to Thomas PetazzoniThe copy_toolchain_lib_root function is responsible for copying a given library (and its symbolic link) to the target filesystem. To do so, it looks for the library in various locations, and then iterates over the symbolic link all the way to the library, copying them as needed to the target filesystem.
However, the latest Linaro toolchains bring an interesting use case:
the lib/ directory in the toolchain is organized as follows:
- ld-linux.so.3 -> arm-linux-gnueabi/ld-2.17...so
- ld-linux-armhf.so.3 -> arm-linux-gnueabihf/ld-2.17...so
- arm-linux-gnueabi/
- all ARMv4T soft float libraries
- arm-linux-gnueabihf/
- all ARMv7 hard float libraries
In order to match what we do with all other toolchains, we want all those libraries and symbolic links to be copied directly under $(TARGET_DIR)/lib. This commit does that by adjusting the copy logic.
This is part of the fix for bug #6452 (eglibc from Linaro 2013.07 not copied to target correctly).
--- toolchain/toolchain-external/helpers.mk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
toolchain/toolchain-external/helpers.mk +10 -7
@@ -59,21 +59,24 @@ copy_toolchain_lib_root = \ break ; \ fi \ done ; \ + mkdir -p $(TARGET_DIR)/$${DESTDIR}; \ for LIBPATH in $${LIBSPATH} ; do \ - LIBNAME=`basename $${LIBPATH}`; \ - LIBDIR=`dirname $${LIBPATH}` ; \ - while test \! -z "$${LIBNAME}" ; do \ - LIBPATH=$${LIBDIR}/$${LIBNAME} ; \ + while true ; do \ + LIBNAME=`basename $${LIBPATH}`; \ + LIBDIR=`dirname $${LIBPATH}` ; \ + LINKTARGET=`readlink $${LIBPATH}` ; \ rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ - mkdir -p $(TARGET_DIR)/$${DESTDIR}; \ if test -h $${LIBPATH} ; then \ - cp -d $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/; \ + ln -sf `basename $${LINKTARGET}` $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME} ; \ elif test -f $${LIBPATH}; then \ $(INSTALL) -D -m0755 $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ else \ exit -1; \ fi; \ - LIBNAME="`readlink $${LIBPATH}`"; \ + if test -z "$${LINKTARGET}" ; then \ + break ; \ + fi ; \ + LIBPATH="`readlink -f $${LIBPATH}`"; \ done; \ done; \ \
Signature · 1 line
1.8.1.2
PATCH v2 21/21 toolchain-external: fix Linaro ARM toolchain support
In reply to Thomas PetazzoniThis commit fixes bug #6452 (eglibc from Linaro 2013.07 not copied to target correctly) by:
* Copying only the relevant library loader to the target on ARMhf (i.e ld-linux-armhf.so and not ld.so*). This is needed since Linaro toolchains provide two library loaders, one ARMv7 hf, and one ARMv4 soft-float.
* Making sure a $(TARGET_DIR)/lib/arm-linux-gnueabihf/ symbolic link to $(TARGET_DIR)/lib/ exists, since the dynamic loader of Linaro toolchains expects libraries to be found in $(TARGET_DIR)/lib/arm-linux-gnueabihf/.
--- toolchain/toolchain-external/toolchain-external.mk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
toolchain/toolchain-external/toolchain-external.mk +16 -1
@@ -55,7 +55,12 @@ # of Buildroot is handled identical for the 2 toolchain types. ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) -LIB_EXTERNAL_LIBS+=ld*.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.* +LIB_EXTERNAL_LIBS+=libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.* +ifeq ($(BR2_ARM_EABIHF),y) +LIB_EXTERNAL_LIBS+=ld-linux-armhf.so.* +else +LIB_EXTERNAL_LIBS+=ld*.so.* +endif ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) LIB_EXTERNAL_LIBS+=libpthread.so.* ifneq ($(BR2_PACKAGE_GDB_SERVER)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),)
@@ -216,6 +221,13 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1 endif +# The Linaro ARMhf toolchain expects the libraries in +# /lib/arm-linux-gnueabihf, but Buildroot copies them to /lib, so we +# need to create a symbolic link. +define TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK + ln -sf . $(TARGET_DIR)/lib/arm-linux-gnueabihf +endef + ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/ TOOLCHAIN_EXTERNAL_SOURCE = arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
@@ -242,12 +254,15 @@ endef else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.07/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.07-1_linux.tar.xz +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.08/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux.tar.xz +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/13.09/components/toolchain/binaries/ TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux.tar.xz +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.03-63-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
Signature · 1 line
1.8.1.2