Commit 9d90161c authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64: Force ELFv2 when building with LLVM linker

The LLVM linker does not support ELFv1 at all, so BE kernels must be
built with ELFv2. The LLD version check was added to be conservative,
LLD simply fails to link ELFv1 entirely, effectively requiring LLD >= 15
and ELFv2 for BE builds. Instead remove that restriction until proven
otherwise (LLD 14.0 links a booting ELFv2 BE vmlinux for me).

The minimum GNU binutils has increased such that ELFv2 is always
supported, so remove that check while we're here.
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606093832.199712-2-npiggin@gmail.com
parent f5df87b8
...@@ -624,10 +624,10 @@ config ARCH_HAS_KEXEC_PURGATORY ...@@ -624,10 +624,10 @@ config ARCH_HAS_KEXEC_PURGATORY
def_bool KEXEC_FILE def_bool KEXEC_FILE
config PPC64_BIG_ENDIAN_ELF_ABI_V2 config PPC64_BIG_ENDIAN_ELF_ABI_V2
bool "Build big-endian kernel using ELF ABI V2 (EXPERIMENTAL)" prompt "Build big-endian kernel using ELF ABI V2 (EXPERIMENTAL)" if LD_IS_BFD
def_bool y if LD_IS_LLD
depends on PPC64 && CPU_BIG_ENDIAN depends on PPC64 && CPU_BIG_ENDIAN
depends on CC_HAS_ELFV2 depends on CC_HAS_ELFV2
depends on LD_VERSION >= 22400 || LLD_VERSION >= 150000
help help
This builds the kernel image using the "Power Architecture 64-Bit ELF This builds the kernel image using the "Power Architecture 64-Bit ELF
V2 ABI Specification", which has a reduced stack overhead and faster V2 ABI Specification", which has a reduced stack overhead and faster
...@@ -638,8 +638,6 @@ config PPC64_BIG_ENDIAN_ELF_ABI_V2 ...@@ -638,8 +638,6 @@ config PPC64_BIG_ENDIAN_ELF_ABI_V2
it is less well tested by kernel and toolchain. However some distros it is less well tested by kernel and toolchain. However some distros
build userspace this way, and it can produce a functioning kernel. build userspace this way, and it can produce a functioning kernel.
This requires GCC and binutils 2.24 or newer.
config RELOCATABLE config RELOCATABLE
bool "Build a relocatable kernel" bool "Build a relocatable kernel"
depends on PPC64 || (FLATMEM && (44x || PPC_85xx)) depends on PPC64 || (FLATMEM && (44x || PPC_85xx))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment