ctf: avoid command-line length limits by passing .o filenames via a file
Historically, dwarf2ctf took the names of all object files it was to run over on
the command line. This can lead to very long command lines, but since the kernel
now supports lines of almost unlimited length (up to RLIMIT_STACK / 4, which is
much longer than the names of all .c files in the kernel tree added together for
any reasonable stack size), this seemed safe.
It turns out not to be, because GNU Make sometimes passes command lines through
the shell even when it doesn't need to, and GNU Bash does not yet know that the
kernel has a very long command-line length limit and protests if it is
> ARG_MAX, which is much shorter. We were trying to prevent the dwarf2ctf
command line being passed to the shell, but there is no documented way to do so
in GNU Make and clearly simply avoiding shell metacharacters is not always
enough.
So, instead, write out the list of object files to a file in the .ctf directory
and have dwarf2ctf read it in. This takes some trickery in Makefile.modpost to
arrange to invoke a separate shell to add each filename to the filelist, but
it's not too complicated. (To minimize the possibility of disruption, we
duplicate the code already used for reading blacklists in dwarf2ctf. This
should be unified later.)
Orabug:
17363469
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>