From patchwork Sun Jun 3 14:04:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 162528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 796FEB6FA7 for ; Mon, 4 Jun 2012 00:05:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7DCEC10B762; Sun, 3 Jun 2012 14:05:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cYE50mUoU27c; Sun, 3 Jun 2012 14:05:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id A39E7101F51; Sun, 3 Jun 2012 14:05:03 +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 3636C8F791 for ; Sun, 3 Jun 2012 14:05:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 29F538F736 for ; Sun, 3 Jun 2012 14:05:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JFxrbJj4ZF5q for ; Sun, 3 Jun 2012 14:05:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id 0CE908F71A for ; Sun, 3 Jun 2012 14:05:01 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 9BB8B268; Sun, 3 Jun 2012 16:03:57 +0200 (CEST) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6E432191 for ; Sun, 3 Jun 2012 16:03:46 +0200 (CEST) From: Thomas Petazzoni To: buildroot@busybox.net Date: Sun, 3 Jun 2012 16:04:36 +0200 Message-Id: <072850a3448195c8a1c926e5bc4fac4239a8ce23.1338732273.git.thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 02/10] toolchain-external: adjust logic to support Linaro 2012.05 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The check_glibc function verifies that the C library of the external toolchain is glibc. To do so, it verified that a file matching ld-linux*.so.* or ld.so.* was found in the lib/ directory of the toolchain's sysroot. However, with the Linaro 2012.05 toolchain, the lib/ directory contains two links named ld-linux-armhf.so.3 and ld-linux.so.3, which means that the first ld-linux*.so.* wildcard expression expands to two files, which generates a syntax error for the "test" program. We replace that with a more elaborate find+wc combination to determine whether at least one matching file is present. The check_arm_abi function verifies the ABI of an ARM toolchain. For EABI, it tested that the target name ends with eabi. However, with Linaro 2012.05, the tuple is now arm-linux-gnueabihf (for hard float), so we have to adjust the logic to accept this additional "hf" specification in the tuple. Signed-off-by: Thomas Petazzoni --- toolchain/helpers.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 649b91b..49a9044 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -196,7 +196,7 @@ check_glibc_feature = \ # check_glibc = \ SYSROOT_DIR="$(strip $1)"; \ - if ! test -f $${SYSROOT_DIR}/lib/ld-linux*.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \ + if test `find $${SYSDROOT_DIR}/lib/ -maxdepth 1 -name 'ld-linux*.so.*' -o -name 'ld.so.*' | wc -l` -eq 0 ; then \ echo "Incorrect selection of the C library"; \ exit -1; \ fi; \ @@ -263,7 +263,7 @@ check_uclibc = \ check_arm_abi = \ __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 \ + if echo $${EXT_TOOLCHAIN_TARGET} | grep -qE 'eabi(hf)?$$' ; then \ EXT_TOOLCHAIN_ABI="eabi" ; \ else \ EXT_TOOLCHAIN_ABI="oabi" ; \