]> git.karo-electronics.de Git - karo-tx-linux.git/commit
powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 26 Jul 2017 13:19:04 +0000 (23:19 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 28 Jul 2017 09:35:46 +0000 (19:35 +1000)
commit65c5ec11c25eff6ba6e9b1cbfff014875fddd1e0
tree5d5c6d3882e07258fcca4453ace80daa797f679c
parent7b7622bb95eb587cbaa79608e47b832a82a262b1
powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler

Historically the boot wrapper was always built 32-bit big endian, even
for 64-bit kernels. That was because old firmwares didn't necessarily
support booting a 64-bit image. Because of that arch/powerpc/boot/Makefile
uses CROSS32CC for compilation.

However when we added 64-bit little endian support, we also added
support for building the boot wrapper 64-bit. However we kept using
CROSS32CC, because in most cases it is just CC and everything works.

However if the user doesn't specify CROSS32_COMPILE (which no one ever
does AFAIK), and CC is *not* biarch (32/64-bit capable), then CROSS32CC
becomes just "gcc". On native systems that is probably OK, but if we're
cross building it definitely isn't, leading to eg:

  gcc ... -m64 -mlittle-endian -mabi=elfv2 ... arch/powerpc/boot/cpm-serial.c
  gcc: error: unrecognized argument in option ‘-mabi=elfv2’
  gcc: error: unrecognized command line option ‘-mlittle-endian’
  make: *** [zImage] Error 2

To fix it, stop using CROSS32CC, because we may or may not be building
32-bit. Instead setup a BOOTCC, which defaults to CC, and only use
CROSS32_COMPILE if it's set and we're building for 32-bit.

Fixes: 147c05168fc8 ("powerpc/boot: Add support for 64bit little endian wrapper")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>
arch/powerpc/boot/Makefile