Re: -next build error due to "kbuild: Leave objtool binary around with 'make clean'"

From: Thorsten Leemhuis

Date: Tue Mar 03 2026 - 01:01:36 EST


On 3/2/26 21:49, Nathan Chancellor wrote:
> On Mon, Mar 02, 2026 at 08:43:57PM +0100, Michal Suchánek wrote:
>> On Mon, Mar 02, 2026 at 08:18:17PM +0100, Thorsten Leemhuis wrote:
>>> On 2/28/26 06:40, Nathan Chancellor wrote:
>>>> The difference between 'make clean' and 'make mrproper' is documented in
>>>> 'make help' as:
>>> [...]
>>> Thx for fixing this regression, sadly this caused my daily -next rpm
>>> builds for Fedora to fail on x86_64 during a "make mrproper":
>>>
>>> ""
>>> kernel.spec:2485: InitBuildVars: Copy files
>>> + /usr/bin/make -s 'HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 ' 'HOSTLDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' -j32 mrproper
>>> find: cannot delete ‘/builddir/build/BUILD/kernel-7.0.0-build/kernel-next-20260302/linux-7.0.0-0.0.next.20260302.121.vanilla.fc42.x86_64/tools/objtool/.check.o.cmd’: No such file or directory
>>> find: cannot delete ‘/builddir/build/BUILD/kernel-7.0.0-build/kernel-next-20260302/linux-7.0.0-0.0.next.20260302.121.vanilla.fc42.x86_64/tools/objtool/.elf.o.cmd’: No such file or directory
>>> [and many more like these]
>>> ""
>>> For the full build log, see:
>>> https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-42-x86_64/10183736-next-next-all/builder-live.log.gz
> [...]
>> Or does the objtool_clean run multiple times in parallel, once through
>> the clean target, and once as dependency of the mrproper target?
>
> More than likely this based on my reading of the submake processes from
> the build log. For what it's worth, I cannot reproduce this error on
> either a really fast or really slow build machine but it should not be
> hard to avoid by using 'xargs rm -f' like the rest of Kbuild does for
> removing things, which should suppress the error if the file does not
> exist. Thorsten, could you see if this diff makes a difference for you?

Yeah, that makes things work again, thx!

> If so, I'll squash it in with a note.

Great, thx!

Ciao, Thorsten

> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index 50d3e38e6137..76bcd4e85de3 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -142,7 +142,7 @@ $(LIBSUBCMD)-clean:
> $(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT)
>
> clean: $(LIBSUBCMD)-clean
> - $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
> + $(Q)find $(OUTPUT) \( -name '*.o' -o -name '\.*.cmd' -o -name '\.*.d' \) -type f -print | xargs $(RM)
> $(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep
> $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
> $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool