From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 899CE138334 for ; Tue, 24 Jul 2018 23:10:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 44631E08F4; Tue, 24 Jul 2018 23:09:47 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CECC4E0891 for ; Tue, 24 Jul 2018 23:09:46 +0000 (UTC) Received: from symphony.aura-online.co.uk (154.189.187.81.in-addr.arpa [81.187.189.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chewi) by smtp.gentoo.org (Postfix) with ESMTPSA id ADE6C3402FE; Tue, 24 Jul 2018 23:09:43 +0000 (UTC) From: James Le Cuirot To: gentoo-dev@lists.gentoo.org Cc: James Le Cuirot Subject: [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets Date: Wed, 25 Jul 2018 00:09:28 +0100 Message-Id: <20180724230928.30078-1-chewi@gentoo.org> X-Mailer: git-send-email 2.17.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 4086d3f7-b83a-4b5d-af13-1720eb66ce72 X-Archives-Hash: b47d520a11b437d7ef511cf0717c1215 The triplet will change from armv7a-hardfloat-linux-gnueabi to armv7a-unknown-linux-gnueabihf or similar. The function already treated the latter as hardfloat but ambiguous triplets such as arm-unknown-linux-gnueabi will change from hardfloat to softfloat in line with most everyone else. However, we will now check existing toolchains to avoid breaking existing systems, if possible. --- eclass/toolchain-funcs.eclass | 39 ++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index cea8949b45d7..f484fffc2664 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -204,13 +204,38 @@ tc-is-softfloat() { bfin*|h8300*) echo "only" ;; *) - if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then - echo "yes" - elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then - echo "softfp" - else - echo "no" - fi + case ${CTARGET//_/-} in + *-softfloat-*) + echo "yes" ;; + *-softfp-*) + echo "softfp" ;; + arm*) + # arm-unknown-linux-gnueabi is ambiguous. We used to + # treat it as hardfloat but we now treat it as + # softfloat like most everyone else. However, we + # check existing toolchains to avoid breaking + # existing systems, if possible. + if type -P ${CTARGET}-cpp >/dev/null; then + if ${CTARGET}-cpp -E - <<< __ARM_PCS_VFP 2>/dev/null | grep -q __ARM_PCS_VFP; then + # Confusingly __SOFTFP__ is defined only + # when -mfloat-abi is soft, not softfp. + if ${CTARGET}-cpp -E - <<< __SOFTFP__ 2>/dev/null | grep -q __SOFTFP__; then + echo "softfp" + else + echo "yes" + fi + else + echo "no" + fi + elif [[ ${CTARGET} == *-hardfloat-* || ${CTARGET} == *hf ]]; then + echo "no" + else + echo "yes" + fi + ;; + *) + echo "no" ;; + esac ;; esac } -- 2.17.0