The module-ctf-flags code in Makefile.modpost uses $(wildcard) to include CTF
for all built-in modules (named *.builtin.ctf) inside dtrace_ctf.ko without
needing to know what its name is. Unfortunately, if the .config is changed to
make a built-in module modular, or to not build it at all, a stale .builtin.ctf
file persists, and is built in to dtrace_ctf.ko despite the absence of any
module corresponding to it.
Since all .builtin.ctf files are regenerated (named .builtin.ctf.new) on every
dwarf2ctf run, the solution is to delete .builtin.ctf files without corresponding
.new files on every dwarf2ctf run.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
$(ctf-stamp): $(builtins) $(modules:.ko=.o)
$(call if_changed,ctf)
@shopt -s nullglob; \
+ for name in $(ctf-dir)/*.builtin.ctf; do \
+ [[ -f $${name}.new ]] || rm -f $$name; \
+ done; \
for name in $(ctf-dir)/*.ctf.new; do \
scripts/move-if-change $$name $${name%.new}; \
done