powerpc: check for support for -Wa,-m{power4,any}
authorDaniel Axtens <dja@axtens.net>
Tue, 21 Dec 2021 05:59:00 +0000 (16:59 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Dec 2021 11:35:12 +0000 (22:35 +1100)
LLVM's integrated assembler does not like either -Wa,-mpower4
or -Wa,-many. So just don't pass them if they're not supported.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211221055904.555763-3-aik@ozlabs.ru
arch/powerpc/Makefile

index e9aa4e8b07dda21beaa2e3f784ba04f4ef0e34f0..5f16ac1583c5d96608cf99880238720f1e30006c 100644 (file)
@@ -245,7 +245,9 @@ cpu-as-$(CONFIG_E500)               += -Wa,-me500
 # When using '-many -mpower4' gas will first try and find a matching power4
 # mnemonic and failing that it will allow any valid mnemonic that GAS knows
 # about. GCC will pass -many to GAS when assembling, clang does not.
-cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 -Wa,-many
+# LLVM IAS doesn't understand either flag: https://github.com/ClangBuiltLinux/linux/issues/675
+# but LLVM IAS only supports ISA >= 2.06 for Book3S 64 anyway...
+cpu-as-$(CONFIG_PPC_BOOK3S_64) += $(call as-option,-Wa$(comma)-mpower4) $(call as-option,-Wa$(comma)-many)
 cpu-as-$(CONFIG_PPC_E500MC)    += $(call as-option,-Wa$(comma)-me500mc)
 
 KBUILD_AFLAGS += $(cpu-as-y)