Skip to content

Commit

Permalink
linux-user, bsd-user: disable on unsupported host architectures
Browse files Browse the repository at this point in the history
Safe signal handling around system calls is mandatory for user-mode
emulation, and requires a small piece of handwritten assembly code.
So refuse to compile unless the common-user/host subdirectory exists
for the host architecture that was detected or selected with --cpu.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Sep 1, 2023
1 parent 17780ed commit 473cd07
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -871,30 +871,36 @@ fi
default_target_list=""
mak_wilds=""

if [ "$linux_user" != no ]; then
if [ "$targetos" = linux ] && [ -n "$host_arch" ]; then
linux_user=yes
elif [ "$linux_user" = yes ]; then
error_exit "linux-user not supported on this architecture"
if [ -n "$host_arch" ] && [ -d "$source_path/common-user/host/$host_arch" ]; then
if [ "$linux_user" != no ]; then
if [ "$targetos" = linux ]; then
linux_user=yes
elif [ "$linux_user" = yes ]; then
error_exit "linux-user not supported on this architecture"
fi
if [ "$linux_user" = "yes" ]; then
mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak"
fi
fi
fi
if [ "$bsd_user" != no ]; then
if [ "$bsd_user" = "" ]; then
test $targetos = freebsd && bsd_user=yes
if [ "$bsd_user" != no ]; then
if [ "$bsd_user" = "" ]; then
test $targetos = freebsd && bsd_user=yes
fi
if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
error_exit "bsd-user not supported on this host OS"
fi
if [ "$bsd_user" = "yes" ]; then
mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
fi
fi
if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
error_exit "bsd-user not supported on this host OS"
else
if [ "$linux_user" = yes ] || [ "$bsd_user" = yes ]; then
error_exit "user mode emulation not supported on this architecture"
fi
fi
if [ "$softmmu" = "yes" ]; then
mak_wilds="${mak_wilds} $source_path/configs/targets/*-softmmu.mak"
fi
if [ "$linux_user" = "yes" ]; then
mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak"
fi
if [ "$bsd_user" = "yes" ]; then
mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
fi

for config in $mak_wilds; do
target="$(basename "$config" .mak)"
Expand Down

0 comments on commit 473cd07

Please sign in to comment.