* [PATCH] linux-user, bsd-user: disable on unsupported host architectures
@ 2023-08-29 8:40 Paolo Bonzini
2023-08-29 17:12 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2023-08-29 8:40 UTC (permalink / raw)
To: qemu-devel
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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 40 +++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/configure b/configure
index 40729a6d5f5..64d501ef710 100755
--- a/configure
+++ b/configure
@@ -856,30 +856,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)"
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] linux-user, bsd-user: disable on unsupported host architectures
2023-08-29 8:40 [PATCH] linux-user, bsd-user: disable on unsupported host architectures Paolo Bonzini
@ 2023-08-29 17:12 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2023-08-29 17:12 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
On 8/29/23 01:40, Paolo Bonzini wrote:
> 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.
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
> configure | 40 +++++++++++++++++++++++-----------------
> 1 file changed, 23 insertions(+), 17 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
It is better to error out during configure than fail later, eh?
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-29 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29 8:40 [PATCH] linux-user, bsd-user: disable on unsupported host architectures Paolo Bonzini
2023-08-29 17:12 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).