diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c index 2928ea42d0..c5eb813dd0 100644 --- a/toolchain/toolchain-wrapper.c +++ b/toolchain/toolchain-wrapper.c @@ -82,6 +82,9 @@ static char *predef_args[] = { #ifdef BR_NO_FUSED_MADD "-mno-fused-madd", #endif +#ifdef BR_FP_CONTRACT_OFF + "-ffp-contract=off", +#endif #ifdef BR_BINFMT_FLAT "-Wl,-elf2flt", #endif diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index 0b26037d48..b8074efc3c 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -32,8 +32,14 @@ endif # Avoid FPU bug on XBurst CPUs ifeq ($(BR2_mips_xburst),y) +# Before gcc 4.6, -mno-fused-madd was needed, after -ffp-contract is +# needed +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) TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'