aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2015-04-02 09:42:52 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-10 09:41:55 -0400
commit5306a5450824691e27d68f711758515debedeeac (patch)
treec060c58cbc83f0101d4e8f21be5092106b6a495a
parent48f8eaee3f59848809644507fc47363b37e54450 (diff)
MIPS: Makefile: Fix MIPS ASE detection code
Commit 32098ec7bcba ("MIPS: Makefile: Move the ASEs checks after setting the core's CFLAGS") re-arranged the MIPS ASE detection code and also added the current cflags to the detection logic. However, this introduced a few bugs. First of all, the mips-cflags should not be quoted since that ends up being passed as a string to subsequent commands leading to broken detection from the cc-option-* tools. Moreover, in order to avoid duplicating the cflags-y because of how cc-option works, we rework the logic so we pass only those cflags which are needed by the selected ASE. Finally, fix some typos resulting in MSA not being detected correctly. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Fixes: Commit 32098ec7bcba ("MIPS: Makefile: Move the ASEs checks after setting the core's CFLAGS") Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9661/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 8f57fc72d62c..1b4dab1e6ab8 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -197,11 +197,17 @@ endif
197# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension 197# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
198# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has 198# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
199# been fixed properly. 199# been fixed properly.
200mips-cflags := "$(cflags-y)" 200mips-cflags := $(cflags-y)
201cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,$(mips-cflags),-msmartmips) -Wa,--no-warn 201ifeq ($(CONFIG_CPU_HAS_SMARTMIPS),y)
202cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,$(mips-cflags),-mmicromips) 202smartmips-ase := $(call cc-option-yn,$(mips-cflags) -msmartmips)
203cflags-$(smartmips-ase) += -msmartmips -Wa,--no-warn
204endif
205ifeq ($(CONFIG_CPU_MICROMIPS),y)
206micromips-ase := $(call cc-option-yn,$(mips-cflags) -mmicromips)
207cflags-$(micromips-ase) += -mmicromips
208endif
203ifeq ($(CONFIG_CPU_HAS_MSA),y) 209ifeq ($(CONFIG_CPU_HAS_MSA),y)
204toolchain-msa := $(call cc-option-yn,-$(mips-cflags),mhard-float -mfp64 -Wa$(comma)-mmsa) 210toolchain-msa := $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(comma)-mmsa)
205cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA 211cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
206endif 212endif
207 213