arch/mips: add option for toolchains supporting -mnan
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>
Fri, 21 Jul 2017 17:06:31 +0000 (18:06 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 21 Jul 2017 20:48:51 +0000 (22:48 +0200)
-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>
arch/Config.in.mips
toolchain/toolchain-common.in
toolchain/toolchain-external/pkg-toolchain-external.mk

index de71110e088aae9c997cc2bf9c411385e5e95b9c..3d2dfe3f4991905621114537d022ddd3a812ae33 100644 (file)
@@ -169,6 +169,7 @@ config BR2_MIPS_NAN_2008
 
 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
index 932eecac9ab43fc30a427b92e1047ce03b0a697f..0002682e12d7647783d19dc56c6eff4b9ee6be54 100644 (file)
@@ -342,6 +342,10 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST
        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
index 32631996420a885efaaf2dafd80adee4d0dc2d9c..23cdf30b9f94317810ee47ecc5eb1fecaffab13e 100644 (file)
@@ -178,10 +178,12 @@ ifneq ($(CC_TARGET_ABI_),)
 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_)"'