All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1 1/1] configure: Add RISC-V host support
@ 2018-07-27 23:49 Alistair Francis
  2018-07-28  4:14 ` Michael Clark
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alistair Francis @ 2018-07-27 23:49 UTC (permalink / raw)
  To: qemu-devel, mjc; +Cc: alistair.francis, alistair23

Allow QEMU to be built to run on a RISC-V host.

QEMU does not yet have a RISC-V TCG or user mode target port, but
running other architectures on RISC-V using TCI does work.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 configure | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 2a7796ea80..c3ff3ae146 100755
--- a/configure
+++ b/configure
@@ -606,6 +606,16 @@ EOF
   compile_object
 }
 
+check_define_value() {
+cat > $TMPC <<EOF
+#if (($1) != ($2))
+#error $1 != ($2)
+#endif
+int main(void) { return 0; }
+EOF
+  compile_object
+}
+
 check_include() {
 cat > $TMPC <<EOF
 #include <$1>
@@ -704,6 +714,12 @@ elif check_define __arm__ ; then
   cpu="arm"
 elif check_define __aarch64__ ; then
   cpu="aarch64"
+elif check_define __riscv ; then
+  if check_define_value __riscv_xlen 64 ; then
+    cpu="riscv64"
+  else
+    cpu="riscv32"
+  fi
 else
   cpu=$(uname -m)
 fi
@@ -712,7 +728,7 @@ ARCH=
 # Normalise host CPU name and set ARCH.
 # Note that this case should only have supported host CPUs, not guests.
 case "$cpu" in
-  ppc|ppc64|s390|s390x|sparc64|x32)
+  ppc|ppc64|s390|s390x|sparc64|x32|riscv32|riscv64)
     cpu="$cpu"
     supported_cpu="yes"
     eval "cross_cc_${cpu}=\$host_cc"
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-07-31  9:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 23:49 [Qemu-devel] [PATCH v1 1/1] configure: Add RISC-V host support Alistair Francis
2018-07-28  4:14 ` Michael Clark
2018-07-28 16:36 ` Richard Henderson
2018-07-29 11:28   ` Peter Maydell
2018-07-30 17:24     ` Alistair Francis
2018-07-30 18:33       ` Peter Maydell
2018-07-30 18:20 ` Philippe Mathieu-Daudé
2018-07-30 18:37   ` Peter Maydell
2018-07-31  9:30     ` Daniel P. Berrangé
2018-07-31  9:39       ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.