diff mbox series

[V2] gcc-8: Enable fp arch extention when fpu is available

Message ID 20180621012607.32923-1-raj.khem@gmail.com
State Accepted
Commit 85981cbbf0ce48a6d82bc39248afa9540ca858d8
Headers show
Series [V2] gcc-8: Enable fp arch extention when fpu is available | expand

Commit Message

Khem Raj June 21, 2018, 1:26 a.m. UTC
This is especially needed when defaulting to hard-float ABI
Fixes errors e.g.
cc1: error: -mfloat-abi=hard: selected processor lacks an FPU

Fixes [YOCTO #12795]

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Cc: Ross Burton <ross.burton@intel.com>
---
V2:
- Limit the change to gcc8 since gcc7 does not have these extentions

 meta/recipes-devtools/gcc/gcc-target.inc | 9 ++++++---
 meta/recipes-devtools/gcc/gcc_8.1.bb     | 4 ++++
 2 files changed, 10 insertions(+), 3 deletions(-)

-- 
2.17.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index 56e4b95af4..bc2236fed0 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -14,9 +14,12 @@  EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 # specific). For example, for ARM, ARMv6+ adds atomic instructions that may
 # affect the ABI in the gcc-runtime libs. Since we can't rely on gcc on the
 # target to always be passed -march etc, its built-in default needs to be safe.
-EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
-EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
-EXTRA_OECONF_append_armv7ve = " --with-arch=armv7ve"
+
+ARMFPARCHEXT ?= ""
+
+EXTRA_OECONF_append_armv6 = " --with-arch=armv6${ARMFPARCHEXT}"
+EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a${ARMFPARCHEXT}"
+EXTRA_OECONF_append_armv7ve = " --with-arch=armv7ve${ARMFPARCHEXT}"
 
 # libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is
 # set in subdir gcc, so subdir libcc1 can't use it, export it here to
diff --git a/meta/recipes-devtools/gcc/gcc_8.1.bb b/meta/recipes-devtools/gcc/gcc_8.1.bb
index ab208e7026..7d93590588 100644
--- a/meta/recipes-devtools/gcc/gcc_8.1.bb
+++ b/meta/recipes-devtools/gcc/gcc_8.1.bb
@@ -7,4 +7,8 @@  require gcc-target.inc
 ARM_INSTRUCTION_SET_armv4 = "arm"
 ARM_INSTRUCTION_SET_armv5 = "arm"
 
+ARMFPARCHEXT_armv6 = "${@'+fp' if d.getVar('TARGET_FPU') == 'hard' else ''}"
+ARMFPARCHEXT_armv7a = "${@'+fp' if d.getVar('TARGET_FPU') == 'hard' else ''}"
+ARMFPARCHEXT_armv7ve = "${@'+fp' if d.getVar('TARGET_FPU') == 'hard' else ''}"
+
 BBCLASSEXTEND = "nativesdk"