Hi Ihor, On Mon, Dec 29, 2025 at 12:40:10PM -0800, Ihor Solodrai wrote: > I think the simplest workaround is this one: use objcopy from binutils > instead of llvm-objcopy when doing --update-section. > > There are just 3 places where that happens, so the OBJCOPY > substitution is going to be localized. > > Also binutils is a documented requirement for compiling the kernel, > whether with clang or not [1]. > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/changes.rst?h=v6.18#n29
This would necessitate always specifying a CROSS_COMPILE variable when cross compiling with LLVM=1, which I would really like to avoid. The LLVM variants have generally been drop in substitutes for several versions now so some groups such as Android may not even have GNU binutils installed in their build environment (see a recent build fix [1]). I would much prefer detecting llvm-objcopy in Kconfig (such as by creating CONFIG_OBJCOPY_IS_LLVM using the existing check for llvm-objcopy in X86_X32_ABI in arch/x86/Kconfig) and requiring a working copy (>= 22.0.0 presuming the fix is soon merged) or an explicit opt into GNU objcopy via OBJCOPY=...objcopy for CONFIG_DEBUG_INFO_BTF to be selectable. > Patching llvm-objcopy would be great, it should be done. But we are > still going to be stuck with making sure older LLVMs can build the kernel. > So even if they backport the fix to v21, it won't help us much, unfortunately. 21.1.8 was the last planned 21.x release [2] so I think it is unlikely that a 21.1.9 would be released for this but we won't know until it is merged into main. Much agreed on handling the old versions. [1]: https://lore.kernel.org/[email protected]/ [2]: https://discourse.llvm.org/t/llvm-21-1-8-released/89144 Cheers, Nathan

