From 8dcc1087602e2dd606e4f6e81a06aee62cfd4f4c Mon Sep 17 00:00:00 2001 From: Boris Krasnovskiy Date: Sat, 9 Mar 2019 20:45:43 -0500 Subject: toolchain: ARM: Fix toolchain compilation for gcc 8.x Set the toolchain's ARM CPU and FPU architectures by utilizing' gcc's --with-cpu / --with-fpu configure options that: "Specify which cpu variant the compiler should generate code for by default. cpu will be used as the default value of the -mcpu= switch." This will resolve the following kernel compilation failures under gcc 8.x on ARM because the kernel wants to set (possibly conflicting) optimization flags. .../ccyVnmrs.s:204: Error: selected processor does not support `dmb ish' in ARM mode .../ccyVnmrs.s:215: Error: architectural extension `mp' is not allowed for the current base architecture .../ccyVnmrs.s:216: Error: selected processor does not support `pldw [r4]' in ARM mode Because this is a big change, the .config and toolchain need to be refreshed (as in removed and regenerated). Reported-by: Ansuel Smith Reported-by: Daniel Engberg [#1203] Signed-off-by: Boris Krasnovskiy Signed-off-by: Christian Lamparter [extended commit message, removed now-deprecated CPU_CFLAGS, changed author to gmail address] --- toolchain/gcc/common.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'toolchain/gcc') diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 4bc8b20271..6e8767f707 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -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 -- cgit v1.2.3