qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 20/33] configure: handle host compiler in probe_target_compile


From: Paolo Bonzini
Subject: Re: [PULL 20/33] configure: handle host compiler in probe_target_compiler
Date: Tue, 21 Jun 2022 18:58:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 6/20/22 18:41, Matheus Kowalczuk Ferst wrote:
On 17/06/2022 07:12, Paolo Bonzini wrote:
Hi Matheus,

could you please test the tests-tcg-next branch at
https://gitlab.com/bonzini/qemu?
At be6090bcac10, it works if no BE toolchain is present. Otherwise, the
script probes powerpc64-linux-gnu-gcc instead of the native tools for
ppc64le-linux-user, and then do_compiler fails because the
$target_cflags contains -mlittle-endian.


So the problem in that case is that powerpc64-linux-gnu-gcc is _not_
biarch and thus does not support -mlittle-endian?  (I thought PPC
compilers were all 32/64-bit and bi-endian).

If so, I guess this would fix your case

diff --git a/configure b/configure
index 0fd2838e82..6ad888ed97 100755
--- a/configure
+++ b/configure
@@ -2041,22 +2041,6 @@ probe_target_compiler() {
     : ${container_cross_strip:=${container_cross_prefix}strip}
   done

-  eval "target_cflags=\${cross_cc_cflags_$1}"
-  if eval test -n "\"\${cross_cc_$1}\""; then
-    if eval has "\"\${cross_cc_$1}\""; then
-      eval "target_cc=\"\${cross_cc_$1}\""
-    fi
-  else
-    compute_target_variable $1 target_cc gcc
-  fi
-  target_ccas=$target_cc
-  compute_target_variable $1 target_ar ar
-  compute_target_variable $1 target_as as
-  compute_target_variable $1 target_ld ld
-  compute_target_variable $1 target_nm nm
-  compute_target_variable $1 target_objcopy objcopy
-  compute_target_variable $1 target_ranlib ranlib
-  compute_target_variable $1 target_strip strip
   case "$1:$cpu" in
     aarch64_be:aarch64 | \
     armeb:arm | \
@@ -2065,17 +2049,35 @@ probe_target_compiler() {
     ppc*:ppc64 | \
     sparc:sparc64 | \
     "$cpu:$cpu")
-      : ${target_cc:=$cc}
-      : ${target_ccas:=$ccas}
-      : ${target_as:=$as}
-      : ${target_ld:=$ld}
-      : ${target_ar:=$ar}
-      : ${target_as:=$as}
-      : ${target_ld:=$ld}
-      : ${target_nm:=$nm}
-      : ${target_objcopy:=$objcopy}
-      : ${target_ranlib:=$ranlib}
-      : ${target_strip:=$strip}
+      target_cc=$cc
+      target_ccas=$ccas
+      target_as=$as
+      target_ld=$ld
+      target_ar=$ar
+      target_as=$as
+      target_ld=$ld
+      target_nm=$nm
+      target_objcopy=$objcopy
+      target_ranlib=$ranlib
+      target_strip=$strip
+      ;;
+    *)
+      eval "target_cflags=\${cross_cc_cflags_$1}"
+      if eval test -n "\"\${cross_cc_$1}\""; then
+        if eval has "\"\${cross_cc_$1}\""; then
+          eval "target_cc=\"\${cross_cc_$1}\""
+        fi
+      else
+        compute_target_variable $1 target_cc gcc
+      fi
+      target_ccas=$target_cc
+      compute_target_variable $1 target_ar ar
+      compute_target_variable $1 target_as as
+      compute_target_variable $1 target_ld ld
+      compute_target_variable $1 target_nm nm
+      compute_target_variable $1 target_objcopy objcopy
+      compute_target_variable $1 target_ranlib ranlib
+      compute_target_variable $1 target_strip strip
       ;;
   esac
   if test -n "$target_cc"; then

but it would break the opposite of compiling tests/tcg QEMU
with a big-endian non-biarch compiler.

In any case, the series is already a step forward so I've sent it out.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]