Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4250496pxb; Fri, 11 Feb 2022 21:47:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXVJ/86Jtn5tzJy/IJdLyeXwwCbMscW36WuSa5ztoQE5Ghv05OpXq6hAl33500suiQmehO X-Received: by 2002:a17:903:41ce:: with SMTP id u14mr325104ple.124.1644644827836; Fri, 11 Feb 2022 21:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644644827; cv=none; d=google.com; s=arc-20160816; b=G2FaoeQdcOWwbjbmj0Yv5LhuvnB9i+KjTa2euBWpXdrRWPIyMADgZP9VwgZ5VfvAcg Dqce34CIzrcawUXpHeRlJSNj0mwNuI4DNw0XMCMa/LBxoHBcdBqLCxvQx2PVx4j67WqN 1Mt53tvhoXf0WiImo9//F9pWZB+JXu1ZdRGrM1jPMnzeHFLdJu60EmiDdz+l4/wCMkF7 58Ur0a5jIxH1G9oIaFotzIbzdU8GouN3c6TSNSPJg45z047X/infBqEluWPKeOfaEINE yN+drXEsW+J+2QzgdZb3QteV5xhcz9yB9nisVOnmXXsOCHEl3EUneK7SLLp3ZKZ22XGv t2mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=SKQnHoJObR57wOWY6iwECpi3wrQN0+tC6ng/tbRs1IM=; b=K1zk0vWV9Hrz1/ZJ+90xZBiH9kMFbDI8lN0262M3iCuUX0m6h+aSnVaE2Lbi1gqrz7 MVy/IHVVfOGKIIsVsKMgaq0JLgZXobRdIsOsZQDhCcBCY16x3Gvotxnb0bP3y8kaxTzM 9DmPCKi5/uML75GHTATr3e2imgOvw8cr9STA5S6FquOUzv/kLaRp1THujDrDp/znY4uM MGqCPT5vAKVdWZNW8YvZ+kPogZuHAahOF4UOAS3vIqleA/bKFfYmHxcgeEM8t6jvaEA4 6qt372oW1jN3A2zR0BkVrkb+QZg8xU6H0MeOyLj541HSoq+x393ULOeTwm3REzlqXS8r GbdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aDieopZ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw14si7327714pjb.82.2022.02.11.21.46.54; Fri, 11 Feb 2022 21:47:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aDieopZ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345083AbiBJWmj (ORCPT + 95 others); Thu, 10 Feb 2022 17:42:39 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345032AbiBJWmh (ORCPT ); Thu, 10 Feb 2022 17:42:37 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B85026D4; Thu, 10 Feb 2022 14:42:37 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id 850A11F467B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644532956; bh=bedGo7xcKtSpxhKnR+SjKvtdtKnjMdpeXSz+eoAK79g=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=aDieopZ85m1PLSn0SM2YpgfuPUXWCpFgbf7eegoSQGvbnj+qcVoxsqfwwBj4UXKV/ jTdy+wGP3V7ojgOOycAjGc1E6awJpB6rzm7pQa7EYynzk7PEvKmqTkDgDT8u4eCgqe 3YsWQD1/WOUATmWAjME6u18BS7fjFCnSc72kYytUr2+ojQGKihgGQIskMrmsSMS+yt +S1AIAkeIGpGksvE/hK7vtZpX4EtXB7RNcE21sNUe/MTfrlQ8nAYlNxn4PRrvkuyFV iM5m5OtbVY1vxEiBsgKJ78oHImNSpr8f+ZgTg4ZOysKrNMFHi68rxaEcsOk5oBkPMJ gBdQRwAH2Q7eQ== Message-ID: <81619c13-41e6-3aab-4cf7-9b6d5a11e05c@collabora.com> Date: Fri, 11 Feb 2022 03:41:54 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Cc: usama.anjum@collabora.com, kernel@collabora.com, kernelci@groups.io, "kernelci.org bot" Subject: Re: [PATCH 1/2] selftests: x86: allow expansion of $(CC) Content-Language: en-US To: Shuah Khan , Jarkko Sakkinen , Dave Hansen , Shuah Khan , Andy Lutomirski , Borislav Petkov , Jethro Beekman , "open list:INTEL SGX" , "open list:KERNEL SELFTEST FRAMEWORK" , open list References: <20220210190642.1477814-1-usama.anjum@collabora.com> <20220210190642.1477814-2-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/22 1:51 AM, Shuah Khan wrote: > On 2/10/22 12:06 PM, Muhammad Usama Anjum wrote: >> CC can have multiple sub-strings like "ccache gcc". Erorr pops up if >> it is treated as single string and double quote are used around it. >> This can be fixed by removing the quotes and not treating CC a single >> string. >> >> Fixes: e9886ace222e ("selftests, x86: Rework x86 target architecture >> detection") >> Reported-by: "kernelci.org bot" >> Signed-off-by: Muhammad Usama Anjum >> --- >>   tools/testing/selftests/x86/check_cc.sh | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tools/testing/selftests/x86/check_cc.sh >> b/tools/testing/selftests/x86/check_cc.sh >> index 3e2089c8cf549..aff2c15018b53 100755 >> --- a/tools/testing/selftests/x86/check_cc.sh >> +++ b/tools/testing/selftests/x86/check_cc.sh >> @@ -7,7 +7,7 @@ CC="$1" >>   TESTPROG="$2" >>   shift 2 >>   -if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then >> +if $CC -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then >>       echo 1 >>   else >>       echo 0 >> > > The intent is testing if $CC is set. Does this change work when > $CC is not set? > Yeah, it works. I've added a debug variable inside sgx/Makefile and it is detecting empty argument correctly as well. --- a/tools/testing/selftests/sgx/Makefile +++ b/tools/testing/selftests/sgx/Makefile @@ -6,7 +6,7 @@ include ../lib.mk CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh "$(CC)" \ ../x86/trivial_64bit_program.c) - +$(info $$CAN_BUILD_X86_64 is [${CAN_BUILD_X86_64}]) Wrong examples: ➜ sgx (next-20220210_) ✗ make CC="" $CAN_BUILD_X86_64 is [0] ➜ sgx (next-20220210_) ✗ make CC="cache gcc" $CAN_BUILD_X86_64 is [0] Correct examples: ➜ sgx (next-20220210_) ✗ make CC=gcc $CAN_BUILD_X86_64 is [1] ➜ sgx (next-20220210_) ✗ make $CAN_BUILD_X86_64 is [1] ➜ sgx (next-20220210_) ✗ make CC="ccache gcc" $CAN_BUILD_X86_64 is [1] ➜ sgx (next-20220210_) ✗ make CC="gcc" $CAN_BUILD_X86_64 is [1] ➜ sgx (next-20220210_) ✗ make CC="clang" $CAN_BUILD_X86_64 is [1] ➜ sgx (next-20220210_) ✗ make CC="ccache clang" $CAN_BUILD_X86_64 is [1]