Skip to content

Commit

Permalink
Support the Linux kernel compilation in clang containers
Browse files Browse the repository at this point in the history
  • Loading branch information
a13xp0p0v committed Sep 4, 2021
1 parent 748e1e7 commit 68a6801
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion make_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


supported_archs = ['x86_64', 'i386', 'aarch64']
supported_compilers = ['gcc-4.8', 'gcc-5', 'gcc-6', 'gcc-7', 'gcc-8', 'gcc-9', 'gcc-10', 'gcc-11', 'all']
supported_compilers = ['gcc-4.8', 'gcc-5', 'gcc-6', 'gcc-7', 'gcc-8', 'gcc-9', 'gcc-10', 'gcc-11', 'clang-12', 'all']

name_delimiter = '__'

Expand Down Expand Up @@ -73,6 +73,10 @@ def build_kernel(arch, kconfig, src, out, compiler, make_args):

start_container_cmd = ['bash', './start_container.sh', compiler, src, out_subdir, '-n', 'make', 'O=~/out/']

if compiler.startswith('clang'):
print('Compiling with clang requires \'CC=clang\'')
start_container_cmd.extend(['CC=clang'])

cross_compile_args = get_cross_compile_args(arch)
if cross_compile_args:
print("Create additional arguments for cross-compilation: {}".format(' '.join(cross_compile_args)))
Expand Down Expand Up @@ -156,6 +160,8 @@ def main():
sys.exit('[-] Don\'t specify "ARCH=", we will take care of that')
if arg.startswith('CROSS_COMPILE='):
sys.exit('[-] Don\'t specify "CROSS_COMPILE=", we will take care of that')
if arg.startswith('CC='):
sys.exit('[-] Don\'t specify "CC=", we will take care of that')

build_kernels(args.a, args.k, args.s, args.o, compilers, make_args)

Expand Down

0 comments on commit 68a6801

Please sign in to comment.