diff options
author | Pierrick Bouvier <pierrick.bouvier@linaro.org> | 2024-11-21 16:58:03 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-11-25 10:27:43 +0000 |
commit | 1ef08e341f2e134bb06f1a5279032fc44917183b (patch) | |
tree | ba79057dd1db21a87443ae67e8e865b932faa1eb /plugins | |
parent | cfa3a6c54511374e9ccee26d9c38ac1698fc7af2 (diff) |
plugins: detect qemu plugin API symbols from header
Instead of using a static file (error prone and hard to keep in sync),
we generate it using a script.
Note: if a symbol is not exported, we'll now notice it when linking for
Windows/MacOS platforms.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20241112212622.3590693-3-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20241121165806.476008-37-alex.bennee@linaro.org>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/meson.build | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/meson.build b/plugins/meson.build index 1cc039d29b..98542e926f 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -2,17 +2,23 @@ if not get_option('plugins') subdir_done() endif +qemu_plugin_symbols = configure_file( + input: files('../include/qemu/qemu-plugin.h'), + output: 'qemu-plugin.symbols', + capture: true, + command: [files('../scripts/qemu-plugin-symbols.py'), '@INPUT@']) + # Modules need more symbols than just those in plugins/qemu-plugins.symbols if not enable_modules if host_os == 'darwin' configure_file( - input: files('qemu-plugins.symbols'), + input: qemu_plugin_symbols, output: 'qemu-plugins-ld64.symbols', capture: true, command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@']) emulator_link_args += ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols'] else - emulator_link_args += ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')] + emulator_link_args += ['-Xlinker', '--dynamic-list=' + qemu_plugin_symbols.full_path()] endif endif @@ -23,7 +29,7 @@ if host_os == 'windows' # First, create a .def file listing all the symbols a plugin should expect to have # available in qemu win32_plugin_def = configure_file( - input: files('qemu-plugins.symbols'), + input: qemu_plugin_symbols, output: 'qemu_plugin_api.def', capture: true, command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) |