On 4/3/25 16:57, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> meson.build | 1 +
> target/arm/target_info-aarch64-softmmu.c | 24 ++++++++++++++++++++++++
> target/arm/target_info-arm-softmmu.c | 24 ++++++++++++++++++++++++
> target/arm/meson.build | 5 +++++
> 4 files changed, 54 insertions(+)
> create mode 100644 target/arm/target_info-aarch64-softmmu.c
> create mode 100644 target/arm/target_info-arm-softmmu.c
>
> diff --git a/meson.build b/meson.build
> index b93253166c8..9df662932a4 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3263,6 +3263,7 @@ host_kconfig = \
> ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
>
> target_info = [
> + 'arm-softmmu', 'aarch64-softmmu',
> ]
>
> default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
> diff --git a/target/arm/target_info-aarch64-softmmu.c b/target/arm/target_info-aarch64-softmmu.c
> new file mode 100644
> index 00000000000..002aac642f8
> --- /dev/null
> +++ b/target/arm/target_info-aarch64-softmmu.c
> @@ -0,0 +1,24 @@
> +/*
> + * QEMU legacy binary helpers
> + *
> + * Copyright (c) Linaro
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/target_info-impl.h"
> +#include "cpu-qom.h"
> +
> +static const BinaryTargetInfo target_info_aarch64_system = {
> + .name = "aarch64",
> + .system_arch = SYS_EMU_TARGET_AARCH64,
> + .endianness = ENDIAN_MODE_LITTLE,
> + .long_bits = 64,
> + .cpu_resolving_type = TYPE_ARM_CPU,
> +};
> +
> +const BinaryTargetInfo *target_info(void)
> +{
> + return &target_info_aarch64_system;
> +}
> diff --git a/target/arm/target_info-arm-softmmu.c b/target/arm/target_info-arm-softmmu.c
> new file mode 100644
> index 00000000000..24b68b1ad8b
> --- /dev/null
> +++ b/target/arm/target_info-arm-softmmu.c
> @@ -0,0 +1,24 @@
> +/*
> + * QEMU legacy binary helpers
> + *
> + * Copyright (c) Linaro
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/target_info-impl.h"
> +#include "cpu-qom.h"
> +
> +static const BinaryTargetInfo target_info_arm_system = {
> + .name = "arm",
> + .system_arch = SYS_EMU_TARGET_ARM,
> + .endianness = ENDIAN_MODE_LITTLE,
> + .long_bits = 32,
> + .cpu_resolving_type = TYPE_ARM_CPU,
> +};
> +
> +const BinaryTargetInfo *target_info(void)
> +{
> + return &target_info_arm_system;
> +}
> diff --git a/target/arm/meson.build b/target/arm/meson.build
> index 3065081d241..706c49c1b2a 100644
> --- a/target/arm/meson.build
> +++ b/target/arm/meson.build
> @@ -25,6 +25,11 @@ arm_system_ss.add(files(
> 'machine.c',
> 'ptw.c',
> ))
> +arm_system_ss.add(when: 'TARGET_AARCH64', if_true: files(
> + 'target_info-aarch64-softmmu.c',
> +), if_false: files(
> + 'target_info-arm-softmmu.c',
> +))
>
Using a dictionary for keeping target_info source files, we avoid this
if, it will become:
target_info += {'aarch64-softmmu': [target_info-aarch64-softmmu.c]}
target_info += {'arm-softmmu': [target_info-arm-softmmu.c]}
> arm_user_ss = ss.source_set()
>