-mnan option was added in gcc-4.9.0 so make sure that users cannot
select the NaN mode when using toolchains that have a gcc older
than 4.9.0, and also make sure that the -mnan option is not passed at
all to the toolchain-wrapper and target cflags.
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
choice
prompt "Target NaN"
+ depends on BR2_TOOLCHAIN_HAS_MNAN_OPTION
depends on BR2_mips_32r5 || BR2_mips_64r5
default BR2_MIPS_ENABLE_NAN_2008
help
default "4.4" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
default "4.3" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
+config BR2_TOOLCHAIN_HAS_MNAN_OPTION
+ bool
+ default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+
config BR2_TOOLCHAIN_HAS_SYNC_1
bool
default y
TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
endif
+ifeq ($(BR2_TOOLCHAIN_HAS_MNAN_OPTION),y)
ifneq ($(CC_TARGET_NAN_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -mnan=$(CC_TARGET_NAN_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_NAN='"$(CC_TARGET_NAN_)"'
endif
+endif
ifneq ($(CC_TARGET_FP32_MODE_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -mfp$(CC_TARGET_FP32_MODE_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_FP32_MODE='"$(CC_TARGET_FP32_MODE_)"'