On 14/06/21 10:34, Paolo Bonzini wrote:
- modinfo.json needs to be disabled on non-ELF platforms (x86, Windows).
One alternative is to use libbfd instead of including an ELF parser.
- If modinfo.json has to be installed, you need to build modinfo for the
build machine in order to support cross compiling. That however would
require a cross libbfd, which is a pain. Do you really need to install
it? Can the functionality instead be included in the main QEMU binary
with a query-modules command or something like that.
Another possibility to eschew .o parsing is to add something like this
to the sources
#ifdef QEMU_MODINFO
#define MODULE_METADATA(key, value) \
=<>= MODINFO key value
#else
#define MODULE_METADATA(key, value)
#endif
MODULE_METADATA("opts", "spice")
A Python script could parse compile_commands.json, add -E -DQEMU_MODINFO
to the command-line option, and look in the output for the metadata.
Paolo