Why not close: https://gitlab.com/qemu-project/qemu/-/work_items/4640,
I'll close that directly.

On Wed, Oct 7, 2026 at 12:03 PM Pierrick Bouvier
<[email protected]> wrote:
>
> For now, TARGET_ARCH only contains 32 vs 64 bit arch. The variants,
> based on endianness, are accessible through TARGET_NAME. However,
> TARGET_NAME is a string, and thus can't be concatenated to generate code
> and retrieve matching SYS_EMU_TARGET enum entry.
> Thus, export this information in TARGET_ARCH_VARIANT as an unquoted
> identifier.
>
> There is one more subtlety, user binaries have extra targets that are
> not present in SYS_EMU_TARGET, like armeb.
> Thus, for user binaries, simply export TARGET_ARCH.
>
> Signed-off-by: Pierrick Bouvier <[email protected]>
> ---
>  meson.build | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index cae1591cd28..9bcfe84daba 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3288,7 +3288,14 @@ default_targets = 'CONFIG_DEFAULT_TARGETS' in 
> config_host
>  actual_target_dirs = []
>  fdt_required = []
>  foreach target : target_dirs
> -  config_target = { 'TARGET_NAME': target.split('-')[0] }
> +  target_name = target.split('-')[0]
> +  config_target = { 'TARGET_NAME': target_name }
> +  if target.endswith('linux-user')
> +    config_target += { 'TARGET_ARCH_VARIANT': 'TARGET_ARCH' }
> +  else
> +    config_target += { 'TARGET_ARCH_VARIANT': target_name.to_upper() }
> +  endif
> +
>    if target.endswith('linux-user')
>      if host_os != 'linux'
>        if default_targets
> @@ -3372,7 +3379,7 @@ foreach target : target_dirs
>        # do nothing
>      elif ignored.contains(k)
>        # do nothing
> -    elif k == 'TARGET_ARCH'
> +    elif k == 'TARGET_ARCH' or k == 'TARGET_ARCH_VARIANT'
>        config_target_data.set(k, v.to_upper())
>      elif k == 'TARGET_BASE_ARCH'
>        # Note that TARGET_BASE_ARCH ends up in config-target.h but it is
> --
> 2.43.0
>
>


-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

Reply via email to