toolchain: ARM: Fix toolchain compilation for gcc 8.x
[openwrt/staging/yousong.git] / toolchain / gcc / common.mk
index 4bc8b202718a7d366437c80062b0646abfad047b..6e8767f707b7927b95a01ed66dde4da70ed71fee 100644 (file)
@@ -161,9 +161,13 @@ ifneq ($(GCC_ARCH),)
   GCC_CONFIGURE+= --with-arch=$(GCC_ARCH)
 endif
 
-ifneq ($(CONFIG_SOFT_FLOAT),y)
-  ifeq ($(CONFIG_arm),y)
+ifeq ($(CONFIG_arm),y)
+  GCC_CONFIGURE+= \
+       --with-cpu=$(word 1, $(subst +," ,$(CONFIG_CPU_TYPE)))
+
+  ifneq ($(CONFIG_SOFT_FLOAT),y)
     GCC_CONFIGURE+= \
+               --with-fpu=$(word 2, $(subst +, ",$(CONFIG_CPU_TYPE))) \
                --with-float=hard
   endif
 endif