Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Prefer cc-option for additions to cflags

A future change will switch as-option to use KBUILD_AFLAGS instead of
KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause
issues if the flag being tested requires a flag previously added to
KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions
so that the flags are tested properly.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Nathan Chancellor and committed by
Masahiro Yamada
337ff6bb 80a20d2f

+2 -2
+1 -1
arch/mips/Makefile
··· 143 143 # 144 144 # Avoid this by explicitly disabling that assembler behaviour. 145 145 # 146 - cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) 146 + cflags-y += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) 147 147 148 148 # 149 149 # CPU-dependent compiler/assembler options for optimization.
+1 -1
arch/mips/loongson2ef/Platform
··· 25 25 # binutils does not merge support for the flag then we can revisit & remove 26 26 # this later - for now it ensures vendor toolchains don't cause problems. 27 27 # 28 - cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) 28 + cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) 29 29 30 30 # Enable the workarounds for Loongson2f 31 31 ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS