qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] configure: Fix linux-user host detection for ppc64le
@ 2023-08-07  8:39 Joel Stanley
  2023-08-07  8:54 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Stanley @ 2023-08-07  8:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

Revert the changes in the recent "Fix linux-user host detection for
riscv64" patch as it broke ppc64le. Instead add riscv to the switch
statement that performs normalisation of the host cpu name.

Fixes: 89e5b7935e92 ("configure: Fix linux-user host detection for riscv64")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
Tested on a ppc64le host. Please check it works on riscv too.
---
 configure | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 98dc78280e67..fd0efa69bc36 100755
--- a/configure
+++ b/configure
@@ -469,13 +469,6 @@ 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.
@@ -508,6 +501,9 @@ case "$cpu" in
     cpu="ppc64"
     CPU_CFLAGS="-m64 -mlittle-endian" ;;
 
+  riscv*)
+    cpu="riscv" ;;
+
   s390)
     CPU_CFLAGS="-m31" ;;
   s390x)
@@ -810,7 +806,7 @@ default_target_list=""
 mak_wilds=""
 
 if [ "$linux_user" != no ]; then
-    if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$host_arch" ]; then
+    if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$cpu" ]; then
         linux_user=yes
     elif [ "$linux_user" = yes ]; then
         error_exit "linux-user not supported on this architecture"
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] configure: Fix linux-user host detection for ppc64le
  2023-08-07  8:39 [PATCH] configure: Fix linux-user host detection for ppc64le Joel Stanley
@ 2023-08-07  8:54 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2023-08-07  8:54 UTC (permalink / raw)
  To: Joel Stanley, Richard Henderson; +Cc: qemu-devel

On 8/7/23 10:39, Joel Stanley wrote:
>   
> -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.
> @@ -508,6 +501,9 @@ case "$cpu" in
>       cpu="ppc64"
>       CPU_CFLAGS="-m64 -mlittle-endian" ;;
>   
> +  riscv*)
> +    cpu="riscv" ;;
> +

This is also wrong because it confuses riscv32 and riscv64, which 
matters both for tests/tcg, and when creating the Meson cross file[1]

Instead, the "case $cpu" that sets $host_arch must be placed after $cpu 
is canonicalized (and possibly just before $host_arch is used to find 
linux-user).

Even better, there is already a variable $linux_arch that has the same 
meaning.  I'll send a patch to unify the two.

Paolo

[1] https://mesonbuild.com/Reference-tables.html#cpu-families
>     s390)
>       CPU_CFLAGS="-m31" ;;
>     s390x)
> @@ -810,7 +806,7 @@ default_target_list=""
>   mak_wilds=""
>   
>   if [ "$linux_user" != no ]; then
> -    if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$host_arch" ]; then
> +    if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$cpu" ]; then
>           linux_user=yes
>       elif [ "$linux_user" = yes ]; then



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-07  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07  8:39 [PATCH] configure: Fix linux-user host detection for ppc64le Joel Stanley
2023-08-07  8:54 ` Paolo Bonzini

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).