aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@rivosinc.com>2022-05-12 08:32:55 -0700
committerPalmer Dabbelt <palmer@rivosinc.com>2022-05-12 08:37:28 -0700
commit29a0ca89722da1a359f02df868b2142df86cf9fa (patch)
tree5900d79a433e138e5be10f9504913a0d1e823726
parentace389df26a69f310b3a7e1ac55bd6c9b34152e5 (diff)
downloadriscv-gnu-toolchain-29a0ca89722da1a359f02df868b2142df86cf9fa.zip
riscv-gnu-toolchain-29a0ca89722da1a359f02df868b2142df86cf9fa.tar.gz
riscv-gnu-toolchain-29a0ca89722da1a359f02df868b2142df86cf9fa.tar.bz2
Allow users to build QEMU with system-mode emulation
I'm trying to clean up some of my test scripts, and one issue is that I've got two QEMU builds: one for user-mode emulation and one for system-mode emulation. This adds an autoconf flag that allows me to avoid the duplication. Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-rw-r--r--Makefile.in3
-rw-r--r--configure.ac11
2 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 7f36894..03fa832 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -36,6 +36,7 @@ WITH_TUNE ?= @WITH_TUNE@
WITH_ISA_SPEC ?= @WITH_ISA_SPEC@
SYSROOT := $(INSTALL_DIR)/sysroot
ENABLE_LIBSANITIZER ?= @enable_libsanitizer@
+QEMU_TARGETS ?= @qemu_targets@
SHELL := /bin/sh
AWK := @GAWK@
@@ -848,7 +849,7 @@ stamps/build-qemu: $(QEMU_SRCDIR) $(QEMU_SRC_GIT)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
--prefix=$(INSTALL_DIR) \
- --target-list=riscv64-linux-user,riscv32-linux-user \
+ --target-list=$(QEMU_TARGETS) \
--interp-prefix=$(INSTALL_DIR)/sysroot \
--python=python3
$(MAKE) -C $(notdir $@)
diff --git a/configure.ac b/configure.ac
index 9be4170..690df30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -257,4 +257,15 @@ AS_IF([test "x$enable_libsanitizer" != xno],
[AC_SUBST(enable_libsanitizer, --enable-libsanitizer)],
[AC_SUBST(enable_libsanitizer, --disable-libsanitizer)])
+AC_ARG_ENABLE(qemu_system,
+ [AS_HELP_STRING([--enable-qemu-system],
+ [Build qemu with system-mode emulation])],
+ [],
+ [enable_qemu_system=no]
+ )
+
+AS_IF([test "x$enable_qemu_system" != xno],
+ [AC_SUBST(qemu_targets, [riscv64-linux-user,riscv32-linux-user,riscv64-softmmu,riscv32-softmmu])],
+ [AC_SUBST(qemu_targets, [riscv64-linux-user,riscv32-linux-user])])
+
AC_OUTPUT