From patchwork Fri Mar 11 10:05:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 12777733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E047FC433EF for ; Fri, 11 Mar 2022 10:05:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 569898D0002; Fri, 11 Mar 2022 05:05:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 518748D0001; Fri, 11 Mar 2022 05:05:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 407348D0002; Fri, 11 Mar 2022 05:05:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 2CD018D0001 for ; Fri, 11 Mar 2022 05:05:45 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 000BB12035B for ; Fri, 11 Mar 2022 10:05:44 +0000 (UTC) X-FDA: 79231673808.11.2A9A723 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by imf29.hostedemail.com (Postfix) with ESMTP id 68D6B12001E for ; Fri, 11 Mar 2022 10:05:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id C21C81F4650C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646993137; bh=jEWELbnkMSAaJxzzNjMAQVWOOpBG/dxBEOwA4lVOpmc=; h=From:To:Cc:Subject:Date:From; b=T+wVZZTNYiEKC/biq+/wfWjW7u/lNc+EUyLe9fSJP+w5Hoao4Q/+1h3JYiungcBHP gvtewihWyT70KCx5BNE/ALyU5B43uYGR9d/45TLlEgT7NEPwT/czZuPXWVr7zGrf8U cBwFBeoC5AiHmw45hf+Ek8b1EzOL1aBYbj73zumdKS38j5jklu2E3tirDac+Hz3d0L fN+zkrPzqStuI3R8ZVEUwQ8TiTCsrWqBZ+yFWq7cOTJNunXlG8IfhgSgOtpk/IOEvB iDaQA9buO0avwnYxmhYVHRLkKr22DUwkeVkh7Eg2aMGFxrUgWG2rVHgmLv7wKdh4X6 qergnIQVCJ5sw== From: Guillaume Tucker To: Shuah Khan , Andrew Morton Cc: Borislav Petkov , Dave Hansen , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernelci@groups.io Subject: [PATCH v2] selftests, x86: fix how check_cc.sh is being invoked Date: Fri, 11 Mar 2022 10:05:30 +0000 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Stat-Signature: m3psfyrhdejcfmejhpkskxhs1h4ocwo7 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=T+wVZZTN; spf=pass (imf29.hostedemail.com: domain of guillaume.tucker@collabora.com designates 46.235.227.227 as permitted sender) smtp.mailfrom=guillaume.tucker@collabora.com; dmarc=pass (policy=none) header.from=collabora.com X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 68D6B12001E X-HE-Tag: 1646993144-866495 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The $(CC) variable used in Makefiles could contain several arguments such as "ccache gcc". These need to be passed as a single string to check_cc.sh, otherwise only the first argument will be used as the compiler command. Without quotes, the $(CC) variable is passed as distinct arguments which causes the script to fail to build trivial programs. Fix this by adding quotes around $(CC) when calling check_cc.sh to pass the whole string as a single argument to the script even if it has several words such as "ccache gcc". Fixes: e9886ace222e ("selftests, x86: Rework x86 target architecture detection") Tested-by: "kernelci.org bot" Signed-off-by: Guillaume Tucker Reviewed-by: Guenter Roeck --- Notes: v2: rebase and drop changes in check_cc.sh tools/testing/selftests/vm/Makefile | 6 +++--- tools/testing/selftests/x86/Makefile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index fbccdda93629..213f6a57d7f6 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -54,9 +54,9 @@ TEST_GEN_FILES += split_huge_page_test TEST_GEN_FILES += ksm_tests ifeq ($(MACHINE),x86_64) -CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_32bit_program.c -m32) -CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_64bit_program.c) -CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh $(CC) ../x86/trivial_program.c -no-pie) +CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_32bit_program.c -m32) +CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_64bit_program.c) +CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_program.c -no-pie) override TARGETS := protection_keys BINARIES_32 := $(TARGETS:%=%_32) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 8a1f62ab3c8e..53df7d3893d3 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -6,9 +6,9 @@ include ../lib.mk .PHONY: all all_32 all_64 warn_32bit_failure clean UNAME_M := $(shell uname -m) -CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32) -CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) -CAN_BUILD_WITH_NOPIE := $(shell ./check_cc.sh $(CC) trivial_program.c -no-pie) +CAN_BUILD_I386 := $(shell ./check_cc.sh "$(CC)" trivial_32bit_program.c -m32) +CAN_BUILD_X86_64 := $(shell ./check_cc.sh "$(CC)" trivial_64bit_program.c) +CAN_BUILD_WITH_NOPIE := $(shell ./check_cc.sh "$(CC)" trivial_program.c -no-pie) TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt test_mremap_vdso \ check_initial_reg_state sigreturn iopl ioperm \