From cf01b7786199e0fbe31ba431eb2880bdfdd6c63b Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Sat, 1 Jul 2023 09:26:40 -0700 Subject: [PATCH] tc_build: kernel: Build ppc64_guest_defconfig with LLVM=1 Now that commit 9d90161ca5c7 ("powerpc/64: Force ELFv2 when building with LLVM linker") is in mainline, we can ditch ld.bfd for powerpc64 big endian. Additionally, the integrated assembler has worked since LLVM 14.0.2 just like for powerpc64le, so hoist those decisions into PowerPC64KernelBuilder and make PowerPC64LEKernelBuilder a subclass of it, so that both builds can use LLVM=1 for all LLVM versions that the kernel currently supports. Signed-off-by: Nathan Chancellor --- tc_build/kernel.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tc_build/kernel.py b/tc_build/kernel.py index 6ec22c40..b1c5262e 100644 --- a/tc_build/kernel.py +++ b/tc_build/kernel.py @@ -16,7 +16,7 @@ class KernelBuilder(Builder): # If the user supplies their own kernel source, it must be at least this # version to ensure that all the build commands work, as the build commands # were written to target at least this version. - MINIMUM_SUPPORTED_VERSION = (6, 1, 7) + MINIMUM_SUPPORTED_VERSION = (6, 5, 0) def __init__(self, arch): super().__init__() @@ -196,11 +196,16 @@ def __init__(self): self.config_targets = ['ppc64_guest_defconfig', 'disable-werror.config'] self.cross_compile = 'powerpc64-linux-gnu-' - # https://github.com/ClangBuiltLinux/linux/issues/602 - self.make_variables['LD'] = self.cross_compile + 'ld' + # https://github.com/llvm/llvm-project/commit/33504b3bbe10d5d4caae13efcb99bd159c126070 + def can_use_ias(self): + return self.toolchain_version >= (14, 0, 2) + + # https://github.com/ClangBuiltLinux/linux/issues/1601 + def needs_binutils(self): + return True -class PowerPC64LEKernelBuilder(PowerPCKernelBuilder): +class PowerPC64LEKernelBuilder(PowerPC64KernelBuilder): def __init__(self): super().__init__() @@ -216,14 +221,6 @@ def build(self): super().build() - # https://github.com/llvm/llvm-project/commit/33504b3bbe10d5d4caae13efcb99bd159c126070 - def can_use_ias(self): - return self.toolchain_version >= (14, 0, 2) - - # https://github.com/ClangBuiltLinux/linux/issues/1601 - def needs_binutils(self): - return True - class RISCVKernelBuilder(KernelBuilder):