[oe-commits] Khem Raj : conf/, gcc-common.inc: Add support for ARM hard float toolchain

git version control git at git.openembedded.org
Fri Sep 23 00:04:01 UTC 2011


Module: openembedded.git
Branch: 2011.03-maintenance
Commit: f0a2cb37fca677390e5b0c33628addb7615fa846
URL:    http://git.openembedded.org/?p=openembedded.git&a=commit;h=f0a2cb37fca677390e5b0c33628addb7615fa846

Author: Khem Raj <raj.khem at gmail.com>
Date:   Thu Mar 31 07:48:29 2011 -0700

conf/,gcc-common.inc: Add support for ARM hard float toolchain

Rename ARM_FP_MODE to ARM_FP_ABI

Set target fpu to hard for hardfp ARMv7

Use machine override to add base package arch instead of appending to
OVERRIDES directly

Pass --with-float option to gcc configure taking into account
what float ABI is selected through ARM_FP_ABI

Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Denys Dmytriyenko <denys at ti.com>

---

 conf/distro/include/sane-toolchain.inc |    3 ++-
 conf/distro/minimal-uclibc.conf        |    3 ---
 conf/machine/include/tune-cortexa8.inc |    6 +++---
 recipes/gcc/gcc-common.inc             |   12 ++++++++++--
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/conf/distro/include/sane-toolchain.inc b/conf/distro/include/sane-toolchain.inc
index 5882fd7..a174a07 100644
--- a/conf/distro/include/sane-toolchain.inc
+++ b/conf/distro/include/sane-toolchain.inc
@@ -73,7 +73,7 @@ require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc
 # Add BASE_PACKAGE_ARCH to the overrides list so that we can override the
 # ARM_INSTRUCTION_SET like below
 
-OVERRIDES =. "${BASE_PACKAGE_ARCH}:"
+MACHINE_OVERRIDES += "${FEED_ARCH}"
 
 # ARM920T and up can use thumb mode to decrease binary size at the expense of speed
 # (the complete story is a bit more nuanced due to cache starvation)
@@ -114,6 +114,7 @@ TARGET_FPU_ppc405 ?= "soft"
 TARGET_FPU_armv6 ?= "hard"
 TARGET_FPU_armv6-novfp ?= "soft"
 TARGET_FPU_armv7a ?= "hard"
+TARGET_FPU_armv7a-hardfp ?= "hard"
 TARGET_FPU_ppc603e ?= "hard"
 
 # webkit-gtk and cairo have alignment issues with double instructions on armv5 so
diff --git a/conf/distro/minimal-uclibc.conf b/conf/distro/minimal-uclibc.conf
index b85ed1e..487ae1b 100644
--- a/conf/distro/minimal-uclibc.conf
+++ b/conf/distro/minimal-uclibc.conf
@@ -13,9 +13,6 @@
 #
 DISTRO_NAME = "minimal-uclibc"
 
-TARGET_FPU_arm = "soft"
-TARGET_FPU_armeb = "soft"
-
 LIBC = "uclibc"
 
 require conf/distro/minimal.conf
diff --git a/conf/machine/include/tune-cortexa8.inc b/conf/machine/include/tune-cortexa8.inc
index 2ac0ebf..5f556e0 100644
--- a/conf/machine/include/tune-cortexa8.inc
+++ b/conf/machine/include/tune-cortexa8.inc
@@ -4,10 +4,10 @@
 # [3] https://support.codesourcery.com/GNUToolchain/kbentry29
 
 # Can be 'softfp' or 'hardfp'
-ARM_FP_MODE ?= "softfp"
+ARM_FP_ABI ?= "softfp"
 
-ARM_FP_OPT = "${@['-mfloat-abi=softfp', '-mfloat-abi=hard'][bb.data.getVar('ARM_FP_MODE', d, 1) == 'hardfp']}"
-ARM_FP_PACKAGESUFFIX = "${@['', '-hardfp'][bb.data.getVar('ARM_FP_MODE', d, 1) == 'hardfp']}"
+ARM_FP_OPT = "${@['-mfloat-abi=softfp', '-mfloat-abi=hard'][bb.data.getVar('ARM_FP_ABI', d, 1) == 'hardfp']}"
+ARM_FP_PACKAGESUFFIX = "${@['', '-hardfp'][bb.data.getVar('ARM_FP_ABI', d, 1) == 'hardfp']}"
 
 TARGET_CC_ARCH = "-march=armv7-a -mtune=cortex-a8 -mfpu=neon ${ARM_FP_OPT}"
 
diff --git a/recipes/gcc/gcc-common.inc b/recipes/gcc/gcc-common.inc
index 9fd433b..d32b2ba 100644
--- a/recipes/gcc/gcc-common.inc
+++ b/recipes/gcc/gcc-common.inc
@@ -15,8 +15,16 @@ COMPATIBLE_TARGET_SYS ?= "(?!nios2)"
 # for building for the new host part.  So only obey TARGET_FPU for the
 # real target.
 def get_gcc_fpu_setting(bb, d):
-    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ] and bb.data.getVar('TARGET_OS', d, 1).find('linux') >= 0 :
-        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):





More information about the Openembedded-commits mailing list