HomeFreeBSD

WITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds.

Description

WITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds.

A simplified example of the library targets with WITH_DEBUG_FILES is:

libgeom.so.5: libgeom.so.5.full
   cp libgeom.so.5.full libgeom.so.5

libgeom.so.5.full:
   ln -s libgeom.so.5 libgeom.so
   cc -o libgeom.so.5.full *.o

Before, or without, WITH_DEBUG_FILES it is:

libgeom.so.5:
   ln -s libgeom.so.5 libgeom.so
   cc -o libgeom.so.5 *.o

The problem is that bmake considers the link source for the libgeom.so
link in the libgeom.so.5.full target as being a dependency for
libgeom.so.5.full. That resolves to libgeom.so.5. Thus a cyclic
dependency is created. The result of this is that if libgeom.so.5 is
created with a newer timestamp than libgeom.so.5.full, then
libgeom.so.5.full will be rebuilt on the next build. This causes a
chain reaction of everything in the build relinking, or hitting the
problem itself.

Moving the link creation to the target that actually creates
libgeom.so.5 fixes the problem. The simplest fix here is to just
duplicate the logic.

Submitted by: sjg
Approved by: re (implicit)

Details

Provenance
bdreweryAuthored on
Parents
rS301879: makefs: Provide a -T option to set timestamps to a consistent value
Branches
Unknown
Tags
Unknown