diff options
author | Boris Krasnovskiy <borkra@gmail.com> | 2019-03-20 23:00:51 -0400 |
---|---|---|
committer | Christian Lamparter <chunkeey@gmail.com> | 2019-03-25 21:19:05 +0100 |
commit | 4cf991bedb4cbf42fd60af52a730bf52461c7161 (patch) | |
tree | cc6ad0cc3a12983f2972c5da5471a0e27a225b34 | |
parent | 8dcc1087602e2dd606e4f6e81a06aee62cfd4f4c (diff) | |
download | upstream-4cf991bedb4cbf42fd60af52a730bf52461c7161.tar.gz upstream-4cf991bedb4cbf42fd60af52a730bf52461c7161.tar.bz2 upstream-4cf991bedb4cbf42fd60af52a730bf52461c7161.zip |
toolchain: ARM: Fix option conflict with multiarch
This problem exposed when compiling glibc, but applicable across the
board. gcc compiles runtime libraries for all supported architectures,
unless otherwise specified, and later selects applicable library based
-m[arch,cpu,*] options, thus these options should not be passed to gcc
as they break the compilation process.
Signed-off-by: Boris Krasnovskiy <borkra@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[modified so it only touches ARM - I'm too chicken, changed authors email]
-rw-r--r-- | toolchain/gcc/common.mk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 6e8767f707..6e0edfb36a 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -170,6 +170,11 @@ ifeq ($(CONFIG_arm),y) --with-fpu=$(word 2, $(subst +, ",$(CONFIG_CPU_TYPE))) \ --with-float=hard endif + + # Do not let TARGET_CFLAGS get poisoned by extra CPU optimization flags + # that do not belong here. The cpu,fpu type should be specified via + # --with-cpu and --with-fpu for ARM and not CFLAGS. + TARGET_CFLAGS:=$(filter-out -m%,$(call qstrip,$(TARGET_CFLAGS))) endif ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy) |