* [Buildroot] [pull request] Pull request for branch for-2012.05/linaro
@ 2012-05-07 15:08 Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 1/2] external-toolchain: add support for recent Linaro toolchains Thomas Petazzoni
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2012-05-07 15:08 UTC (permalink / raw)
To: buildroot
The following changes since commit 025eb2fb908cb3c500e69225832b59b5ffb08cf5:
dnsmasq: bump to version 2.61 and enhance (2012-05-06 23:18:17 +0200)
are available in the git repository at:
git://git.free-electrons.com/users/thomas-petazzoni/buildroot.git for-2012.05/linaro
for you to fetch changes up to 057c729c2438107b426576121bcf83f792734a6f:
external-toolchain: add support for Linaro 2012.04 (2012-05-07 17:08:37 +0200)
----------------------------------------------------------------
Thomas Petazzoni (2):
external-toolchain: add support for recent Linaro toolchains
external-toolchain: add support for Linaro 2012.04
toolchain/helpers.mk | 73 ++++++++++++++++++++----------
toolchain/toolchain-external/Config.in | 15 ++++++
toolchain/toolchain-external/ext-tool.mk | 26 +++++++++--
3 files changed, 87 insertions(+), 27 deletions(-)
Thanks,
--
Thomas Petazzoni
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/2] external-toolchain: add support for recent Linaro toolchains
2012-05-07 15:08 [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Thomas Petazzoni
@ 2012-05-07 15:08 ` Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 2/2] external-toolchain: add support for Linaro 2012.04 Thomas Petazzoni
2012-05-07 15:39 ` [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2012-05-07 15:08 UTC (permalink / raw)
To: buildroot
Starting from 2012.03, the Linaro toolchains have separated the GCC
support libraries (libstdc++, libgcc_s) from the sysroot itself. So we
no longer have the case where all libraries are inside the sysroot, as
we had for all the previously supported toolchains.
Therefore, we add some logic to detect if such a separate directory is
used for GCC support libraries, and if it's the case, we make sure
that we take into account this directory when creating our own
sysroot, and when copying libraries to the target filesystem.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/helpers.mk | 73 ++++++++++++++++++++----------
toolchain/toolchain-external/ext-tool.mk | 23 ++++++++--
2 files changed, 69 insertions(+), 27 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index bb1ea90..649b91b 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -20,11 +20,16 @@
#
# usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR}
#
-# Finally, Linaro toolchains have the libraries in lib/<target-name>/,
-# so we need to search libraries in:
+# Linaro toolchains have most libraries in lib/<target-name>/, so we
+# need to search libraries in:
#
# $${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX)
#
+# And recent Linaro toolchains have the GCC support libraries
+# (libstdc++, libgcc_s, etc.) into a separate directory, outside of
+# the sysroot, that we called the "SUPPORT_LIB_DIR", into which we
+# need to search as well.
+#
# Thanks to ARCH_LIB_DIR we also take into account toolchains that
# have the libraries in lib64 and usr/lib64.
#
@@ -33,35 +38,44 @@
# modification on the below logic.
#
# $1: arch specific sysroot directory
-# $2: library directory ('lib' or 'lib64') from which libraries must be copied
-# $3: library name
-# $4: destination directory of the libary, relative to $(TARGET_DIR)
+# $2: support libraries directory (can be empty)
+# $3: library directory ('lib' or 'lib64') from which libraries must be copied
+# $4: library name
+# $5: destination directory of the libary, relative to $(TARGET_DIR)
#
copy_toolchain_lib_root = \
ARCH_SYSROOT_DIR="$(strip $1)"; \
- ARCH_LIB_DIR="$(strip $2)" ; \
- LIB="$(strip $3)"; \
- DESTDIR="$(strip $4)" ; \
+ SUPPORT_LIB_DIR="$(strip $2)" ; \
+ ARCH_LIB_DIR="$(strip $3)" ; \
+ LIB="$(strip $4)"; \
+ DESTDIR="$(strip $5)" ; \
\
- LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
- find -L $${ARCH_LIB_DIR} usr/$${ARCH_LIB_DIR} usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} $${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX) \
- -maxdepth 1 -name "$${LIB}.*" 2>/dev/null \
- )` ; \
- for FILE in $${LIBS} ; do \
- LIB=`basename $${FILE}`; \
- LIBDIR=`dirname $${FILE}` ; \
- while test \! -z "$${LIB}"; do \
- FULLPATH="$${ARCH_SYSROOT_DIR}/$${LIBDIR}/$${LIB}" ; \
- rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIB}; \
+ for dir in \
+ $${ARCH_SYSROOT_DIR}/$${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX) \
+ $${ARCH_SYSROOT_DIR}/usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} \
+ $${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` ; \
+ if test -n "$${LIBSPATH}" ; then \
+ break ; \
+ fi \
+ done ; \
+ for LIBPATH in $${LIBSPATH} ; do \
+ LIBNAME=`basename $${LIBPATH}`; \
+ LIBDIR=`dirname $${LIBPATH}` ; \
+ while test \! -z "$${LIBNAME}" ; do \
+ LIBPATH=$${LIBDIR}/$${LIBNAME} ; \
+ rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \
mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
- if test -h $${FULLPATH} ; then \
- cp -d $${FULLPATH} $(TARGET_DIR)/$${DESTDIR}/; \
- elif test -f $${FULLPATH}; then \
- $(INSTALL) -D -m0755 $${FULLPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIB}; \
+ if test -h $${LIBPATH} ; then \
+ cp -d $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/; \
+ elif test -f $${LIBPATH}; then \
+ $(INSTALL) -D -m0755 $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \
else \
exit -1; \
fi; \
- LIB="`readlink $${FULLPATH}`"; \
+ LIBNAME="`readlink $${LIBPATH}`"; \
done; \
done; \
\
@@ -100,6 +114,11 @@ copy_toolchain_lib_root = \
# non-default architecture variant is used. Without this, the
# compiler fails to find libraries and headers.
#
+# Some toolchains (i.e Linaro binary toolchains) store support
+# libraries (libstdc++, libgcc_s) outside of the sysroot, so we simply
+# copy all the libraries from the "support lib directory" into our
+# sysroot.
+#
# Note that the 'locale' directories are not copied. They are huge
# (400+MB) in CodeSourcery toolchains, and they are not really useful.
#
@@ -107,12 +126,15 @@ copy_toolchain_lib_root = \
# $2: arch specific sysroot directory of the toolchain
# $3: arch specific subdirectory in the sysroot
# $4: directory of libraries ('lib' or 'lib64')
-#
+# $5: support lib directories (for toolchains storing libgcc_s,
+# libstdc++ and other gcc support libraries outside of the
+# sysroot)
copy_toolchain_sysroot = \
SYSROOT_DIR="$(strip $1)"; \
ARCH_SYSROOT_DIR="$(strip $2)"; \
ARCH_SUBDIR="$(strip $3)"; \
ARCH_LIB_DIR="$(strip $4)" ; \
+ SUPPORT_LIB_DIR="$(strip $5)" ; \
for i in etc $${ARCH_LIB_DIR} sbin usr ; do \
if [ -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \
rsync -au --chmod=Du+w --exclude 'usr/lib/locale' $${ARCH_SYSROOT_DIR}/$$i $(STAGING_DIR)/ ; \
@@ -131,6 +153,9 @@ copy_toolchain_sysroot = \
ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \
echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \
fi ; \
+ if test -n "$${SUPPORT_LIB_DIR}" ; then \
+ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
+ fi ; \
find $(STAGING_DIR) -type d | xargs chmod 755
#
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index a45603a..2a01d68 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -359,6 +359,17 @@ $(STAMP_DIR)/ext-toolchain-checked: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
# ARCH_SUBDIR: the relative location of the sysroot of the selected
# multilib variant compared to the main sysroot.
# Ex: mips16/soft-float/el
+#
+# SUPPORT_LIB_DIR: some toolchains, such as recent Linaro toolchains,
+# store GCC support libraries (libstdc++,
+# libgcc_s, etc.) outside of the sysroot. In
+# this case, SUPPORT_LIB_DIR is set to a
+# non-empty value, and points to the directory
+# where these support libraries are
+# available. Those libraries will be copied to
+# our sysroot, and the directory will also be
+# considered when searching libraries for copy
+# to the target filesystem.
$(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked
$(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \
@@ -370,19 +381,25 @@ $(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked
ARCH_LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
ARCH_SYSROOT_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
ARCH_LIB_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \
+ if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
+ LIBSTDCPP_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a)` ; \
+ SUPPORT_LIB_DIR=`echo $${LIBSTDCPP_A_LOCATION} | sed -r -e 's:libstdc\+\+\.a::'` ; \
+ else \
+ SUPPORT_LIB_DIR="" ; \
+ fi ; \
ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
mkdir -p $(TARGET_DIR)/lib ; \
if test -z "$(BR2_PREFER_STATIC_LIB)" ; then \
echo "Copy external toolchain libraries to target..." ; \
for libs in $(LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$${ARCH_LIB_DIR},$$libs,/lib); \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$${SUPPORT_LIB_DIR},$${ARCH_LIB_DIR},$$libs,/lib); \
done ; \
for libs in $(USR_LIB_EXTERNAL_LIBS); do \
- $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$${ARCH_LIB_DIR},$$libs,/usr/lib); \
+ $(call copy_toolchain_lib_root,$${ARCH_SYSROOT_DIR},$${SUPPORT_LIB_DIR},$${ARCH_LIB_DIR},$$libs,/usr/lib); \
done ; \
fi ; \
echo "Copy external toolchain sysroot to staging..." ; \
- $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR}) ; \
+ $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR}) ; \
if [ -L $${ARCH_SYSROOT_DIR}/lib64 ] ; then \
$(call create_lib64_symlinks) ; \
fi ; \
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 2/2] external-toolchain: add support for Linaro 2012.04
2012-05-07 15:08 [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 1/2] external-toolchain: add support for recent Linaro toolchains Thomas Petazzoni
@ 2012-05-07 15:08 ` Thomas Petazzoni
2012-05-07 15:39 ` [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2012-05-07 15:08 UTC (permalink / raw)
To: buildroot
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-external/Config.in | 15 +++++++++++++++
toolchain/toolchain-external/ext-tool.mk | 3 +++
2 files changed, 18 insertions(+)
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 49ea7fa..f58523f 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -3,6 +3,20 @@ if BR2_TOOLCHAIN_EXTERNAL
choice
prompt "Toolchain"
+config BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_04
+ bool "Linaro 2012.04"
+ depends on BR2_arm
+ depends on BR2_cortex_a8 || BR2_cortex_a9
+ select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+ select BR2_INSTALL_LIBSTDCPP
+ help
+ Linaro toolchain for the ARM architecture. It uses Linaro
+ GCC 2012.04 (based on gcc 4.7), Linaro GDB 2012.04 (based on
+ GDB 7.4), eglibc 2.13. It generates code that runs on all
+ Cortex-A profile devices, but tuned for the Cortex-A9. The
+ code generated is Thumb 2, with the softfp calling
+ convention, and uses the VFPv3-D16 FPU instructions.
+
config BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_03
bool "Linaro 2012.03"
depends on BR2_arm
@@ -504,6 +518,7 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "arm-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_01
default "arm-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_02
default "arm-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_03
+ default "arm-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_04
default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q3
default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
default "arm-none-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 2a01d68..b163aee 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -200,6 +200,9 @@ TOOLCHAIN_EXTERNAL_SOURCE=gcc-linaro-arm-linux-gnueabi-2012.02-20120222_linux.ta
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_03),y)
TOOLCHAIN_EXTERNAL_SITE=http://launchpad.net/linaro-toolchain-binaries/trunk/2012.03/+download/
TOOLCHAIN_EXTERNAL_SOURCE=gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_2012_04),y)
+TOOLCHAIN_EXTERNAL_SITE=https://launchpad.net/linaro-toolchain-binaries/trunk/2012.04/+download/
+TOOLCHAIN_EXTERNAL_SOURCE=gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux.tar.bz2
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44),y)
TOOLCHAIN_EXTERNAL_SITE=http://sourcery.mentor.com/sgpp/lite/mips/portal/package7401/public/mips-linux-gnu/
TOOLCHAIN_EXTERNAL_SOURCE=mips-4.4-303-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [pull request] Pull request for branch for-2012.05/linaro
2012-05-07 15:08 [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 1/2] external-toolchain: add support for recent Linaro toolchains Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 2/2] external-toolchain: add support for Linaro 2012.04 Thomas Petazzoni
@ 2012-05-07 15:39 ` Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2012-05-07 15:39 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Thomas> The following changes since commit 025eb2fb908cb3c500e69225832b59b5ffb08cf5:
Thomas> dnsmasq: bump to version 2.61 and enhance (2012-05-06 23:18:17 +0200)
Thomas> are available in the git repository at:
Thomas> git://git.free-electrons.com/users/thomas-petazzoni/buildroot.git for-2012.05/linaro
Thomas> for you to fetch changes up to
Thomas> 057c729c2438107b426576121bcf83f792734a6f:
Pulled, thanks!
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-07 15:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 15:08 [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 1/2] external-toolchain: add support for recent Linaro toolchains Thomas Petazzoni
2012-05-07 15:08 ` [Buildroot] [PATCH 2/2] external-toolchain: add support for Linaro 2012.04 Thomas Petazzoni
2012-05-07 15:39 ` [Buildroot] [pull request] Pull request for branch for-2012.05/linaro Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox