Page MenuHomeFreeBSD

Don't delete hack.c - causes perpetual 'out of date' kernel
ClosedPublic

Authored by obrien on Feb 15 2022, 1:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 2, 12:34 AM
Unknown Object (File)
Mon, Dec 2, 12:34 AM
Unknown Object (File)
Mon, Dec 2, 12:34 AM
Unknown Object (File)
Mon, Dec 2, 12:34 AM
Unknown Object (File)
Mon, Dec 2, 12:13 AM
Unknown Object (File)
Fri, Nov 29, 6:21 PM
Unknown Object (File)
Sat, Nov 16, 8:25 AM
Unknown Object (File)
Tue, Nov 5, 6:04 PM

Details

Summary

Deleting hack.c cause the kernel to always be out of date:

   $ make kernel
   make: /usr/src/sys/amd64/compile/GENERIC/.depend.hack.pico, 1:
	     ignoring stale .depend for hack.c
   :> hack.c
   cc -shared -O2 -pipe ... -nostdlib hack.c -o hack.pico
   rm -f hack.c
   MAKE="make" sh ../../../conf/newvers.sh "-R" GENERIC
   cc -c -O2 -pipe ...  -std=iso9899:1999 -Werror  vers.c
   ctfconvert -L VERSION -g vers.o
   linking kernel.full

Keeping hack.c in the compile directory causes no harm,
so there's no reason to delete it.

Test Plan

configure GENERIC ; cd ../compile/GENERIC ; make kernel ; make kernel

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/conf/kern.post.mk
236

Why is there not simply a hack.c target:

hack.c:
      :> $@

might even be worth renaming it to its purpose force-dynamic-hack.c ?

Updating based on sjg's input.

This revision is now accepted and ready to land.Feb 16 2022, 7:41 PM
emaste added inline comments.
sys/conf/kern.post.mk
234

:> ${.TARGET} perhaps?

238

-o ${.TARGET} perhaps?