Every time that I need to build a specific Android Kernel, it restarts the whole build from scratch, ignoring absolutely all previously built objects. In other words, it doesn't matter if I had touched or not any file in the source tree or even if I have successfully built the Kernel before.
The "problematic" Kernel is this one:
It's based on the official
daisy(Xiaomi Mi A2 Lite) Kernel for Android 8.1The Kernel version is 3.18.71
The ROM where this Kernel runs is the stock
Since the Kernel above was modified by me, you can find the official untouched one here (and there's also a mirror of it in a branch called
daisy-o-ossat the samedaisy_kernelrepo)The expected behavior should be
maketo skip everything that was already built while their source files keeps unchangedmakedoesn't show any errorsI've tried to use ccache, but
makealso ignored the cached objectsDespite it's been 1-year now, I remember that even newer
daisyKernels (from Android 9, 10 and unofficial 11) also suffer from this same same hazard
The used LLM pointed three possible reasons for this issue:
include/generated/bounds.handinclude/generated/asm-offsets.hbeing regenerated by the rootKbuild. This seems to be fixed when I added an "integrity test" to bothcmd_boundspresent in the file, like this:define cmd_bounds (set -e; \ ... echo "#endif" ) > $@.tmp; \ if [ -r $@ ] && cmp -s $@ $@.tmp; then rm -f $@.tmp; else mv -f $@.tmp $@; fi # this line endefFORCEdependency of.PHONYtarget (filesMakefileandscripts/Makefile.build), but it seems to be skipped when I run the buildSome unknown dependency of toolchain error triggering the rebuild of
init/main.o. This one seems to be the closest candidate, but I still was unable to figure out what may be calling it