summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-08-05 17:38:06 +0000
committerRichard Henderson <richard.henderson@linaro.org>2023-08-06 10:10:11 -0700
commit89e5b7935e92af6f3b4e4cdb19dfddef4e9dde36 (patch)
treee87adea862ca6c60f14eb7f8889f07cd25497a2f
parent6c78de6eb6f986b2e06e95fabad62731a44aaafd (diff)
downloadfocaccia-qemu-89e5b7935e92af6f3b4e4cdb19dfddef4e9dde36.tar.gz
focaccia-qemu-89e5b7935e92af6f3b4e4cdb19dfddef4e9dde36.zip
configure: Fix linux-user host detection for riscv64
Mirror the host_arch variable from meson.build, so that we
probe for the correct linux-user/include/host/ directory.

Fixes: e3e477c3bca0 ("configure: Fix cross-building for RISCV host")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rwxr-xr-xconfigure9
1 files changed, 8 insertions, 1 deletions
diff --git a/configure b/configure
index afb25fd558..98dc78280e 100755
--- a/configure
+++ b/configure
@@ -469,6 +469,13 @@ else
   echo "WARNING: unrecognized host CPU, proceeding with 'uname -m' output '$cpu'"
 fi
 
+case "$cpu" in
+  riscv*)
+    host_arch=riscv ;;
+  *)
+    host_arch="$cpu" ;;
+esac
+
 # Normalise host CPU name and set multilib cflags.  The canonicalization
 # isn't really necessary, because the architectures that we check for
 # should not hit the 'uname -m' case, but better safe than sorry.
@@ -803,7 +810,7 @@ default_target_list=""
 mak_wilds=""
 
 if [ "$linux_user" != no ]; then
-    if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$cpu" ]; then
+    if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$host_arch" ]; then
         linux_user=yes
     elif [ "$linux_user" = yes ]; then
         error_exit "linux-user not supported on this architecture"