From patchwork Fri May 27 15:35:50 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: 576490 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8607:0:0:0:0 with SMTP id bb7csp759465mab; Fri, 27 May 2022 08:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv5I8+wAZCHgkNxgQ6TZ2Ynbs/0jyzJ28mG/8qzdh+3tKFfsH0DpCDoePJtN+6kWpzcObF X-Received: by 2002:ac8:7fd0:0:b0:2f3:fda4:6ddf with SMTP id b16-20020ac87fd0000000b002f3fda46ddfmr33602693qtk.323.1653667059512; Fri, 27 May 2022 08:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653667059; cv=none; d=google.com; s=arc-20160816; b=HzS1P8Rt36dyY2atO/ZTBtFOOzWiFwbOi4dDEUp4T9TW0+1y/VGxipgDow+xFp2OWj umbDGi6ko5KZ8NL1i/MHAsTxp4EDXs6cM8HRZS7gslF4wW42RF7lz10V/n5OcteqwRDz P9uuLgEZJ5HkHH9tIfVDFoghMG/P0dz+a2WOtF3oFfSjHXcJ61L2J62m9+HtfYdKbzca gViRc/dg9mQbtM/Y8UYs7FxsdCp+G5rpMUg2QR+QWntlWL8AvGMFOInATWI7kEO7LV0g msX4SD0ElhsXtB/qKrIzWxoTqH+MTq+iIaxgYDmoOqRc7YA/rj8RTKWM2BRpuoDiho8v KqlA== 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=p0qk9B+orXS80H7xnfO/AqbYjsEY7R7F9OwvPTCCFHo=; b=otJ61sHLfzgCHxeYGHJ5IwzpYzVL08y4CAJrnEOI/JSEYErqGG/2srcMzBlj2eN61r Mosqya9sPXCksCOaVnC505ZaEIFjvhXjgve15AHpnP9CTXxALhHLzDz3T7Qd0c4jh9/8 SlReU/GyVmG/PbtnQN0eTnMSXb7yIw2xS5yaq+d8iLkM+bCrClm8xB8SmeQGH+Bob1Nx 8AYwqdnK3GuzM/elmCcTeBVJlVJHW4lPtpBqXR0/Rn1hjcozz+cO0n4aXMZKJcDNX5+n epmvDeq2f0WAxT/lz4HOKkS8/8TzvJkzYR9rRyx4wiAhLrqgWXgZsILGgisvMVifULUd S5gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jVJj3dgg; 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 x3-20020a05622a000300b002f92de6a601si3115905qtw.188.2022.05.27.08.57.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 May 2022 08:57:39 -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=jVJj3dgg; 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]:55256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nucLL-0007aw-3l for patch@linaro.org; Fri, 27 May 2022 11:57:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuc8G-0002qH-0V for qemu-devel@nongnu.org; Fri, 27 May 2022 11:44:08 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:41805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuc8E-0003rz-FU for qemu-devel@nongnu.org; Fri, 27 May 2022 11:44:07 -0400 Received: by mail-wr1-x42c.google.com with SMTP id l30so6359511wrb.8 for ; Fri, 27 May 2022 08:44: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=p0qk9B+orXS80H7xnfO/AqbYjsEY7R7F9OwvPTCCFHo=; b=jVJj3dggJleqQYWINNChGQj7V9gNqEh7HQFUi7Y27u9mwB8RFHOR/M85sQxQ8VxcbJ l8Qja3GiEuMUswzhHMqJ7YS1RO7slj8rKUd+dmvHycNjG9kDDWI45iywHtwfaw3wUUQo aZKeY4OAmHL4rmTMiCfbQJWskMYP8I9vRP2mlhzaR0sOc1MSOHRHebe7CsSnxF0u8LWO OH79Z4niAgGj+Iodk7n+mFq2aS1A0NEj5BOKztNhtAGELDoGPuhhQjwhFJvkAKhhSbEm AVCwic149rLSInDIp3lVKOOEGF+SQmCiKggiXYIMaUNrNoRPsL6/G4mqAIZdkCePk4bg 4ycA== 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=p0qk9B+orXS80H7xnfO/AqbYjsEY7R7F9OwvPTCCFHo=; b=gEmhR/hoIVLks4Ndg/Bge6cl8dRFc/X19egzJKCD862V0rj8bLyGv1O8Wah+kQOJr1 5FdN9vhlCO2EKKfQKDLIFdEes4XxoFYiDe24wQXjWsQh+yDTGpy2m0HvyWyxJJ8NwmOD eKmdV8Mb9xY+cCiyUVAC2JdPCAUzbEjVXoSoRzVqsqXdeGTEULuqRu0nv2PtETMVjXQt EkUIAiDSGc2BlzUTZEUqPaHp81aTzwz2lJztV/b5SsnGNpsmYEIprhb62CFBkHEb5W2N SoTCa59+Du6sXd9keB5lkOSvcTFi2sYR9AytwQ8lpkg+8Vmr9349Afg/jyfLwRHANxyD /vlQ== X-Gm-Message-State: AOAM530lP8alFdPpfVZ/1L8RTfrD8sdtPEpVvJhCzsfITXMc5pLGMqRT XYPdBjqGeWGy5wNyLn+R9ivUOA== X-Received: by 2002:a05:6000:345:b0:210:2227:3ecf with SMTP id e5-20020a056000034500b0021022273ecfmr246637wre.194.1653666245164; Fri, 27 May 2022 08:44:05 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x5-20020a05600c21c500b0039787538c9csm2687120wmj.20.2022.05.27.08.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 08:43:58 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 979C51FFCC; Fri, 27 May 2022 16:36:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: fam@euphon.net, berrange@redhat.com, f4bug@amsat.org, aurelien@aurel32.net, pbonzini@redhat.com, stefanha@redhat.com, crosa@redhat.com, Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v1 20/33] configure: handle host compiler in probe_target_compiler Date: Fri, 27 May 2022 16:35:50 +0100 Message-Id: <20220527153603.887929-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220527153603.887929-1-alex.bennee@linaro.org> References: <20220527153603.887929-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, 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 --- configure | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 31c1ab2579..addbb0fe44 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="" @@ -2003,13 +1999,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 @@ -2022,6 +2011,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() {