powerpc: Fix compiling a BE kernel with a powerpc64le toolchain
authorNicholas Piggin <npiggin@gmail.com>
Sun, 27 Nov 2016 02:46:20 +0000 (13:46 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:28:17 +0000 (09:28 +0100)
commit7ae7408c4352747e0f5e4fde32bf1c692e38baea
treedf64cf7e6f1be1cdef30300a5bbc77f1de4757aa
parentcd662c8e51a1056407f851a02c08e1a74a3f9d0c
powerpc: Fix compiling a BE kernel with a powerpc64le toolchain

[ Upstream commit 4dc831aa88132f835cefe876aa0206977c4d7710 ]

GCC can compile with either endian, but the default ABI version is set
based on the default endianness of the toolchain. 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, which we were already doing.

This change adds ABI annotations together with endianness for all cases,
LE and BE. This fixes the case of building a BE kernel with a toolchain
that is LE by default.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/Makefile