I have the same repository to cross-compile a Linux kernel on ubuntu 20.04 and ubuntu 24.04. More preicsely, I do:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules -j4
On both distro, I'm using amd64 gcc 9.5 and the same cross-compilation toolchain.
On Ubuntu 24.04, the compilation recompiles EVERYTHING each time even if any file has not been changed. It's not happening on Ubuntu 20.04.
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules -j4 CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CC scripts/mod/empty.o CC scripts/mod/devicetable-offsets.s MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o GEN scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o CHK include/generated/utsrelease.h CHK include/generated/timeconst.h CC kernel/bounds.s CHK include/generated/bounds.h CC arch/arm64/kernel/asm-offsets.s CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh HOSTLD scripts/mod/modpost CC init/main.o ....
File stamps have not been changed and everything else is the same. In other words, the only difference is Ubuntu 24.04 vs. Ubuntu 20.04.
How is that possible that everything gets recompiled on 24.04 and not on 20.04 (expected behavior)?