Gustavo Romero <grom...@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 <grom...@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