public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: James Le Cuirot <chewi@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets
Date: Wed, 25 Jul 2018 10:46:42 +0100	[thread overview]
Message-ID: <20180725104642.3f45c48a@red.yakaraplc.local> (raw)
In-Reply-To: <1532495026.891.0.camel@gentoo.org>

On Wed, 25 Jul 2018 07:03:46 +0200
Michał Górny <mgorny@gentoo.org> wrote:

> > 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"  
> 
> Either the comment is confusing or you did it the other way around.

It is correct but also confusing for two different reasons and I only
explained one of them. :) If grep finds the given string, that means it
is *not* defined because otherwise it would be replaced with "1". I'll
add an explanation for that too.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer


      reply	other threads:[~2018-07-25  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 23:09 [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets James Le Cuirot
2018-07-24 23:34 ` Sergei Trofimovich
2018-07-25 22:19   ` James Le Cuirot
2018-07-26  7:13     ` Sergei Trofimovich
2018-07-25  5:03 ` Michał Górny
2018-07-25  9:46   ` James Le Cuirot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180725104642.3f45c48a@red.yakaraplc.local \
    --to=chewi@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox