Re: [tip: x86/urgent] x86/build: Do not allow X86_NATIVE_CPU to be enabled when compile testing
From: Nathan Chancellor
Date: Wed Nov 18 2026 - 23:17:27 EST
On Wed, Nov 18, 2026 at 09:00:35AM +0000, David Laight wrote:
> On Wed, 18 Nov 2026 00:28:48 -0700
> Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
> > $ make ARCH=... LLVM=1
> >
> > is generally all you need to do nowadays.
> >
>
> That requires that you also get the correct clang on $PATH.
> I'm sure I remember that not being as easy as it might seem.
Since
e9c281928c24 ("kbuild: Make $(LLVM) more flexible")
in 5.18, you can pass a full prefix to clang, which can help ensure you
are using the right toolchain since the build will error if you do not
point it to the right path:
$ make -skj"$(nproc)" ARCH=arm64 LLVM=/doesnt/exist/bin/ mrproper defconfig
make[3]: /doesnt/exist/bin/clang: No such file or directory
make[3]: /doesnt/exist/bin/clang: No such file or directory
/bin/sh: line 1: /doesnt/exist/bin/clang: No such file or directory
make[4]: *** [scripts/Makefile.host:114: scripts/basic/fixdep] Error 127
I use that when I am building with the kernel.org toolchains because
they live on disk in my home folder then I have clang tip in my path
that I can use with just LLVM=1.
--
Cheers,
Nathan