From patchwork Tue May 4 10:02:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 430830 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3641799jao; Tue, 4 May 2021 03:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3MdFY/zmbk11+9bsXIR7Z3bk2k+sUlRtCfNbA5Qxu99AFRCj5IZKFPGVecEPRHQXxflup X-Received: by 2002:a17:906:a956:: with SMTP id hh22mr2497049ejb.335.1620122621730; Tue, 04 May 2021 03:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620122621; cv=none; d=google.com; s=arc-20160816; b=OL4dPkqS8Z9gLhyNhBtQUjSz7HCDIxHHMJlRlngs7zV/losjxmT/BwOFSfF4+i1qIi sd+aDCL56YkP2Q0l8vVuAGTiirstJVQrRPofbro2sVThgIKTp+lJc4NzJB9CxMJK/q54 xKMm4vM/NpPP8myuHrcXxbtDLmOqbozb8ZlchWC3J4abMAECMwdRGW/cZ8YOe8BEtckY +uqac+cblDvwFGix+2q0OQjQjaTV6cdqJ42i7+iKlEr9nOU/fx1+CjDuBQAqyJpDr7HT rUQFJJAn1pGY1m//YT6PSDh6tTRbT9846CBcWf4YOhqo95BxeBOzXg9UqBtvm29qiBCH 4jPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=sPzJesUomMFY9absGAV+e0gSasa1u8Mhgwq7e7l5rQ4=; b=fyw92aV+i5tPRcJ2kz45MxgbLptjjbJSKRiS1+MyZMX1Rd2Pl5CyF/cfnxXryyOpmv 1cejVt74Q9zJFJGV9qAM/N2cMEpPnxNtaC9aSBmnC1yvD8YmCFhPuyhQV9tg3+JTvWO+ XomRlcxYP+DjXV1SHrcEPHkrMqdEPqfTbVCxWdI54IhdBEii2ObfxAN7QK3CQtD9b1zm rIXonuHiaOiyZ8FoQTPjKFF5wJDN67cXUD9dCs1801Itf/J8SJGKatKfSL7M6PpguDtR kV71PCK9B3q6zcBstmvJ/V9rUHKalvYSHy/aX+d/52A0Xg8TG2fl2IyYTsJY534mL95M 0Tow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yjkRzha7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dn20si2768748ejc.511.2021.05.04.03.03.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 May 2021 03:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yjkRzha7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldru0-0002mo-DU for patch@linaro.org; Tue, 04 May 2021 06:03:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldrt8-0002iA-5m for qemu-devel@nongnu.org; Tue, 04 May 2021 06:02:46 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:34615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldrt5-0003DI-K0 for qemu-devel@nongnu.org; Tue, 04 May 2021 06:02:45 -0400 Received: by mail-wr1-x42c.google.com with SMTP id t18so8722393wry.1 for ; Tue, 04 May 2021 03:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sPzJesUomMFY9absGAV+e0gSasa1u8Mhgwq7e7l5rQ4=; b=yjkRzha73zItRsAaDGhys/+ybLBws0qv+UeDr/XOWsE5+ERHERKhKXwa6Yog8P2qqR +adVbhsHOKaYA5qg8xye2NTHKl72hXo1PU/RKl+1zP0VgB4Lh347duH2xGWtkFOrNHj7 Xzv9Fo2Bu87kh+Q10XOvgWt4ZN3ltMIh884t0WKTpnQH1xyElVgu3LdDLGr11FR20UU8 F6MfWm6NC1doqDvA5oIHfp7nnpRWs3Wca5iXoGCurqfbUqW5dwnMhrzJZ7o8E4iEzJ9m VqekZNoiOchVfjc/4Gk/iAfYgnhCMC27Ag91E1Hzaqocm9QE7xYxEdHUoAdkDk+/x7k1 KXig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sPzJesUomMFY9absGAV+e0gSasa1u8Mhgwq7e7l5rQ4=; b=hgLZ0ZAk9BVC78uD5uIf25RqoHc6mzx89zXGVPRNtx09/+ovgx/cQ5VC9SqIaSPtdT 2NWPOSu+N+tCepDxuDGoGCKsTuplwzu12CMl/DAsh0Ww2xt2HuxFoPEnbyyxEIufLv8L mfv8TUZ+8mu1MUFIyfW89fep0dFwjko7s3qgVCjMKJS+SkVtDd5f6/TSv08rcxJUOvD2 LRjagn9cZLvhGpKIVqcEbvRd+Ecg3CCc1kbiq0RvrwY6pPlbNvKiKn0EZtX3H5YiL88d 89tCAmAnZr70rTI+ZTToNoo5vuL7YWqSKiueJS5Z4KVqsHphZzg8pb+GFhm2Bq3M0TNm kUrg== X-Gm-Message-State: AOAM5330acTwYHB6dHI0JfkP+RFRWREWCt0ZZGUGqriLgf1TIUZv+LJ8 6bj/PBkkk8f1vpLnYEWAgG/0Vg== X-Received: by 2002:a5d:4d52:: with SMTP id a18mr27721628wru.45.1620122562239; Tue, 04 May 2021 03:02:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l12sm18445825wrq.36.2021.05.04.03.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 May 2021 03:02:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 767821FF98; Tue, 4 May 2021 11:02:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 09/30] tests/tcg: don't iterate through other arch compilers Date: Tue, 4 May 2021 11:02:02 +0100 Message-Id: <20210504100223.25427-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210504100223.25427-1-alex.bennee@linaro.org> References: <20210504100223.25427-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, f4bug@amsat.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There should only be one compiler per architecture. Those cases where the same compiler can deal with a different architecture should be explicitly set for both cross_cc and docker configurations. Otherwise you get strangeness like: --cross-cc-aarch64=/bin/false causing the logic to attempt to use a locally available arm-linux-gnueabihf-gcc rather than forcing the use of the docker image which is what is implied by the command line option. Signed-off-by: Alex Bennée --- tests/tcg/configure.sh | 148 ++++++++++++++++------------------------- 1 file changed, 59 insertions(+), 89 deletions(-) -- 2.20.1 diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 24cc847688..e6c1be5450 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -74,35 +74,6 @@ fi for target in $target_list; do arch=${target%%-*} - case $arch in - arm|armeb) - arches=arm - ;; - aarch64|aarch64_be) - arches="aarch64 arm" - ;; - mips*) - arches=mips - ;; - ppc*) - arches=ppc - ;; - sh4|sh4eb) - arches=sh4 - ;; - x86_64) - arches="x86_64 i386" - ;; - xtensa|xtensaeb) - arches=xtensa - ;; - alpha|cris|hexagon|hppa|i386|lm32|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64) - arches=$target - ;; - *) - continue - ;; - esac container_image= case $target in @@ -236,70 +207,69 @@ for target in $target_list; do echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak got_cross_cc=no - for i in $arch $arches; do - if eval test "x\${cross_cc_$i+yes}" != xyes; then - continue - fi - eval "target_compiler=\${cross_cc_$i}" - if ! has $target_compiler; then - continue - 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 - if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC ; then - continue - fi - echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak - else - echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak - fi - echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak + if eval test "x\${cross_cc_$arch}" != xyes; then + eval "target_compiler=\${cross_cc_$arch}" - # Test for compiler features for optional tests. We only do this - # for cross compilers because ensuring the docker containers based - # compilers is a requirememt for adding a new test that needs a - # compiler feature. - case $target in - aarch64-*) - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=armv8.1-a+sve -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=armv8.3-a -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -mbranch-protection=standard -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak - fi - if do_compiler "$target_compiler" $target_compiler_cflags \ - -march=armv8.5-a+memtag -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak - fi - ;; - ppc*) - if do_compiler "$target_compiler" $target_compiler_cflags \ - -mpower8-vector -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak - fi - ;; - i386-linux-user) - if do_compiler "$target_compiler" $target_compiler_cflags \ - -Werror -fno-pie -o $TMPE $TMPC; then - echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak - fi - ;; - esac + if has $target_compiler; then + 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 + if do_compiler "$target_compiler" $target_compiler_cflags \ + -o $TMPE $TMPC ; then + got_cross_cc=yes + echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak + echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak + fi + else + got_cross_cc=yes + echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak + echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak + fi + fi + fi - enabled_cross_compilers="$enabled_cross_compilers $target_compiler" - got_cross_cc=yes - break - done + if test $got_cross_cc = yes; then + # Test for compiler features for optional tests. We only do this + # for cross compilers because ensuring the docker containers based + # compilers is a requirememt for adding a new test that needs a + # compiler feature. - if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then + case $target in + aarch64-*) + if do_compiler "$target_compiler" $target_compiler_cflags \ + -march=armv8.1-a+sve -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak + fi + if do_compiler "$target_compiler" $target_compiler_cflags \ + -march=armv8.3-a -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak + fi + if do_compiler "$target_compiler" $target_compiler_cflags \ + -mbranch-protection=standard -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak + fi + if do_compiler "$target_compiler" $target_compiler_cflags \ + -march=armv8.5-a+memtag -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak + fi + ;; + ppc*) + if do_compiler "$target_compiler" $target_compiler_cflags \ + -mpower8-vector -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak + fi + ;; + i386-linux-user) + if do_compiler "$target_compiler" $target_compiler_cflags \ + -Werror -fno-pie -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak + fi + ;; + esac + elif test $got_cross_cc = no && test "$container" != no && \ + test -n "$container_image"; then for host in $container_hosts; do if test "$host" = "$ARCH"; then echo "DOCKER_IMAGE=$container_image" >> $config_target_mak