All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Gustavo Romero <gromero@linux.ibm.com>
Cc: gustavo.romero@protonmail.com, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org, david@gibson.dropbear.id.au
Subject: Re: [PATCH] configure: Fail when specified cross compiler cannot be found
Date: Wed, 16 Dec 2020 10:51:06 +0000	[thread overview]
Message-ID: <87bleut3si.fsf@linaro.org> (raw)
In-Reply-To: <20201216013646.40799-1-gromero@linux.ibm.com>


Gustavo Romero <gromero@linux.ibm.com> writes:

> Currently if the cross compiler passed to 'configure' (--cross-cc-<arch>) does
> not exist no error happens and only later when the TCG tests are run they fail
> because the cross compiler is not set correctly.

Do they? They should just skip because of a non-existing compiler and a
failed fallback to using docker:

  ../../configure --disable-docs --target-list=aarch64-softmmu --cross-cc-aarch64=nonexisting_gcc

and then cat ./tests/tcg/config-aarch64-softmmu.mak

  # Automatically generated by configure - do not modify
  TARGET_NAME=aarch64
  CONFIG_SOFTMMU=y
  QEMU=/home/alex/lsrc/qemu.git/builds/bisect/qemu-system-aarch64
  CROSS_CC_GUEST_CFLAGS=
  DOCKER_IMAGE=debian-arm64-test-cross
  DOCKER_CROSS_CC_GUEST=aarch64-linux-gnu-gcc-10

So what do you see in your failing case?

>
> This commit changes that behavior and make 'configure' fail if the specified
> cross compiler cannot be found, displaying an error similar to the following:
>
> $ ../configure --target-list=ppc64-softmmu --cross-cc-ppc64=nonexisting_gcc
> Specified cross-compiler 'nonexisting_gcc' not found!
>
> Signed-off-by: Gustavo Romero <gromero@linux.ibm.com>
> ---
>  configure              | 2 +-
>  tests/tcg/configure.sh | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index cb21108d34..c0389f5839 100755
> --- a/configure
> +++ b/configure
> @@ -6854,7 +6854,7 @@ done
>    export $i
>  done
>  export target_list source_path use_containers
> -$source_path/tests/tcg/configure.sh)
> +$source_path/tests/tcg/configure.sh) || exit 1
>  
>  # temporary config to build submodules
>  for rom in seabios; do
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index e1b70e25f2..6c89d75c38 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -212,8 +212,10 @@ for target in $target_list; do
>  
>      eval "target_compiler=\${cross_cc_$i}"
>      if ! has $target_compiler; then
> -      continue
> +      echo "Specified cross-compiler '$target_compiler' not found!"
> +      exit 1
>      fi
> +
>      write_c_skeleton
>      if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC -static ; then
>        # For host systems we might get away with building without -static


-- 
Alex Bennée


  reply	other threads:[~2020-12-16 11:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  1:36 [PATCH] configure: Fail when specified cross compiler cannot be found Gustavo Romero
2020-12-16 10:51 ` Alex Bennée [this message]
2020-12-17 16:55   ` Gustavo Romero
2020-12-17 17:56     ` Alex Bennée
2020-12-18 10:05       ` Paolo Bonzini
2020-12-18 11:57         ` Alex Bennée
2020-12-19 12:11           ` Paolo Bonzini

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=87bleut3si.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=gromero@linux.ibm.com \
    --cc=gustavo.romero@protonmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.