Re: kbuild: Ctrl-C of parallel kernel build sometimes corrupts .o.cmd files permanently

From: Ingo Molnar
Date: Thu Jun 03 2021 - 08:44:16 EST



* Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> > CC security/keys/keyctl_pkey.o
> > CC kernel/sys.o
> > CC arch/x86/power/hibernate_64.o
> > ^Cmake[5]: *** Deleting file 'drivers/video/fbdev/core/fbcmap.o' <---- Deleting
> > make[5]: *** [scripts/Makefile.build:272:
> > drivers/video/fbdev/core/fbmon.o] Interrupt
> > make[3]: *** [scripts/Makefile.build:272: security/selinux/nlmsgtab.o] Interrupt
> > make[2]: *** [scripts/Makefile.build:272: arch/x86/power/cpu.o] Interrupt
> > make[2]: *** [scripts/Makefile.build:272:
>
> Interestingly I don't get *any* interruption messages at all:
>
> CC drivers/dma/dw/acpi.o
> CC sound/pci/ice1712/ice1712.o
> CC drivers/char/ipmi/ipmi_watchdog.o
> CC fs/overlayfs/export.o
> CC fs/nls/nls_cp936.o
> CC drivers/char/ipmi/ipmi_poweroff.o
> ^Ckepler:~/tip>
>
> The '^C' there - it just stops, make never prints anything for me.

Found something - seems to be related whether the build is going into a
pipe or not.


I usually build this way (directly or via a script):

make -j96 bzImage ARCH=x86 2>&1 | tee e

Ctrl-C interruption is not handled by kbuild in this case:

CC fs/jffs2/xattr_trusted.o
CC sound/firewire/motu/motu-transaction.o
CC sound/usb/clock.o
^Ckepler:~/tip>

Immediate prompt - no cleanup sequence.

But if I do it without 'tee', I get the expected cleanup sequence by make:

kepler:~/tip> make -j96 bzImage ARCH=x86 2>&1

CC fs/jffs2/acl.o
CC sound/pci/echoaudio/mona.o
CC fs/nls/nls_iso8859-9.o
^Cmake[2]: *** Deleting file 'drivers/reset/core.o'
make[3]: *** Deleting file 'sound/pci/mixart/mixart.o'
make[3]: *** Deleting file 'sound/pci/emu10k1/voice.o'
make[2]: *** Deleting file 'fs/gfs2/aops.o'

Thanks,

Ingo