1 |
The triplet will change from armv7a-hardfloat-linux-gnueabi to |
2 |
armv7a-unknown-linux-gnueabihf or similar. The function already |
3 |
treated the latter as hardfloat but ambiguous triplets such as |
4 |
arm-unknown-linux-gnueabi will change from hardfloat to softfloat in |
5 |
line with most everyone else. However, we will now check existing |
6 |
toolchains to avoid breaking existing systems, if possible. |
7 |
--- |
8 |
eclass/toolchain-funcs.eclass | 39 ++++++++++++++++++++++++++++------- |
9 |
1 file changed, 32 insertions(+), 7 deletions(-) |
10 |
|
11 |
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass |
12 |
index cea8949b45d7..f484fffc2664 100644 |
13 |
--- a/eclass/toolchain-funcs.eclass |
14 |
+++ b/eclass/toolchain-funcs.eclass |
15 |
@@ -204,13 +204,38 @@ tc-is-softfloat() { |
16 |
bfin*|h8300*) |
17 |
echo "only" ;; |
18 |
*) |
19 |
- if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then |
20 |
- echo "yes" |
21 |
- elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then |
22 |
- echo "softfp" |
23 |
- else |
24 |
- echo "no" |
25 |
- fi |
26 |
+ case ${CTARGET//_/-} in |
27 |
+ *-softfloat-*) |
28 |
+ echo "yes" ;; |
29 |
+ *-softfp-*) |
30 |
+ echo "softfp" ;; |
31 |
+ arm*) |
32 |
+ # arm-unknown-linux-gnueabi is ambiguous. We used to |
33 |
+ # treat it as hardfloat but we now treat it as |
34 |
+ # softfloat like most everyone else. However, we |
35 |
+ # check existing toolchains to avoid breaking |
36 |
+ # existing systems, if possible. |
37 |
+ if type -P ${CTARGET}-cpp >/dev/null; then |
38 |
+ if ${CTARGET}-cpp -E - <<< __ARM_PCS_VFP 2>/dev/null | grep -q __ARM_PCS_VFP; then |
39 |
+ # Confusingly __SOFTFP__ is defined only |
40 |
+ # when -mfloat-abi is soft, not softfp. |
41 |
+ if ${CTARGET}-cpp -E - <<< __SOFTFP__ 2>/dev/null | grep -q __SOFTFP__; then |
42 |
+ echo "softfp" |
43 |
+ else |
44 |
+ echo "yes" |
45 |
+ fi |
46 |
+ else |
47 |
+ echo "no" |
48 |
+ fi |
49 |
+ elif [[ ${CTARGET} == *-hardfloat-* || ${CTARGET} == *hf ]]; then |
50 |
+ echo "no" |
51 |
+ else |
52 |
+ echo "yes" |
53 |
+ fi |
54 |
+ ;; |
55 |
+ *) |
56 |
+ echo "no" ;; |
57 |
+ esac |
58 |
;; |
59 |
esac |
60 |
} |
61 |
-- |
62 |
2.17.0 |