aboutsummaryrefslogtreecommitdiff
path: root/toolchain/helpers.mk
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-07-17 22:30:48 +0200
committerGravatar Peter Korsgaard <jacmet@sunsite.dk>2013-07-18 00:22:40 +0200
commitb2e88073dbf05faa47475bf96d5ccf8a45906a3c (patch)
treef241f151a0681018abd81b96eae9977c535f47db /toolchain/helpers.mk
parent0bbbcb96db1628d083f39818faa4b3eb74835180 (diff)
downloadbuildroot-b2e88073dbf05faa47475bf96d5ccf8a45906a3c.tar.gz
buildroot-b2e88073dbf05faa47475bf96d5ccf8a45906a3c.tar.bz2
toolchain: check ARM EABI vs. EABIhf for external toolchains
Following the introduction of the support of EABIhf as a second ARM ABI, it is important to check whether the external toolchain provided by the user actually uses the ABI that has been selected in the Buildroot configuration. This commit introduces such a check by looking at the 'Tag_ABI_VFP_args' tag of the architecture-specific section of the ELF headers. This assumes that ELF is the binary format used on ARM, which may not be the case on ARM noMMU systems (they use the FLAT binary format), but Buildroot doesn't have support for such systems at the moment. Also ensure the correct CFLAGS are passed to the cross compiler for the test, so the correct variant is used in case the toolchain is multilib. [Peter: mention CFLAGS change] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain/helpers.mk')
-rw-r--r--toolchain/helpers.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 764c795d85..4c988a5c9a 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -279,10 +279,25 @@ check_uclibc = \
#
check_arm_abi = \
__CROSS_CC=$(strip $1) ; \
+ __CROSS_READELF=$(strip $2) ; \
EXT_TOOLCHAIN_TARGET=`LANG=C $${__CROSS_CC} -v 2>&1 | grep ^Target | cut -f2 -d ' '` ; \
if ! echo $${EXT_TOOLCHAIN_TARGET} | grep -qE 'eabi(hf)?$$' ; then \
echo "External toolchain uses the unsuported OABI" ; \
exit 1 ; \
+ fi ; \
+ EXT_TOOLCHAIN_CRT1=`LANG=C $${__CROSS_CC} -print-file-name=crt1.o` ; \
+ if $${__CROSS_READELF} -A $${EXT_TOOLCHAIN_CRT1} | grep -q "Tag_ABI_VFP_args:" ; then \
+ EXT_TOOLCHAIN_ABI="eabihf" ; \
+ else \
+ EXT_TOOLCHAIN_ABI="eabi" ; \
+ fi ; \
+ if [ "$(BR2_ARM_EABI)" = "y" -a "$${EXT_TOOLCHAIN_ABI}" = "eabihf" ] ; then \
+ echo "Incorrect ABI setting: EABI selected, but toolchain uses EABIhf" ; \
+ exit 1 ; \
+ fi ; \
+ if [ "$(BR2_ARM_EABIHF)" = "y" -a "$${EXT_TOOLCHAIN_ABI}" = "eabi" ] ; then \
+ echo "Incorrect ABI setting: EABIhf selected, but toolchain uses EABI" ; \
+ exit 1 ; \
fi
#