Skip to contentSkip to conversation

Toolchain configuations for enabling ARM hardfp ABI

PATCH New Khem Raj 1 participant 3 messages May 13, 2011

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover Toolchain configuations for enabling ARM hardfp ABI

On armv7 machines with neon or vfp, gcc can support hardfp calling convention These changes introduce a new variable to control the FP abi for ARM. This variable can be set in machine.conf files or in local.conf to chose the desired ABI, The defaults remain same i.e. softfp calling conventions for passing floating point arguments.

I have bootied the generated root file system on beagleboard

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: kraj/arm-hardfp
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/arm-hardfp

Thanks,
Khem Raj <[email protected]>
---

Khem Raj (2):
tune-cortexa8.inc: Define variable for controlling FP ABI gcc-common.inc: Consider hardfp knob for configuring toolchain

 meta/conf/machine/include/tune-cortexa8.inc |   14 ++++++++++----
 meta/recipes-devtools/gcc/gcc-common.inc    |   13 ++++++++++---
 2 files changed, 20 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH 1/2 tune-cortexa8.inc: Define variable for controlling FP ABI

ARM_FP_ABI also is poked from gcc configure to enable hardfp for parameter

---
 meta/conf/machine/include/tune-cortexa8.inc |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
meta/conf/machine/include/tune-cortexa8.inc +10 -4
index a5b982a..d5e15c6 100644
@@ -3,11 +3,17 @@
 # [2] http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html 
 # [3] https://support.codesourcery.com/GNUToolchain/kbentry29
 
-TARGET_CC_ARCH = "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-tree-vectorize"
+# Can be one of ['softfp' 'hardfp']
+ARM_FP_ABI ?= "softfp"
+
+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} -fno-tree-vectorize"
 
 # Other potentially useful options
 #-ftree-vectorize -ffast-math -fno-omit-frame-pointer
 
-FEED_ARCH = "armv7a"
-BASE_PACKAGE_ARCH = "armv7a"
-PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te armv6 armv7 armv7a"
+FEED_ARCH = "armv7a${ARM_FP_PACKAGESUFFIX}"
+BASE_PACKAGE_ARCH = "armv7a${ARM_FP_PACKAGESUFFIX}"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te armv6 armv7 armv7a${ARM_FP_PACKAGESUFFIX}"
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH 2/2 gcc-common.inc: Consider hardfp knob for configuring toolchain

In reply to Khem Raj

pass --with-float=hard|soft depending upon ARM_FP_ABI settings

---
 meta/recipes-devtools/gcc/gcc-common.inc |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
meta/recipes-devtools/gcc/gcc-common.inc +10 -3
index a3fa234..8b7c3ad 100644
@@ -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):
Signature · 1 line
1.7.4.1