From patchwork Fri Feb 25 13:15:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 12760263 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 B5ECFC433F5 for ; Fri, 25 Feb 2022 13:15:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D5688D0002; Fri, 25 Feb 2022 08:15:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 25E008D0001; Fri, 25 Feb 2022 08:15:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FED98D0002; Fri, 25 Feb 2022 08:15:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id EFF6B8D0001 for ; Fri, 25 Feb 2022 08:15:50 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C5DFD611CC for ; Fri, 25 Feb 2022 13:15:50 +0000 (UTC) X-FDA: 79181349660.15.FC4CA17 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by imf28.hostedemail.com (Postfix) with ESMTP id 1A641C000E for ; Fri, 25 Feb 2022 13:15:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 890461F45EAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1645794948; bh=iANknHWAfv72XgX0hMtZ0uWhgfV7gO/pAWFzD/WhLYU=; h=From:To:Cc:Subject:Date:From; b=GsuTzxt3Rh3nRwaeDhRoTiUXBrE2X/C21+/Ig6m3l95ExxJ1r2LtLMaw+NBw/S0Vz qFcRQH9PtPo53Xi0OfZsJSlSLllgKpu1s4bMEK10MJr0NG/MFvp555CgFgdjyZZoXt djHBTh1aKRmco39uOL2eTOpY79T7X7x3S9qBw97rUuNnl4M33FzYJ1vZv1qvw8fNVw DbbjJVcH8iGjYn8QldDoATvRMdiiXxuzc2dm5sFW9nzU0qN3LMkEGie+xQAkslxhmK DCD/3GHdIhlwCNPPJbO88Q5FJWI4RvfTkVyMJvjDx3BBd54czneO147vWq4S5wbjUH GBuAUgqsR53OQ== 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 Subject: [PATCH] selftests, x86: fix how check_cc.sh is being invoked Date: Fri, 25 Feb 2022 13:15:43 +0000 Message-Id: <9320d88a3a65350d9bfdc5e258742cd0b162f017.1645794882.git.guillaume.tucker@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 1A641C000E X-Stat-Signature: 1wyzr4z8uygewg6txpkwpstiuzt3acbe Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=GsuTzxt3; dmarc=pass (policy=none) header.from=collabora.com; spf=pass (imf28.hostedemail.com: domain of guillaume.tucker@collabora.com designates 46.235.227.227 as permitted sender) smtp.mailfrom=guillaume.tucker@collabora.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1645794949-485123 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000037, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Add quotes around $(CC) when calling check_cc.sh from a Makefile to pass the value as a single argument to the script even if it has several words such as "ccache gcc". Conversely, remove quotes in check_cc.sh when calling $CC to make it a command with potentially several arguments again. Fixes: e9886ace222e ("selftests, x86: Rework x86 target architecture detection") Tested-by: "kernelci.org bot" Signed-off-by: Guillaume Tucker --- tools/testing/selftests/vm/Makefile | 6 +++--- tools/testing/selftests/x86/Makefile | 6 +++--- tools/testing/selftests/x86/check_cc.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 1607322a112c..d934f026ebb5 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -49,9 +49,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) 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 \ diff --git a/tools/testing/selftests/x86/check_cc.sh b/tools/testing/selftests/x86/check_cc.sh index 3e2089c8cf54..aff2c15018b5 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