@@ -79,8 +79,14 @@ static char *predef_args[] = {
#ifdef BR_OMIT_LOCK_PREFIX
"-Wa,-momit-lock-prefix=yes",
#endif
-#ifdef BR_NO_FUSED_MADD
- "-mno-fused-madd",
+#ifdef BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
+ #ifdef BR_FP_CONTRACT_OFF
+ "-ffp-contract=off",
+ #endif
+#else
+ #ifdef BR_NO_FUSED_MADD
+ "-mno-fused-madd",
+ #endif
#endif
#ifdef BR_BINFMT_FLAT
"-Wl,-elf2flt",
@@ -28,7 +28,11 @@ endif
# Avoid FPU bug on XBurst CPUs
ifeq ($(BR2_mips_xburst),y)
-TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
+ ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
+ TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
+ else
+ TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
+ endif
endif
ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
This fix is necessary for to build for MIPS, for example for the MIPS XBurst architecture used on ci20 boards. GCC has replaced (no)mfused-madd with ffp-contract. Find more details and a long discussion at https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00876.html Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com> --- toolchain/toolchain-wrapper.c | 10 ++++++++-- toolchain/toolchain-wrapper.mk | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-)