From b3008567ea0fa2942115d4c4013a16f3ff0e4952 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 16 Apr 2025 16:12:58 +0200 Subject: all: use LLVM=1 for building Linux with clang This is the standard way now. Since our configuration permits multiple parameter value combinations, explicitly check for the compiler and linker that were to be passed via CC and LD, and replace that with LLVM=1 if they were clang and ld.lld correspondingly. Update syz-kconf to rely on pkg/build's exported functionality for generating Linux kernel build arguments. --- pkg/build/linux.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/build/linux.go b/pkg/build/linux.go index 47c84c551..daf771e87 100644 --- a/pkg/build/linux.go +++ b/pkg/build/linux.go @@ -200,10 +200,17 @@ func LinuxMakeArgs(target *targets.Target, compiler, linker, ccache, buildDir st if ccache != "" { compiler = ccache + " " + compiler } - args = append(args, "CC="+compiler) } - if linker != "" { - args = append(args, "LD="+linker) + // The standard way to build Linux with clang is to pass LLVM=1 instead of CC= and LD=. + if compiler == targets.DefaultLLVMCompiler && (linker == "" || linker == targets.DefaultLLVMLinker) { + args = append(args, "LLVM=1") + } else { + if compiler != "" { + args = append(args, "CC="+compiler) + } + if linker != "" { + args = append(args, "LD="+linker) + } } if buildDir != "" { args = append(args, "O="+buildDir) -- cgit mrf-deployment