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 F40FA138334 for ; Tue, 24 Jul 2018 23:34:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77006E08C4; Tue, 24 Jul 2018 23:34:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 B002BE089E for ; Tue, 24 Jul 2018 23:34:26 +0000 (UTC) Received: from sf (trofi-1-pt.tunnel.tserv1.lon2.ipv6.he.net [IPv6:2001:470:1f1c:a0f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id 3C20E335D09; Tue, 24 Jul 2018 23:34:24 +0000 (UTC) Date: Wed, 25 Jul 2018 00:34:16 +0100 From: Sergei Trofimovich To: James Le Cuirot Cc: gentoo-dev@lists.gentoo.org, arm@gentoo.org Subject: Re: [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets Message-ID: <20180725003416.49416d46@sf> In-Reply-To: <20180724230928.30078-1-chewi@gentoo.org> References: <20180724230928.30078-1-chewi@gentoo.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 45234582-0375-4c51-88cb-263b823e11de X-Archives-Hash: 75b379c7b445cb7a74daed440c332815 On Wed, 25 Jul 2018 00:09:28 +0100 James Le Cuirot wrote: > 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. [+arm@ CC] 1. This changelog is not clear if arm-unknown-linux-gnueabi will change meaning in this commit. 2. Did Gentoo ever use arm-unknown-linux-gnueabi tuple? I don't see it in recent profile history. 3. What are existing toolchain tuples? All the ones people use? > --- > 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 I believe correct way to get cpp for target is "$(tc-getCPP ${CTARGET}) -E" > + if ${CTARGET}-cpp -E - <<< __ARM_PCS_VFP 2>/dev/null | grep -q __ARM_PCS_VFP; then 4. This magic is hard to follow and reason about. I suggest moving out autodetection of current setup into another helper. Bonus point for detection of mismatch of actual vs. intended state. Then we could start warning users about the fact of inconsistency and point to migration procedure. And we could have cleaner ${CTARGET} matches against what Gentoo expects. 5. you don't use ${CFLAGS} here. I feel we should use them as people do occasionally override defaults. > + # 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 I suggest using *-gnueabihf. I don't think anything more generic is recognized by toolchains as a hardfloat target. Also please link to description of what you think canonical hardfloat tuples are supposed to be. Upstreams do not agree on the definition. > + echo "no" > + else > + echo "yes" > + fi > + ;; > + *) > + echo "no" ;; > + esac > ;; > esac > } > -- > 2.17.0 > > -- Sergei