qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Matheus Kowalczuk Ferst <matheus.ferst@eldorado.org.br>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"richard.henderson@linaro.org" <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Leandro Lupori" <leandro.lupori@eldorado.org.br>
Subject: Re: [PULL 20/33] configure: handle host compiler in probe_target_compiler
Date: Tue, 21 Jun 2022 18:58:38 +0200	[thread overview]
Message-ID: <b49f2611-55f5-ba8b-df9f-13ab13bbad09@redhat.com> (raw)
In-Reply-To: <9273ee87-28f6-b6bb-81be-72795f0a645b@eldorado.org.br>

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


  parent reply	other threads:[~2022-06-21 17:04 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 18:05 [PULL 00/33] testing updates (gitlab, junit, lcitool, x-compile) Alex Bennée
2022-06-01 18:05 ` [PULL 01/33] .gitlab-ci.d/container-cross: Fix RISC-V container dependencies / stages Alex Bennée
2022-06-01 18:05 ` [PULL 02/33] .gitlab-ci.d/crossbuilds: Fix the dependency of the cross-i386-tci job Alex Bennée
2022-06-01 18:05 ` [PULL 03/33] gitlab-ci: add meson JUnit test result into report Alex Bennée
2022-06-01 18:05 ` [PULL 04/33] meson.build: fix summary display of test compilers Alex Bennée
2022-06-01 18:05 ` [PULL 05/33] tests/lcitool: fix up indentation to correct style Alex Bennée
2022-06-01 18:05 ` [PULL 06/33] tests/docker: update debian-armhf-cross with lcitool Alex Bennée
2022-06-01 18:05 ` [PULL 07/33] tests/docker: update debian-armel-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 08/33] tests/docker: update debian-mipsel-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 09/33] tests/docker: update debian-mips64el-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 10/33] tests/docker: update debian-ppc64el-cross " Alex Bennée
2022-06-01 18:05 ` [PULL 11/33] tests/docker: update debian-amd64 " Alex Bennée
2022-06-01 18:05 ` [PULL 12/33] configure: do not define or use the CPP variable Alex Bennée
2022-06-01 18:05 ` [PULL 13/33] build: clean up ninja invocation Alex Bennée
2022-06-01 18:05 ` [PULL 14/33] build: add a more generic way to specify make->ninja dependencies Alex Bennée
2022-06-01 18:05 ` [PULL 15/33] build: do a full build before running TCG tests Alex Bennée
2022-06-01 18:05 ` [PULL 16/33] configure, meson: move symlinking of ROMs to meson Alex Bennée
2022-06-01 18:05 ` [PULL 17/33] tests/tcg: correct target CPU for sparc32 Alex Bennée
2022-06-01 18:05 ` [PULL 18/33] tests/tcg: merge configure.sh back into main configure script Alex Bennée
2022-06-01 18:05 ` [PULL 19/33] configure: add missing cross compiler fallbacks Alex Bennée
2022-06-01 18:05 ` [PULL 20/33] configure: handle host compiler in probe_target_compiler Alex Bennée
2022-06-15 11:57   ` Matheus Kowalczuk Ferst
2022-06-16  1:20     ` Alex Bennée
2022-06-17 10:12     ` Paolo Bonzini
2022-06-20 16:41       ` Matheus Kowalczuk Ferst
2022-06-21  1:38         ` Richard Henderson
2022-06-21 16:58         ` Paolo Bonzini [this message]
2022-06-21 18:30           ` Richard Henderson
2022-06-22  8:39             ` Paolo Bonzini
2022-06-01 18:05 ` [PULL 21/33] configure: introduce --cross-prefix-*= Alex Bennée
2022-06-01 18:05 ` [PULL 22/33] configure: include more binutils in tests/tcg makefile Alex Bennée
2022-06-01 18:05 ` [PULL 23/33] configure: move symlink configuration earlier Alex Bennée
2022-06-01 18:05 ` [PULL 24/33] configure: enable cross-compilation of s390-ccw Alex Bennée
2022-06-01 18:05 ` [PULL 25/33] configure: enable cross-compilation of optionrom Alex Bennée
2022-06-01 18:05 ` [PULL 26/33] configure: enable cross compilation of vof Alex Bennée
2022-06-01 18:05 ` [PULL 27/33] configure: remove unused variables from config-host.mak Alex Bennée
2022-06-01 18:05 ` [PULL 28/33] gitlab: introduce a common base job template Alex Bennée
2022-06-01 18:05 ` [PULL 29/33] gitlab: convert Cirrus jobs to .base_job_template Alex Bennée
2022-06-01 18:05 ` [PULL 30/33] gitlab: convert static checks " Alex Bennée
2022-06-01 18:05 ` [PULL 31/33] gitlab: convert build/container jobs " Alex Bennée
2022-06-01 18:05 ` [PULL 32/33] gitlab: don't run CI jobs in forks by default Alex Bennée
2022-06-02 10:50   ` Philippe Mathieu-Daudé via
2022-06-06 11:01     ` Daniel P. Berrangé
2022-06-01 18:05 ` [PULL 33/33] docs/devel: clean-up the CI links in the docs Alex Bennée
2022-06-01 21:21 ` [PULL 00/33] testing updates (gitlab, junit, lcitool, x-compile) Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b49f2611-55f5-ba8b-df9f-13ab13bbad09@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=leandro.lupori@eldorado.org.br \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).