[PATCH 2/3] powerpc: allow compilation on cross-endian toolchain
Naveen N. Rao
naveen.n.rao at linux.vnet.ibm.com
Thu Feb 2 19:08:27 AEDT 2017
On 2016/11/27 01:46PM, Nicholas Piggin wrote:
> On Sat, 26 Nov 2016 18:30:15 +1100
> Michael Ellerman <mpe at ellerman.id.au> wrote:
>
> > Nicholas Piggin <npiggin at gmail.com> writes:
> > > On Thu, 24 Nov 2016 00:02:08 +1100
> > > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> > > index 617dece..8828807 100644
> > > --- a/arch/powerpc/Makefile
> > > +++ b/arch/powerpc/Makefile
> > > @@ -73,13 +73,18 @@ MULTIPLEWORD := -mmultiple
> > > endif
> > >
> > > cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian)
> > > +cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
> > > +cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mcall-aixdesc)
> >
> > This blew up the world:
> >
> > http://kisskb.ellerman.id.au/kisskb/head/1ba4cb3d67e181bdc9a911d7be81f64e3d7597d2/
> >
> > Successful: 24% 63/258
> >
> > I suspect you need to make -mcall-aixdesc 64-bit only.
>
> Yes, I forgot 32-bit will pick those up. 3rd time's a charm, this compiles
> 64 bit be/le and 32-bit now.
>
> --
>
> Subject: [PATCH] powerpc: allow compilation on cross-endian toolchain
>
> GCC can compile with either endian, but the ABI version always
> defaults to the default endian. Alan Modra says:
>
> you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
> generate powerpc64 code
>
> The opposite is true for powerpc64 when generating -mlittle it
> requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
> annotations together with endianness. The kernel with ELFv2 ABI
> also uses -mcall-aixdesc, but boot/ does not.
>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
FWIW, this fixes the issue with vmx build when doing a BE build with LE
toolchain:
/tmp/ccR5lr0U.s: Error: .size expression for aes_p8_set_encrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for .aes_p8_set_encrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for aes_p8_set_decrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for .aes_p8_set_decrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for aes_p8_encrypt does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for .aes_p8_encrypt does not evaluate to a constant
Tested-by: Naveen N. Rao <naveen.n.rao at linux.vnet.ibm.com>
Thanks,
Naveen
More information about the Linuxppc-dev
mailing list