From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E40E228FF; Thu, 13 Jun 2024 12:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281913; cv=none; b=MwQxwQnMqaofG6XajBlNE9c3xN6epcJBKpp9d0q9Uej6qrq8sZEoA9qkja4PThQ9lKu+non0b91hDIHZ5dLGHduPG9I5WPEJ3m2XcCMAnYG13BroX34yjPw7PoS2Mao/Os8RYGY2zq7Aglu2dGQAnm8TnHPXeQeXTnRWNtH21M0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281913; c=relaxed/simple; bh=dQ8aOJTTSsln2k2gAA++MD2yJXZoOPlILz8q56G2hZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wg2+B/afqvts7pa57rgeI04xc/LIrww3yA2kOTKwi5lTWSBDMYlMDCb0VVxNvfbJxCDBa2dqDmKUbB8TUrlHFwqBo3tuXyekYEWCG7RztytsiCikaqHrWGeQE3xzsF84EkY01aJNKFX3a/KAegKXzd8428nCg/lkATn4++Z132s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qbY7ZSAn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qbY7ZSAn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C431C2BBFC; Thu, 13 Jun 2024 12:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718281912; bh=dQ8aOJTTSsln2k2gAA++MD2yJXZoOPlILz8q56G2hZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbY7ZSAnsGTYVMcXlysrxzBfvTBfsTDYE7uh6MO6Nd4wSCAfU0GNREt8ebsFmVnxh oEc1f4L6gaLmcW0GBe/yrc7hQYRoZFnhvPJ7hxBa0qiEZr3s1XOAETgQakOcSRW/vW Ayk2h07RR8zmai//+Usyac8NvDGVaINQEhUAWJT8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , John Hubbard , Reinette Chatre , Shuah Khan , Sasha Levin Subject: [PATCH 5.15 099/402] selftests/resctrl: fix clang build failure: use LOCAL_HDRS Date: Thu, 13 Jun 2024 13:30:56 +0200 Message-ID: <20240613113305.999546792@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113302.116811394@linuxfoundation.org> References: <20240613113302.116811394@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: John Hubbard [ Upstream commit d8171aa4ca72f1a67bf3c14c59441d63c1d2585f ] First of all, in order to build with clang at all, one must first apply Valentin Obst's build fix for LLVM [1]. Once that is done, then when building with clang, via: make LLVM=1 -C tools/testing/selftests ...the following error occurs: clang: error: cannot specify -o when generating multiple output files This is because clang, unlike gcc, won't accept invocations of this form: clang file1.c header2.h Fix this by using selftests/lib.mk facilities for tracking local header file dependencies: add them to LOCAL_HDRS, leaving only the .c files to be passed to the compiler. [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ Fixes: 8e289f454289 ("selftests/resctrl: Add resctrl.h into build deps") Cc: Ilpo Järvinen Signed-off-by: John Hubbard Acked-by: Reinette Chatre Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/resctrl/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile index 2deac2031de9e..021863f86053a 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -5,6 +5,8 @@ CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests +LOCAL_HDRS += $(wildcard *.h) + include ../lib.mk -$(OUTPUT)/resctrl_tests: $(wildcard *.[ch]) +$(OUTPUT)/resctrl_tests: $(wildcard *.c) -- 2.43.0