]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kbuild: userprogs: use correct linker when mixing clang and GNU ld
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Mon, 28 Jul 2025 13:47:37 +0000 (15:47 +0200)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 6 Aug 2025 01:23:36 +0000 (10:23 +0900)
commit936599ca514973d44a766b7376c6bbdc96b6a8cc
tree94c1825c0cc447b62b0b870a2bc1ed93a996b19b
parent5ac726653a1029a2eccba93bbe59e01fc9725828
kbuild: userprogs: use correct linker when mixing clang and GNU ld

The userprogs infrastructure does not expect clang being used with GNU ld
and in that case uses /usr/bin/ld for linking, not the configured $(LD).
This fallback is problematic as it will break when cross-compiling.
Mixing clang and GNU ld is used for example when building for SPARC64,
as ld.lld is not sufficient; see Documentation/kbuild/llvm.rst.

Relax the check around --ld-path so it gets used for all linkers.

Fixes: dfc1b168a8c4 ("kbuild: userprogs: use correct lld when linking through clang")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile