remarkable-linux/arch
Michael Ellerman b40b2386bc powerpc/Makefile: Fix ld version check with 64-bit LE-only toolchain
In commit efe0160cfd ("powerpc/64: Linker on-demand sfpr functions
for modules"), we added an ld version check early in the powerpc
top-level Makefile.

Because the Makefile runs before the kernel config is setup, the
checks for CONFIG_CPU_LITTLE_ENDIAN etc. all take the default case. So
we end up configuring ld for 32-bit big endian.

That would be OK, except that for historical (or perhaps no) reason,
we use 'override LD' to add the endian flags to the LD variable
itself, rather than the normal approach of adding them to LDFLAGS.

The end result is that when we check the ld version we run it as:

  $(CROSS_COMPILE)ld -EB -m elf32ppc --version

This often works, unless you are using a 64-bit only and/or little
endian only, toolchain. In which case you see something like:

  $ make defconfig
  powerpc64le-linux-ld: unrecognised emulation mode: elf32ppc
  Supported emulations: elf64lppc elf32lppc elf32lppclinux elf32lppcsim
  /bin/sh: 1: [: -ge: unexpected operator

The proper fix is to stop using 'override LD', but that will require a
fair bit of testing. Instead we can fix it for now just by reordering
the Makefile to do the version check earlier.

Fixes: efe0160cfd ("powerpc/64: Linker on-demand sfpr functions for modules")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-07-26 16:41:54 +10:00
..
alpha Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
arc Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 16:14:51 -07:00
arm pci-v4.13-changes 2017-07-08 15:51:57 -07:00
arm64 pci-v4.13-changes 2017-07-08 15:51:57 -07:00
blackfin - Core Frameworks 2017-07-07 13:38:26 -07:00
c6x This is the first pull request for the new dma-mapping subsystem 2017-07-06 19:20:54 -07:00
cris Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
frv Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
h8300 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 16:14:51 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2017-07-06 22:27:08 -07:00
ia64 Kbuild thin archives updates for v4.13 2017-07-07 15:11:12 -07:00
m32r Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
m68k Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
metag Merge branch 'akpm' (patches from Andrew) 2017-07-06 22:27:08 -07:00
microblaze Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
mips pci-v4.13-changes 2017-07-08 15:51:57 -07:00
mn10300 Merge branch 'akpm' (patches from Andrew) 2017-07-06 22:27:08 -07:00
nios2 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 16:14:51 -07:00
openrisc OpenRISC fixes for 4.13 2017-07-07 13:58:49 -07:00
parisc Merge branch 'akpm' (patches from Andrew) 2017-07-06 22:27:08 -07:00
powerpc powerpc/Makefile: Fix ld version check with 64-bit LE-only toolchain 2017-07-26 16:41:54 +10:00
s390 Merge branch 'akpm' (patches from Andrew) 2017-07-06 22:27:08 -07:00
score Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
sh Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2017-07-08 12:39:37 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2017-07-08 12:14:14 -07:00
tile Kbuild thin archives updates for v4.13 2017-07-07 15:11:12 -07:00
um Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
unicore32 signal: Remove non-uapi <asm/siginfo.h> 2017-06-04 15:11:47 +02:00
x86 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-09 11:21:31 -07:00
xtensa Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
.gitignore
Kconfig Kbuild thin archives updates for v4.13 2017-07-07 15:11:12 -07:00