Skip to content

Commit

Permalink
crunchgen: slap a dependency on the generated makefile for .lo
Browse files Browse the repository at this point in the history
crunchgen generates a foo.lo for each binary it will end up crunching
into the final product.  While they have a dependency on the libs that
are used to link them, nothing will force relinking if the set of libs
needed to link them is changed.  Because of this, incremental builds may
not be possible if one builds a version of, e.g., rescue/ with a broken
set of libs specified for a project -- a subsequent fix won't be rolled
in cleanly, it will require purging the rescue/ objdir.

This is a bit crude, but the foo.mk we generate doesn't actually get
regenerated all that often in practice, so a spurious relink for the
vast majority of crunched objects won't actually happen all that often.

Reviewed by:	bapt, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D43869
  • Loading branch information
kevans91 authored and bsdjhb committed Aug 3, 2024
2 parents 3089cda + 6e2cfb2 commit cfb1786
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usr.sbin/crunch/crunchgen/crunchgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ prog_makefile_rules(FILE *outmk, prog_t *p)
"int _crunched_%s_stub(int argc, char **argv, char **envp)"
"{return main(argc,argv,envp);}\" >%s_stub.c\n",
p->ident, p->ident, p->name);
fprintf(outmk, "%s.lo: %s_stub.o $(%s_OBJPATHS)",
p->name, p->name, p->ident);
fprintf(outmk, "%s.lo: %s_stub.o $(%s_OBJPATHS) %s",
p->name, p->name, p->ident, outmkname);
if (p->libs)
fprintf(outmk, " $(%s_LIBS)", p->ident);

Expand Down

0 comments on commit cfb1786

Please sign in to comment.