public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [arm17] [PATCH] toolchain-funcs.eclass: Update tc-is-softfloat for new ARM triplets
@ 2018-07-24 23:09 James Le Cuirot
  2018-07-24 23:34 ` Sergei Trofimovich
  2018-07-25  5:03 ` Michał Górny
  0 siblings, 2 replies; 6+ messages in thread
From: James Le Cuirot @ 2018-07-24 23:09 UTC (permalink / raw
  To: gentoo-dev; +Cc: James Le Cuirot

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.
---
 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
+						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"
+							else
+								echo "yes"
+							fi
+						else
+							echo "no"
+						fi
+					elif [[ ${CTARGET} == *-hardfloat-* || ${CTARGET} == *hf ]]; then
+						echo "no"
+					else
+						echo "yes"
+					fi
+					;;
+				*)
+					echo "no" ;;
+			esac
 			;;
 	esac
 }
-- 
2.17.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-26  7:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox