1 |
On Wed, 25 Jul 2018 07:03:46 +0200 |
2 |
Michał Górny <mgorny@g.o> wrote: |
3 |
|
4 |
> > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass |
5 |
> > index cea8949b45d7..f484fffc2664 100644 |
6 |
> > --- a/eclass/toolchain-funcs.eclass |
7 |
> > +++ b/eclass/toolchain-funcs.eclass |
8 |
> > @@ -204,13 +204,38 @@ tc-is-softfloat() { |
9 |
> > bfin*|h8300*) |
10 |
> > echo "only" ;; |
11 |
> > *) |
12 |
> > - if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then |
13 |
> > - echo "yes" |
14 |
> > - elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then |
15 |
> > - echo "softfp" |
16 |
> > - else |
17 |
> > - echo "no" |
18 |
> > - fi |
19 |
> > + case ${CTARGET//_/-} in |
20 |
> > + *-softfloat-*) |
21 |
> > + echo "yes" ;; |
22 |
> > + *-softfp-*) |
23 |
> > + echo "softfp" ;; |
24 |
> > + arm*) |
25 |
> > + # arm-unknown-linux-gnueabi is ambiguous. We used to |
26 |
> > + # treat it as hardfloat but we now treat it as |
27 |
> > + # softfloat like most everyone else. However, we |
28 |
> > + # check existing toolchains to avoid breaking |
29 |
> > + # existing systems, if possible. |
30 |
> > + if type -P ${CTARGET}-cpp >/dev/null; then |
31 |
> > + if ${CTARGET}-cpp -E - <<< __ARM_PCS_VFP 2>/dev/null | grep -q __ARM_PCS_VFP; then |
32 |
> > + # Confusingly __SOFTFP__ is defined only |
33 |
> > + # when -mfloat-abi is soft, not softfp. |
34 |
> > + if ${CTARGET}-cpp -E - <<< __SOFTFP__ 2>/dev/null | grep -q __SOFTFP__; then |
35 |
> > + |
36 |
> > echo "softfp" |
37 |
> |
38 |
> Either the comment is confusing or you did it the other way around. |
39 |
|
40 |
It is correct but also confusing for two different reasons and I only |
41 |
explained one of them. :) If grep finds the given string, that means it |
42 |
is *not* defined because otherwise it would be replaced with "1". I'll |
43 |
add an explanation for that too. |
44 |
|
45 |
-- |
46 |
James Le Cuirot (chewi) |
47 |
Gentoo Linux Developer |