machine.c doesn't use any target-specific macro defined by the "migration/cpu.h" header. Use the minimum headers required: "migration/qemu-file-types.h" and "migration/vmstate.h", which are not target-specific. This allows to build this file as common object.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> Message-Id: <[email protected]> --- target/avr/machine.c | 3 ++- target/avr/meson.build | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/avr/machine.c b/target/avr/machine.c index 4402862fb96..8064a7214a3 100644 --- a/target/avr/machine.c +++ b/target/avr/machine.c @@ -20,7 +20,8 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "migration/cpu.h" +#include "migration/qemu-file-types.h" +#include "migration/vmstate.h" static int get_sreg(QEMUFile *f, void *opaque, size_t size, const VMStateField *field) diff --git a/target/avr/meson.build b/target/avr/meson.build index af5e7d63741..39e5eb02c2b 100644 --- a/target/avr/meson.build +++ b/target/avr/meson.build @@ -15,8 +15,7 @@ avr_ss.add(files( avr_common_system_ss = ss.source_set() avr_common_system_ss.add(files('gdbstub.c')) - -avr_system_ss.add(files('machine.c')) +avr_common_system_ss.add(files('machine.c')) target_arch += {'avr': avr_ss} target_system_arch += {'avr': avr_system_ss} -- 2.53.0
