From patchwork Tue Jan 14 08:21:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B8rensen=2C_Stefan?= X-Patchwork-Id: 310507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id DB44A2C0098 for ; Tue, 14 Jan 2014 19:39:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EFCB38B2C0; Tue, 14 Jan 2014 08:39:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xsDBgZAY77U3; Tue, 14 Jan 2014 08:39:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9515E8C02C; Tue, 14 Jan 2014 08:39:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D84B21BFA1B for ; Tue, 14 Jan 2014 08:39:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D49D38B6D2 for ; Tue, 14 Jan 2014 08:39:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xEece4oSc4bV for ; Tue, 14 Jan 2014 08:39:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from HORWDSPRD01.spectralink.com (213083164162.static.sonofon.dk [213.83.164.162]) by whitealder.osuosl.org (Postfix) with ESMTP id 019BB8B2FE for ; Tue, 14 Jan 2014 08:39:04 +0000 (UTC) Received: from e37108.spectralink.com ([172.29.194.63]) by HORWDSPRD01.spectralink.com with Microsoft SMTPSVC(7.5.7600.16601); Tue, 14 Jan 2014 09:21:42 +0100 Received: by e37108.spectralink.com (sSMTP sendmail emulation); Tue, 14 Jan 2014 09:21:42 +0100 From: =?UTF-8?q?Stefan=20S=C3=B8rensen?= To: buildroot@busybox.net Date: Tue, 14 Jan 2014 09:21:34 +0100 Message-Id: <1389687696-4824-1-git-send-email-stefan.sorensen@spectralink.com> X-Mailer: git-send-email 1.8.4.2 MIME-Version: 1.0 X-OriginalArrivalTime: 14 Jan 2014 08:21:42.0963 (UTC) FILETIME=[A8152030:01CF1101] Subject: [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Currently the check for EABI/EABIhf toolchains looks for the Tag_ABI_VFP_args attribute in the crt1.o file which gcc adds in a EABIhw toolchain. The crt1.o is however often not compiled from c but assembler, and will then always failt he EABIhf check. Fix by compiling a temporary .c file and checking for the attribute. Signed-off-by: Stefan Sørensen --- toolchain/helpers.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index faa9d90..0accb7b 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -284,12 +284,15 @@ check_arm_abi = \ 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 \ + TEMP_C_FILE=`mktemp --tmpdir --suffix=.c`; \ + touch $${TEMP_C_FILE}; \ + $${__CROSS_CC} -c -o $${TEMP_C_FILE}.o $${TEMP_C_FILE}; \ + if $${__CROSS_READELF} -A $${TEMP_C_FILE}.o | grep -q "Tag_ABI_VFP_args:" ; then \ EXT_TOOLCHAIN_ABI="eabihf" ; \ else \ EXT_TOOLCHAIN_ABI="eabi" ; \ fi ; \ + rm -f $${TEMP_C_FILE} $${TEMP_C_FILE}.o; \ if [ "$(BR2_ARM_EABI)" = "y" -a "$${EXT_TOOLCHAIN_ABI}" = "eabihf" ] ; then \ echo "Incorrect ABI setting: EABI selected, but toolchain uses EABIhf" ; \ exit 1 ; \