Skip to content

Commit

Permalink
tc_build: kernel: Build ppc64_guest_defconfig with LLVM=1
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nathanchance committed Jul 16, 2023
1 parent c0f2d2c commit cf01b77
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions tc_build/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down Expand Up @@ -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__()
Expand All @@ -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):

Expand Down

0 comments on commit cf01b77

Please sign in to comment.