Patchwork [2/2] gcc-common.inc: Consider hardfp knob for configuring toolchain

login
register
mail settings
Submitter Khem Raj
Date May 13, 2011, 6:38 p.m.
Message ID <f11306ee6b1fa022336522a566294cce8d686c63.1305311636.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/3983/
State New, archived
Headers show

Comments

Khem Raj - May 13, 2011, 6:38 p.m.
pass --with-float=hard|soft depending upon ARM_FP_ABI settings

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/gcc/gcc-common.inc |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index a3fa234..8b7c3ad 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -8,10 +8,17 @@  NATIVEDEPS = ""
 inherit autotools gettext
 
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
-
 def get_gcc_fpu_setting(bb, d):
-    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
-        return "--with-float=soft"
+    if bb.data.getVar('TARGET_FPU', d, True) in [ 'soft', 'hard'] and bb.data.getVar('TARGET_OS', d, True).find('linux') >= 0 :
+        # ARM_FP_ABI could be either 'hardfp' or 'softfp'
+        arm_fpabi = bb.data.getVar('ARM_FP_ABI', d, True) or ""
+        if arm_fpabi != "":
+            if arm_fpabi  == "hardfp":
+                # reset it to whatever gcc --with-float configure expects which is either 'softfp' or 'hard'
+                arm_fpabi = "hard"
+            return "--with-float=" + arm_fpabi
+        else:
+            return "--with-float=" + bb.data.getVar('TARGET_FPU', d, True)
     return ""
 
 def get_gcc_mips_plt_setting(bb, d):