Restat make's kernel_version_for_uffd_gc.txt installation rule

The cmdline of this file differs between soong and make. This causes a
non-null build when switching between `m` and `m --soong-only`.

m --soong-only ameliorates this by restating this file and trimming
rdeps (buildprop, build_image ...). This CL adds the restat to the make
installation rule.

Bug: 390471378
Test: with https://r.android.com/3462599
Test: m
out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_odm_image/android_common/odm.img
--soong-only
(only cmp of kernel_version_for_uffd_gc.txt)
Test: m out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_odm_image/android_common/odm.img
(only cmp of kernel_version_for_uffd_gc.txt)

Change-Id: I8bd6bbe03a3e6f68a6cb3deb5e3993fb11aa00d8
diff --git a/core/Makefile b/core/Makefile
index 5d82c21..ada5be5 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -5441,7 +5441,8 @@
 ifneq (,$(BUILT_KERNEL_VERSION_FILE))
 $(BUILT_KERNEL_VERSION_FILE_FOR_UFFD_GC): $(BUILT_KERNEL_VERSION_FILE)
 $(BUILT_KERNEL_VERSION_FILE_FOR_UFFD_GC):
-	cp $(BUILT_KERNEL_VERSION_FILE) $(BUILT_KERNEL_VERSION_FILE_FOR_UFFD_GC)
+	if ! cmp -s $(BUILT_KERNEL_VERSION_FILE) $@ ; then cp $(BUILT_KERNEL_VERSION_FILE) $@; fi
+.KATI_RESTAT: $(BUILT_KERNEL_VERSION_FILE_FOR_UFFD_GC)
 else
 # We make this a warning rather than an error to avoid breaking too many builds. When it happens,
 # we use a placeholder as the kernel version, which is consumed by uffd_gc_utils.py.