* [Buildroot] [pull request] Pull request for branch for-2011.05/fix-ext-toolchain-support
@ 2011-05-08 16:52 Thomas Petazzoni
2011-05-08 16:52 ` [Buildroot] [PATCH 1/1] external-toolchain: fix support Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2011-05-08 16:52 UTC (permalink / raw)
To: buildroot
The following changes since commit e46ba3c65bb76de30e6534a5552db7562c354d3a:
Phil Edworthy (1):
sh: Only use the CodeSourcery toolchain for SH4A devices
are available in the git repository at:
http://free-electrons.com/~thomas/buildroot.git for-2011.05/fix-ext-toolchain-support
Thomas Petazzoni (1):
external-toolchain: fix support
toolchain/helpers.mk | 17 +++++++++++++----
toolchain/toolchain-external/ext-tool.mk | 7 ++++---
2 files changed, 17 insertions(+), 7 deletions(-)
Thanks,
--
Thomas Petazzoni
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/1] external-toolchain: fix support
2011-05-08 16:52 [Buildroot] [pull request] Pull request for branch for-2011.05/fix-ext-toolchain-support Thomas Petazzoni
@ 2011-05-08 16:52 ` Thomas Petazzoni
2011-05-08 19:59 ` Peter Korsgaard
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2011-05-08 16:52 UTC (permalink / raw)
To: buildroot
The recent commit adding the external toolchain wrapper has broken the
support for external toolchain. The check_arm_eabi, check_cplusplus
and check_cross_compiler_exists functions were using TARGET_CC, which
points to the toolchain wrapper, but at the moment those functions are
called, the wrapper hasn't been generated yet.
We fix this by passing to these functions the path to the C or C++
compiler they should use for their tests.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/helpers.mk | 17 +++++++++++++----
toolchain/toolchain-external/ext-tool.mk | 7 ++++---
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index db7c7f1..13dbebb 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -201,8 +201,11 @@ check_uclibc = \
# Check that the Buildroot configuration of the ABI matches the
# configuration of the external toolchain.
#
+# $1: cross-gcc path
+#
check_arm_abi = \
- EXT_TOOLCHAIN_TARGET=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Target | cut -f2 -d ' ') ; \
+ __CROSS_CC=$(strip $1) ; \
+ EXT_TOOLCHAIN_TARGET=`LANG=C $${__CROSS_CC} -v 2>&1 | grep ^Target | cut -f2 -d ' '` ; \
if echo $${EXT_TOOLCHAIN_TARGET} | grep -q 'eabi$$' ; then \
EXT_TOOLCHAIN_ABI="eabi" ; \
else \
@@ -220,8 +223,11 @@ check_arm_abi = \
#
# Check that the external toolchain supports C++
#
+# $1: cross-g++ path
+#
check_cplusplus = \
- $(TARGET_CXX) -v > /dev/null 2>&1 ; \
+ __CROSS_CXX=$(strip $1) ; \
+ $${__CROSS_CXX} -v > /dev/null 2>&1 ; \
if test $$? -ne 0 ; then \
echo "C++ support is selected but is not available in external toolchain" ; \
exit 1 ; \
@@ -230,9 +236,12 @@ check_cplusplus = \
#
# Check that the cross-compiler given in the configuration exists
#
+# $1: cross-gcc path
+#
check_cross_compiler_exists = \
- $(TARGET_CC) -v > /dev/null 2>&1 ; \
+ __CROSS_CC=$(strip $1) ; \
+ $${__CROSS_CC} -v > /dev/null 2>&1 ; \
if test $$? -ne 0 ; then \
- echo "Cannot execute cross-compiler '$(TARGET_CC)'" ; \
+ echo "Cannot execute cross-compiler '$${__CROSS_CC}'" ; \
exit 1 ; \
fi
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 328f908..6f5de81 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -122,6 +122,7 @@ endif
TOOLCHAIN_EXTERNAL_CROSS=$(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
TOOLCHAIN_EXTERNAL_CC=$(TOOLCHAIN_EXTERNAL_CROSS)gcc
+TOOLCHAIN_EXTERNAL_CXX=$(TOOLCHAIN_EXTERNAL_CROSS)g++
TOOLCHAIN_EXTERNAL_WRAPPER_ARGS = \
-DBR_CROSS_PATH='"$(TOOLCHAIN_EXTERNAL_BIN)/"' \
-DBR_SYSROOT='"$(STAGING_DIR)"'
@@ -201,7 +202,7 @@ $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
# type of C library and all C library features.
$(STAMP_DIR)/ext-toolchain-checked:
@echo "Checking external toolchain settings"
- $(Q)$(call check_cross_compiler_exists)
+ $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
$(Q)SYSROOT_DIR=`$(TOOLCHAIN_EXTERNAL_CC) -print-sysroot 2>/dev/null` ; \
if test -z "$${SYSROOT_DIR}" ; then \
SYSROOT_DIR=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;'` ; \
@@ -211,10 +212,10 @@ $(STAMP_DIR)/ext-toolchain-checked:
exit 1 ; \
fi ; \
if test x$(BR2_arm) == x"y" ; then \
- $(call check_arm_abi) ; \
+ $(call check_arm_abi,$(TOOLCHAIN_EXTERNAL_CC)) ; \
fi ; \
if test x$(BR2_INSTALL_LIBSTDCPP) == x"y" ; then \
- $(call check_cplusplus) ; \
+ $(call check_cplusplus,$(TOOLCHAIN_EXTERNAL_CXX)) ; \
fi ; \
if test x$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC) == x"y" ; then \
$(call check_uclibc,$${SYSROOT_DIR}) ; \
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/1] external-toolchain: fix support
2011-05-08 16:52 ` [Buildroot] [PATCH 1/1] external-toolchain: fix support Thomas Petazzoni
@ 2011-05-08 19:59 ` Peter Korsgaard
2011-05-09 6:58 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2011-05-08 19:59 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Thomas> The recent commit adding the external toolchain wrapper has broken the
Thomas> support for external toolchain. The check_arm_eabi, check_cplusplus
Thomas> and check_cross_compiler_exists functions were using TARGET_CC, which
Thomas> points to the toolchain wrapper, but at the moment those functions are
Thomas> called, the wrapper hasn't been generated yet.
Thomas> We fix this by passing to these functions the path to the C or C++
Thomas> compiler they should use for their tests.
Thanks, committed. I don't quite know how I could have forgotten about
them in the commit. I do remember looking them over when I fixed the
ones in ext-tool.mk.
The commit would have been a bit smaller if we simply replaced TARGET_CC
with TOOLCHAIN_EXTERNAL_CC (and same for C++) as we only use these
macros from ex-tool.mk anyway, but ok.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/1] external-toolchain: fix support
2011-05-08 19:59 ` Peter Korsgaard
@ 2011-05-09 6:58 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2011-05-09 6:58 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 08 May 2011 21:59:49 +0200
Peter Korsgaard <jacmet@uclibc.org> wrote:
> The commit would have been a bit smaller if we simply replaced
> TARGET_CC with TOOLCHAIN_EXTERNAL_CC (and same for C++) as we only
> use these macros from ex-tool.mk anyway, but ok.
Yes, but while TARGET_CC can be considered as a global variable, I
don't consider TOOLCHAIN_EXTERNAL_CC to be a global one, but a local
variable to ext-tool.mk (I know 'make' doesn't provide any sort of
variable scoping mechanism, but still). For that reason, I thought that
passing the compiler path was a clearer solution.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-09 6:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08 16:52 [Buildroot] [pull request] Pull request for branch for-2011.05/fix-ext-toolchain-support Thomas Petazzoni
2011-05-08 16:52 ` [Buildroot] [PATCH 1/1] external-toolchain: fix support Thomas Petazzoni
2011-05-08 19:59 ` Peter Korsgaard
2011-05-09 6:58 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox