linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/Makefiles: Fix clang/llvm build
@ 2018-08-21  1:02 Anton Blanchard
  2018-08-21  5:18 ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2018-08-21  1:02 UTC (permalink / raw)
  To: benh, paulus, mpe, npiggin; +Cc: linuxppc-dev

From: Anton Blanchard <anton@samba.org>

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

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 8397c7bd5880..4d9c01df0dec 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -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)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/Makefiles: Fix clang/llvm build
  2018-08-21  1:02 [PATCH] powerpc/Makefiles: Fix clang/llvm build Anton Blanchard
@ 2018-08-21  5:18 ` Michael Ellerman
  2018-08-21  5:38   ` Anton Blanchard
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2018-08-21  5:18 UTC (permalink / raw)
  To: Anton Blanchard, benh, paulus, npiggin; +Cc: linuxppc-dev

Anton Blanchard <anton@ozlabs.org> writes:

> From: Anton Blanchard <anton@samba.org>
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/Makefiles: Fix clang/llvm build
  2018-08-21  5:18 ` Michael Ellerman
@ 2018-08-21  5:38   ` Anton Blanchard
  2018-08-21  6:25     ` Nicholas Piggin
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2018-08-21  5:38 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: benh, paulus, npiggin, linuxppc-dev

Hi Michael,

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/Makefiles: Fix clang/llvm build
  2018-08-21  5:38   ` Anton Blanchard
@ 2018-08-21  6:25     ` Nicholas Piggin
  0 siblings, 0 replies; 4+ messages in thread
From: Nicholas Piggin @ 2018-08-21  6:25 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: Michael Ellerman, benh, paulus, linuxppc-dev

On Tue, 21 Aug 2018 15:38:39 +1000
Anton Blanchard <anton@ozlabs.org> wrote:

> Hi Michael,
> 
> > 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?

 cpu-as-$(CONFIG_PPC_BOOK3S_64)	+= $(call as-option,-Wa$(comma)-mpower8,-Wa$(comma)-mpower4)

?

Thanks,
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-21  6:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21  1:02 [PATCH] powerpc/Makefiles: Fix clang/llvm build Anton Blanchard
2018-08-21  5:18 ` Michael Ellerman
2018-08-21  5:38   ` Anton Blanchard
2018-08-21  6:25     ` Nicholas Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).