kbuild/ctf: Use shell expansion, not $(wildcard ...), for CTF section copying.
The stub module kernel/ctf/ctf.ko must contain sections for all CTF for the core
kernel, CTF shared between modules and CTF for every built-in module. This set
can vary as the kernel configuration changes: it is computed by dwarf2ctf from
objects.builtin, modules.builtin, and analysis of the debugging information in
the object files comprising the kernel build.
This means that we must dynamically construct the command line for the objcopy
which inserts these sections into the final .ko, as it is not known until
recipes are executed. This is done via the module-ctf-flags variable, which is
expanded into cmd_ld_ko_o. We chose to use the GNU Make wildcard function to
determine the set of builtin modules, but this has turned out to be problematic,
because, though it is nowhere documented, the output of this function is often
cached if the directory exists. glob lookups will rescan it as needed, but
$(wildcard) seemingly does not, and can often produce inaccurate or even empty
lists even when many files matching the wildcard have existed for some time.
This shows up as (often parallel) makes failing to insert any CTF sections into
kernel/ctf/ctf.ko, with DTrace subsequently failing because the CTF for the core
kernel and inter-module shared types was missing.
For now, work around this bug by using shell expansion instead. (This
particular part of the module-ctf-flags is only expanded once, for one module,
and only after a period of computation by dwarf2ctf lasting many minutes, so no
negative impact on build times from this shell loop is expected.)
Orabug:
17445637
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>