From patchwork Wed Jun 1 18:05:24 2022 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: 577835 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp872900mab; Wed, 1 Jun 2022 11:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuyGMEz9shVe4U8TwT0huoeck22WoyCYH46/lkTC1SogY7vc/o+Dp0zpcJl5wIkYbhJYss X-Received: by 2002:a05:620a:746:b0:6a3:8939:b82b with SMTP id i6-20020a05620a074600b006a38939b82bmr693850qki.319.1654109274143; Wed, 01 Jun 2022 11:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654109274; cv=none; d=google.com; s=arc-20160816; b=IgzjxUa2sYv9RfEEkilcUkikNdjKh6Xanzd4VlaDEKOCIL9pgr382YSKp3S9Pl26Dh 3y6CzU8QZEREWaSPgDk2FVuUq5nnPviV/e4e9xPuTokYCn/GVblreK1PXN6X/kNjYOEF 7Sf76J5Bq7TihtriX6S9/aoLF8TXkN3BHx2yblY6RZ+K1NXRRh90ogD0LnPa+AI/czlW hJDbcCqrMmfRqmXsROVRCqYE47YUefoEa9vvwbMaZ3bolA1x6KC2bUkkAqD4lsBStAAu TvHV+j6TCJRabc5aKg72SCEs1VcqIp2SIUnYUX7fY87j1BD9blvXOTjBrVSX6ybG7oNb 0XtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=l6wSZzTZH+UuAV+xIj6vY8Z6NNL8CvUpk5/yn56lmqI=; b=vShZMZPmBdIPAPgvCdRejoZ/eqdtBqp4Zy/79vNNaCGXgHLNjd6WlUfkGgR1oELwRw +IM9gblVHDQFs41TMUGclWSHGhQl2tVBTwqWMQQQxIQC4IeE1LgjPYY76UjvH02rBAnm oVfDpvaDnVVtrxl9AGwSF3/K2eak8ps7kxxxzrkFyuuP0ZWk9qEztq5ykHczuuDJ5NG9 m0soNwbYbvNf9M5SMRBbdNUMnHaij9eR32tAfLciJxHKpWQnOV+ssgQkw2e91Dh47tCr 1vsHSNRLiXsdsl9KiRmZI+3WuoZOhjRDK42zAd/ut4/W1IBpKVi3RPt8JugD+qIHeqar nz+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mApJFjRt; 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=pass (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 u5-20020a379205000000b006a648cbab58si1222269qkd.351.2022.06.01.11.47.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Jun 2022 11:47:54 -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=pass header.i=@linaro.org header.s=google header.b=mApJFjRt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwTNp-0007um-Nf for patch@linaro.org; Wed, 01 Jun 2022 14:47:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwT0n-0005iQ-4B for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:24:06 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:37767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwT0l-0007wD-6R for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:24:04 -0400 Received: by mail-ed1-x529.google.com with SMTP id v19so3334341edd.4 for ; Wed, 01 Jun 2022 11:24:02 -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=l6wSZzTZH+UuAV+xIj6vY8Z6NNL8CvUpk5/yn56lmqI=; b=mApJFjRtRc6t+LdcNDmbDQTxRUi37aDor5R2UTUkqOx4JBeFFXs6A3sjVqsztjprwK 74LOzlRGCaIqdmZXfvojWAf+bdJtyGlckJhOvs9Txjt0FTpms2kjo527BLdJL8lWXFhJ TxSC1f5YHxZR0fWakzE8PtdoOKTvqbe2Sg4IDl7ldNXUXRXnH163K2ISpqHVSGPdJvgA hmLjoN8X2mKy8Th1zbUyAm6lQx4tbgACCc8cNXVjmPd93lSANV9BjWK9isUQ8W3C5vHQ cXvkGPGLgxKExTrN/buCEHmU8YZFw+OwTUzZr6GEoyjlbDoKL+p9nEN57KjCq9m/FUJ1 M1uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l6wSZzTZH+UuAV+xIj6vY8Z6NNL8CvUpk5/yn56lmqI=; b=y5UQ7G1QIxC1S2J5JrJR0RIfIaEFSI4EhW2QRBAS14G/3OOErSx+zUq9V0ap95kHDY m106eQ+OsfWYF81KHz//ZXUo0aRF/GLu9+EtKsIOpbfwgjWpoq+dOehdoXr53pOVrRVK 5n7S3RuauEuP6gOhiyDhU1OS/hy27188Jx6WQJfcOxfvMwDtvEZ5ymVkipDabEH38ZlY vpLfWyFhqTAfTuQDWVlBaA8EAmOB79oIIbVOHmOtv211Q/+pjUcQDaaQdcKQt0QXYBFT sOk7/CYNY7jg/RUzO3gMAxbd+9BrpEn1CLXvUZbQ/29XDClhdwTDXIANfKkkxahlGUM+ fMkw== X-Gm-Message-State: AOAM531BF86Egnx8L5ZZTVZ8aBRBL2sdFo7V5m2B7PmShk5wAD6BmyXF EX9tqRB+dVXhe58tWWW1Jy+LaA== X-Received: by 2002:a05:6402:2696:b0:42d:e816:8378 with SMTP id w22-20020a056402269600b0042de8168378mr1106178edd.143.1654107841668; Wed, 01 Jun 2022 11:24:01 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p3-20020aa7c4c3000000b0042db87b5ff4sm1340647edr.88.2022.06.01.11.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:23:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 880091FFCB; Wed, 1 Jun 2022 19:05:39 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Cc: qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= Subject: [PULL 20/33] configure: handle host compiler in probe_target_compiler Date: Wed, 1 Jun 2022 19:05:24 +0100 Message-Id: <20220601180537.2329566-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601180537.2329566-1-alex.bennee@linaro.org> References: <20220601180537.2329566-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x529.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini In preparation for handling more binaries than just cc, handle the case of "probe_target_compiler $cpu" directly in the function, setting the target_* variables based on the ones that are used to build QEMU. The clang check also needs to be moved after this fallback. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson Message-Id: <20220517092616.1272238-10-pbonzini@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20220527153603.887929-21-alex.bennee@linaro.org> diff --git a/configure b/configure index fbf6d39f96..217c8b3cac 100755 --- a/configure +++ b/configure @@ -954,10 +954,6 @@ case $git_submodules_action in ;; esac -if eval test -z "\${cross_cc_$cpu}"; then - eval "cross_cc_${cpu}=\$cc" -fi - default_target_list="" mak_wilds="" @@ -2008,13 +2004,6 @@ probe_target_compiler() { if eval test -n "\"\${cross_cc_$1}\""; then if eval has "\"\${cross_cc_$1}\""; then eval "target_cc=\"\${cross_cc_$1}\"" - case $1 in - i386|x86_64) - if $target_cc --version | grep -qi "clang"; then - unset target_cc - fi - ;; - esac fi fi if eval test -n "\"\${cross_as_$1}\""; then @@ -2027,6 +2016,20 @@ probe_target_compiler() { eval "target_ld=\"\${cross_ld_$1}\"" fi fi + if test "$1" = $cpu; then + : ${target_cc:=$cc} + : ${target_as:=$as} + : ${target_ld:=$ld} + fi + if test -n "$target_cc"; then + case $1 in + i386|x86_64) + if $target_cc --version | grep -qi "clang"; then + unset target_cc + fi + ;; + esac + fi } write_target_makefile() {