Re: [PATCH] kbuild: Use ld.lld for linking host programs when LLVM is set

From: Nathan Chancellor

Date: Wed Jun 17 2026 - 18:52:14 EST


On Wed, 10 Jun 2026 12:55:25 -0700, Nathan Chancellor wrote:
> Currently, host programs are linked with HOSTCC using the toolchain's
> default linker. This can result in confusing behavior when using the
> LLVM Kbuild variable (which states that the user would like to build
> with the LLVM toolchain instead of the GNU one), as clang's default
> linker is ld for most platforms, not ld.lld. The documentation mentions
> HOSTLD=ld.lld is set but this variable is not used by Kbuild proper,
> only within some tools/ projects. Kbuild provides the HOSTLDFLAGS
> variable, which allow users to provide the '-fuse-ld' or '--ld-path'
> flags to customize what linker is used, but this is not super obvious to
> folks not familiar with Kbuild.
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next-unstable

Thanks!

[1/1] kbuild: Use ld.lld for linking host programs when LLVM is set
(no commit info)

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped or
reverted. Patches applied to an "unstable" branch are accepted pending
wider testing in -next and any post-commit review; they will generally
be moved to the main branch in a week if no issues are found.

Best regards,
--
Cheers,
Nathan