From patchwork Wed May 12 10:20:29 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: 435476 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4686424jao; Wed, 12 May 2021 03:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVP7xbmBnZg8WTBwUna5K/oRYk16otMYdYZyYIO6NRgn5fVhb41z9z81GuBTbwU9D1g5wg X-Received: by 2002:ab0:4943:: with SMTP id a3mr31104225uad.107.1620814942228; Wed, 12 May 2021 03:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620814942; cv=none; d=google.com; s=arc-20160816; b=xvGEV9NISZ6ODoORtUPx0D61NEQJX+fDP+Qw8+RjJs5DoNYxfHZBdVpXbz6ViFh2ts KCI1uPr5Vjm8NkDcarGgrQamxgfP9vP75xPQPTA1JR+p8/YL4lSXyY+qOy/NHL3tofol QCsI3plnjtYEHt88GwXUPp/VIdonSbwt2X8Ak/5+BJ8fXKIA1NqdBdGSlbcpoBW2rWkD PXsfeJ7JeTwzIk+/8BGgNmLvc/2o3wNXx8BOLEG8Iy10mM4M8/Kp46nD2Cqgu21OttQo 3csJjqTiZQP7M8fpOFYT/2lu+HlnWj2A9tRxU7PWzDUgN7fTNYtetnBevLoCuc0wm9ie xtsA== 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=W93VpPVp3Sdx40Z1onlYkqgPtFxwArERr4TP3NqSo/eW1DsJFB9TMm1CsBhx9hXQKH o3AIW4Gh+xVS1Pu/bfpARbN+PJ3aITykd/Q6wfimzIaOJ+gjwkrqIF1nWyI/zzA7Q4fH eY5RHlTjcfQ+eTY3Ddg+5ma1YEmE/eNZYWUqQPJZWmiSQgotgunahxiyPQIEm91qy3yu Or9sx7/g9/qmDHUHPOAFg0js4wyhie6x07mx6xm10S06yqnc5VhIeNB8JqAISxzBvQw1 RdI8me63/q092mDe5c2MY8ij5h1JegeJjVa5Mp8yThItNajydK3TBJqdcSou+/AsKFxi u7AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZsLvS6GA; 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 u2si444802vsh.149.2021.05.12.03.22.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 May 2021 03:22:22 -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=ZsLvS6GA; 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]:38836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgm0T-0003fh-I9 for patch@linaro.org; Wed, 12 May 2021 06:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lglzJ-0003cn-LU for qemu-devel@nongnu.org; Wed, 12 May 2021 06:21:09 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lglzG-0003fa-UR for qemu-devel@nongnu.org; Wed, 12 May 2021 06:21:09 -0400 Received: by mail-wr1-x435.google.com with SMTP id t18so23060683wry.1 for ; Wed, 12 May 2021 03:21:06 -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=ZsLvS6GA9VNr4FhF9xXNcNLQgbhsb0np6w7cD7L1bMiTZC7mip7HqDTlxuKod3tha3 FkhCg5MdsDeYd3YG39coNMIF0dDp5XC9yQaqBd0bQY97Q8RFRFQMybeQfXbt9SVAlHos uiu4YFiI6EheGo0+cHLLMiI3YNtnrwhx7/Y4IedODOV+qCIOSLRhdgzLqsCp/soNCfa5 Cop4bKDnBEGYHqZM9GtZ6ei1qaNBFf1hjzkDjRWV7Mp+e4qWuyQgW3vcrwmMQ+oCP61P EZ9k3rQV4QkVGFjmfwshYFRZsUc85P+vE74ryeeNueGehJy5Sz9lyeEeHmXbXFhq1ihk MTIg== 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=TL0ho+7RK+mdiOGIwpny61UdhZjiHhf0vALWA25KPw4X1rotPBxjEJtPuIZcUXKgoN qkNziQuKZwhkQmsEWkMRev5YL/6wp7pVGRodGfdm2ULrMLR+AapPNRQ9gc75DoYx9He3 AzGGdN8zSoYCbbNJ8oSNAN9+9ft/glFUghZSAHVWj3wZUp2XYSxpwp3Jh+Z3Rv8c9nt3 K/bfNrZEU/KbFm1Vf7ByF847TzeG1H6EPuloYpVM+KPJ1UyCHhRteWKbly/0sHVD1pcV d+MZfZKWQYLlF1FCZTGwrB2uA0izQGnrsxcAT1deFMlb1AgisS6FiQPrEBAGoghVIDL/ /G9A== X-Gm-Message-State: AOAM5337xLMxBN/Zt+D32ZsslFwmu2noBNZdzz38hdwaOeqKls2BNVlW shu9Xn+JcHYfJpPsTafwHs3IKg== X-Received: by 2002:a5d:4a48:: with SMTP id v8mr45028899wrs.204.1620814865538; Wed, 12 May 2021 03:21:05 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c8sm5645592wmr.48.2021.05.12.03.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 03:20:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 040A71FF98; Wed, 12 May 2021 11:20:52 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 09/31] tests/tcg: don't iterate through other arch compilers Date: Wed, 12 May 2021 11:20:29 +0100 Message-Id: <20210512102051.12134-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512102051.12134-1-alex.bennee@linaro.org> References: <20210512102051.12134-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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