Skip to content

Commit

Permalink
configure: Fix linux-user host detection for riscv64
Browse files Browse the repository at this point in the history
Mirror the host_arch variable from meson.build, so that we
probe for the correct linux-user/include/host/ directory.

Fixes: e3e477c ("configure: Fix cross-building for RISCV host")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Aug 6, 2023
1 parent 6c78de6 commit 89e5b79
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 89e5b79

Please sign in to comment.