powerpc/Makefiles: Fix clang/llvm build
PATCH 1/1 powerpc/Makefiles: Fix clang/llvm build
From: Anton Blanchard <[email protected]>
Commit 15a3204d24a3 ("powerpc/64s: Set assembler machine type to POWER4") passes -mpower4 to the assembler. We have more recent instructions in our assembly files, but gas permits them. The clang/llvm integrated assembler is more strict, and we get a build failure.
Fix this by calling the assembler with -mcpu=power8
--- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/Makefile +1 -1
@@ -238,7 +238,7 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) cpu-as-$(CONFIG_E200) += -Wa,-me200 cpu-as-$(CONFIG_E500) += -Wa,-me500 -cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 +cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower8 cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc) KBUILD_AFLAGS += $(cpu-as-y)
Signature · 1 line
2.17.1
Michael Ellerman
reviewerQuoted 8 lines · Anton Blanchard
From: Anton Blanchard <[email protected]>
Commit
15a3204d24a3("powerpc/64s: Set assembler machine type to POWER4") passes -mpower4 to the assembler. We have more recent instructions in our assembly files, but gas permits them. The clang/llvm integrated assembler is more strict, and we get a build failure.Fix this by calling the assembler with -mcpu=power8
This breaks GCC 4.6.3 at least, which we still support:
Assembler messages:
Error: invalid switch -mpower8
Error: unrecognized option -mpower8 ../scripts/mod/empty.c:1:0: fatal error: error closing -: Broken pipe
cheers
Hi Michael,
Quoted 7 lines
This breaks GCC 4.6.3 at least, which we still support:
Assembler messages:
Error: invalid switch -mpower8
Error: unrecognized option -mpower8../scripts/mod/empty.c:1:0: fatal error: error closing -: Broken
pipe
Yuck. We have POWER8 instructions in our assembly code, and a toolchain that doesn't understand the -mpower8 flag, but has support for power8 instructions.
This is what I see on clang with -mpower7:
/tmp/sstep-2afa55.s:7584: Error: unrecognized opcode: lbarx' /tmp/sstep-2afa55.s:7626: Error: unrecognized opcode: stbcx.' /tmp/sstep-2afa55.s:8077: Error: unrecognized opcode: lharx' /tmp/sstep-2afa55.s:8140: Error: unrecognized opcode: stbcx.'
Nick: any suggestions?
Thanks,
Anton
Nicholas Piggin
reviewerQuoted 14 lines · On Tue, 21 Aug 2018 15:38:39 +1000 Anton Blanchard <[email protected]> wrote:
Hi Michael,
Quoted 7 lines
This breaks GCC 4.6.3 at least, which we still support:
Assembler messages:
Error: invalid switch -mpower8
Error: unrecognized option -mpower8../scripts/mod/empty.c:1:0: fatal error: error closing -: Broken
pipeYuck. We have POWER8 instructions in our assembly code, and a toolchain that doesn't understand the -mpower8 flag, but has support for power8 instructions.
Quoted 8 lines
This is what I see on clang with -mpower7:
/tmp/sstep-2afa55.s:7584: Error: unrecognized opcode:lbarx' /tmp/sstep-2afa55.s:7626: Error: unrecognized opcode:stbcx.'/tmp/sstep-2afa55.s:8077: Error: unrecognized opcode:lharx' /tmp/sstep-2afa55.s:8140: Error: unrecognized opcode:stbcx.'Nick: any suggestions?
cpu-as-$(CONFIG_PPC_BOOK3S_64) += $(call as-option,-Wa$(comma)-mpower8,-Wa$(comma)-mpower4)
?
Thanks,
Nick