Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: James Le Cuirot <chewi@g.o>
Subject: Re: [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets
Date: Wed, 25 Jul 2018 05:04:02
Message-Id: 1532495026.891.0.camel@gentoo.org
In Reply to: [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets by James Le Cuirot
1 W dniu śro, 25.07.2018 o godzinie 00∶09 +0100, użytkownik James Le
2 Cuirot napisał:
3 > The triplet will change from armv7a-hardfloat-linux-gnueabi to
4 > armv7a-unknown-linux-gnueabihf or similar. The function already
5 > treated the latter as hardfloat but ambiguous triplets such as
6 > arm-unknown-linux-gnueabi will change from hardfloat to softfloat in
7 > line with most everyone else. However, we will now check existing
8 > toolchains to avoid breaking existing systems, if possible.
9 > ---
10 > eclass/toolchain-funcs.eclass | 39 ++++++++++++++++++++++++++++-------
11 > 1 file changed, 32 insertions(+), 7 deletions(-)
12 >
13 > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
14 > index cea8949b45d7..f484fffc2664 100644
15 > --- a/eclass/toolchain-funcs.eclass
16 > +++ b/eclass/toolchain-funcs.eclass
17 > @@ -204,13 +204,38 @@ tc-is-softfloat() {
18 > bfin*|h8300*)
19 > echo "only" ;;
20 > *)
21 > - if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then
22 > - echo "yes"
23 > - elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then
24 > - echo "softfp"
25 > - else
26 > - echo "no"
27 > - fi
28 > + case ${CTARGET//_/-} in
29 > + *-softfloat-*)
30 > + echo "yes" ;;
31 > + *-softfp-*)
32 > + echo "softfp" ;;
33 > + arm*)
34 > + # arm-unknown-linux-gnueabi is ambiguous. We used to
35 > + # treat it as hardfloat but we now treat it as
36 > + # softfloat like most everyone else. However, we
37 > + # check existing toolchains to avoid breaking
38 > + # existing systems, if possible.
39 > + if type -P ${CTARGET}-cpp >/dev/null; then
40 > + if ${CTARGET}-cpp -E - <<< __ARM_PCS_VFP 2>/dev/null | grep -q __ARM_PCS_VFP; then
41 > + # Confusingly __SOFTFP__ is defined only
42 > + # when -mfloat-abi is soft, not softfp.
43 > + if ${CTARGET}-cpp -E - <<< __SOFTFP__ 2>/dev/null | grep -q __SOFTFP__; then
44 > + echo "softfp"
45
46 Either the comment is confusing or you did it the other way around.
47
48 > + else
49 > + echo "yes"
50 > + fi
51 > + else
52 > + echo "no"
53 > + fi
54 > + elif [[ ${CTARGET} == *-hardfloat-* || ${CTARGET} == *hf ]]; then
55 > + echo "no"
56 > + else
57 > + echo "yes"
58 > + fi
59 > + ;;
60 > + *)
61 > + echo "no" ;;
62 > + esac
63 > ;;
64 > esac
65 > }
66
67 --
68 Best regards,
69 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies