diff options
author | Nathan Chancellor <nathan@kernel.org> | 2022-01-25 23:19:25 +0100 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2022-02-07 18:30:12 +0100 |
commit | d49fc69293f2022785f6ee1c3c7d565271abe393 (patch) | |
tree | 4541fffa1e8775b0db68d7ffc6f1cd051802569c /arch/mips/loongson64 | |
parent | MIPS: Loongson64: Clean up use of cc-ifversion (diff) | |
download | linux-d49fc69293f2022785f6ee1c3c7d565271abe393.tar.xz linux-d49fc69293f2022785f6ee1c3c7d565271abe393.zip |
MIPS: Loongson{2ef,64}: Wrap -mno-branch-likely with cc-option
This flag is not supported by clang, which results in a warning:
clang-14: warning: argument unused during compilation: '-mno-branch-likely' [-Wunused-command-line-argument]
This breaks cc-option, which adds -Werror to make this warning fatal and
catch flags that are not supported.
Wrap this flag in cc-option so that it does not cause cc-option to fail,
which can cause randconfigs to be really noisy, due to warnings not
getting disabled that should be.
Additionally, move the cc-option check to Kconfig so that the check is
done at configuration time, rather than build time, as builds with no
configuration change will be quicker because the cc-option call will not
need to happen in those instances.
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/loongson64')
-rw-r--r-- | arch/mips/loongson64/Platform | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/loongson64/Platform b/arch/mips/loongson64/Platform index f2a08a185ee2..473404cae1c4 100644 --- a/arch/mips/loongson64/Platform +++ b/arch/mips/loongson64/Platform @@ -18,5 +18,6 @@ cflags-y += $(call cc-option,-mno-loongson-mmi) # Loongson Machines' Support # -cflags-$(CONFIG_MACH_LOONGSON64) += -I$(srctree)/arch/mips/include/asm/mach-loongson64 -mno-branch-likely +cflags-$(CONFIG_MACH_LOONGSON64) += -I$(srctree)/arch/mips/include/asm/mach-loongson64 +cflags-$(CONFIG_CC_HAS_MNO_BRANCH_LIKELY) += -mno-branch-likely load-$(CONFIG_CPU_LOONGSON64) += 0xffffffff80200000 |