qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Acceptance tests: host arch to target arch name


From: Wainer dos Santos Moschetta
Subject: Re: [Qemu-devel] [PATCH] Acceptance tests: host arch to target arch name mapping
Date: Wed, 17 Oct 2018 11:54:48 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

Hello Cleber!

On 10/16/2018 08:22 PM, Cleber Rosa wrote:
The host arch name is not always the target arch name, so it's
necessary to have a mapping.

The configure scripts contains what is the authoritative and failproof
mapping, but, reusing it is not straightforward, so it's replicated in
the acceptance tests supporting code.

Signed-off-by: Cleber Rosa <address@hidden>
---
  configure                                 |  2 ++
  tests/acceptance/avocado_qemu/__init__.py | 23 +++++++++++++++++++++++
  2 files changed, 25 insertions(+)

diff --git a/configure b/configure
index 8af2be959f..e029b756d4 100755
--- a/configure
+++ b/configure
@@ -6992,6 +6992,8 @@ TARGET_ARCH="$target_name"
  TARGET_BASE_ARCH=""
  TARGET_ABI_DIR=""
+# When updating target_name => TARGET_ARCH, please also update the
+# HOST_TARGET_ARCH mapping in tests/acceptance/avocado_qemu/__init__.py
  case "$target_name" in
    i386)
      mttcg="yes"
diff --git a/tests/acceptance/avocado_qemu/__init__.py 
b/tests/acceptance/avocado_qemu/__init__.py
index 1e54fd5932..d9bc4736ec 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -19,6 +19,28 @@ sys.path.append(os.path.join(SRC_ROOT_DIR, 'scripts'))
from qemu import QEMUMachine +
+#: Mapping of host arch names to target arch names.  It's expected that the
+#: arch identification on the host, using os.uname()[4], would return the
+#: key (LHS).  The QEMU target name, and consequently the target binary, would
+#: be based on the name on the value (RHS).
+HOST_TARGET_ARCH = {
+    'armeb': 'arm',
+    'aarch64_be': 'aarch64',
+    'microblazeel': 'microblaze',
+    'mipsel': 'mips',
+    'mipsn32el' : 'mips64',

Missing mipsn32 mapping to mips64:

  mipsn32|mipsn32el)
    TARGET_ARCH=mips64
    TARGET_BASE_ARCH=mips
    target_compiler=$cross_cc_mipsn32
    echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
    echo "TARGET_ABI32=y" >> $config_target_mak
  ;;

+    'mips64el': 'mips64',
+    'or1k': 'openrisc',
+    'ppc64le': 'ppc64',
+    'ppc64abi32': 'ppc64',
+    'riscv64': 'riscv',

riscv64 is not mapped to riscv:

  riscv64)
    TARGET_BASE_ARCH=riscv
    TARGET_ABI_DIR=riscv
    mttcg=yes
    target_compiler=$cross_cc_riscv64
  ;;

Thanks,
Wainer.

+    'sh4eb': 'sh4',
+    'sparc32plus': 'sparc64',
+    'xtensaeb': 'xtensa'
+    }
+
+
  def is_readable_executable_file(path):
      return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
@@ -29,6 +51,7 @@ def pick_default_qemu_bin():
      directory or in the source tree root directory.
      """
      arch = os.uname()[4]
+    arch = HOST_TARGET_ARCH.get(arch, arch)
      qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
                                            "qemu-system-%s" % arch)
      if is_readable_executable_file(qemu_bin_relative_path):




reply via email to

[Prev in Thread] Current Thread [Next in Thread]